@machina.ai/cell-cli 1.10.0-rc1 → 1.13.0-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.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/package.json +14 -12
- package/dist/src/commands/extensions/disable.d.ts +1 -1
- package/dist/src/commands/extensions/disable.js +19 -8
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/enable.d.ts +1 -1
- package/dist/src/commands/extensions/enable.js +19 -9
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.js +46 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.js.map +1 -0
- package/dist/src/commands/extensions/install.d.ts +1 -0
- package/dist/src/commands/extensions/install.js +29 -4
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +39 -19
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.js +16 -4
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/list.js +17 -6
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/new.js +14 -20
- package/dist/src/commands/extensions/new.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.js +16 -4
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/update.js +28 -23
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions/validate.d.ts +12 -0
- package/dist/src/commands/extensions/validate.js +83 -0
- package/dist/src/commands/extensions/validate.js.map +1 -0
- package/dist/src/commands/extensions/validate.test.d.ts +6 -0
- package/dist/src/commands/extensions/validate.test.js +93 -0
- package/dist/src/commands/extensions/validate.test.js.map +1 -0
- package/dist/src/commands/extensions.js +3 -0
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/mcp/add.js +7 -4
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/add.test.d.ts +6 -0
- package/dist/src/commands/mcp/add.test.js +247 -0
- package/dist/src/commands/mcp/add.test.js.map +1 -0
- package/dist/src/commands/mcp/list.js +18 -9
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/list.test.d.ts +6 -0
- package/dist/src/commands/mcp/list.test.js +128 -0
- package/dist/src/commands/mcp/list.test.js.map +1 -0
- package/dist/src/commands/mcp/remove.js +3 -2
- package/dist/src/commands/mcp/remove.js.map +1 -1
- package/dist/src/commands/mcp/remove.test.d.ts +6 -0
- package/dist/src/commands/mcp/remove.test.js +175 -0
- package/dist/src/commands/mcp/remove.test.js.map +1 -0
- package/dist/src/commands/mcp.test.d.ts +6 -0
- package/dist/src/commands/mcp.test.js +62 -0
- package/dist/src/commands/mcp.test.js.map +1 -0
- package/dist/src/config/auth.js +0 -3
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +6 -15
- package/dist/src/config/config.integration.test.d.ts +6 -0
- package/dist/src/config/config.integration.test.js +321 -0
- package/dist/src/config/config.integration.test.js.map +1 -0
- package/dist/src/config/config.js +85 -164
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.d.ts +6 -0
- package/dist/src/config/config.test.js +1972 -0
- package/dist/src/config/config.test.js.map +1 -0
- package/dist/src/config/extension-manager.d.ts +63 -0
- package/dist/src/config/extension-manager.js +450 -0
- package/dist/src/config/extension-manager.js.map +1 -0
- package/dist/src/config/extension.d.ts +4 -61
- package/dist/src/config/extension.js +1 -538
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extension.test.d.ts +6 -0
- package/dist/src/config/extension.test.js +1412 -0
- package/dist/src/config/extension.test.js.map +1 -0
- package/dist/src/config/extensions/consent.d.ts +38 -0
- package/dist/src/config/extensions/consent.js +123 -0
- package/dist/src/config/extensions/consent.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.d.ts +2 -2
- package/dist/src/config/extensions/extensionEnablement.js +7 -5
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.test.js +31 -28
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.d.ts +15 -0
- package/dist/src/config/extensions/extensionSettings.js +113 -0
- package/dist/src/config/extensions/extensionSettings.js.map +1 -0
- package/dist/src/config/extensions/extensionSettings.test.d.ts +6 -0
- package/dist/src/config/extensions/extensionSettings.test.js +254 -0
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +18 -9
- package/dist/src/config/extensions/github.js +108 -36
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +158 -164
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/github_fetch.d.ts +1 -1
- package/dist/src/config/extensions/github_fetch.js +13 -1
- package/dist/src/config/extensions/github_fetch.js.map +1 -1
- package/dist/src/config/extensions/github_fetch.test.d.ts +6 -0
- package/dist/src/config/extensions/github_fetch.test.js +169 -0
- package/dist/src/config/extensions/github_fetch.test.js.map +1 -0
- package/dist/src/config/extensions/storage.d.ts +14 -0
- package/dist/src/config/extensions/storage.js +32 -0
- package/dist/src/config/extensions/storage.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +5 -4
- package/dist/src/config/extensions/update.js +41 -37
- package/dist/src/config/extensions/update.js.map +1 -1
- package/dist/src/config/extensions/update.test.js +72 -74
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/extensions/variableSchema.d.ts +0 -4
- package/dist/src/config/extensions/variableSchema.js.map +1 -1
- package/dist/src/config/extensions/variables.d.ts +4 -0
- package/dist/src/config/extensions/variables.js +6 -0
- package/dist/src/config/extensions/variables.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +5 -1
- package/dist/src/config/keyBindings.js +34 -10
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/keyBindings.test.js +17 -0
- package/dist/src/config/keyBindings.test.js.map +1 -1
- package/dist/src/config/policies/read-only.toml +56 -0
- package/dist/src/config/policies/write.toml +63 -0
- package/dist/src/config/policies/yolo.toml +31 -0
- package/dist/src/config/policy-engine.integration.test.js +41 -38
- package/dist/src/config/policy-engine.integration.test.js.map +1 -1
- package/dist/src/config/policy.d.ts +4 -3
- package/dist/src/config/policy.js +13 -142
- package/dist/src/config/policy.js.map +1 -1
- package/dist/src/config/sandboxConfig.d.ts +1 -2
- package/dist/src/config/sandboxConfig.js +7 -6
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +2 -1
- package/dist/src/config/settings.js +59 -15
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.d.ts +6 -0
- package/dist/src/config/settings.test.js +2000 -0
- package/dist/src/config/settings.test.js.map +1 -0
- package/dist/src/config/settingsSchema.d.ts +170 -28
- package/dist/src/config/settingsSchema.js +418 -27
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +42 -1
- 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 +4 -2
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/core/initializer.js +2 -1
- package/dist/src/core/initializer.js.map +1 -1
- package/dist/src/gemini.d.ts +1 -1
- package/dist/src/gemini.js +63 -27
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +123 -34
- package/dist/src/gemini.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.d.ts +9 -1
- package/dist/src/nonInteractiveCli.js +205 -10
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.d.ts +6 -0
- package/dist/src/nonInteractiveCli.test.js +984 -0
- package/dist/src/nonInteractiveCli.test.js.map +1 -0
- package/dist/src/nonInteractiveCliCommands.js +2 -2
- package/dist/src/nonInteractiveCliCommands.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +4 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +22 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/CommandService.js +2 -1
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/services/FeedbackService.js +2 -2
- package/dist/src/services/FeedbackService.js.map +1 -1
- package/dist/src/services/FileCommandLoader.test.d.ts +6 -0
- package/dist/src/services/FileCommandLoader.test.js +971 -0
- package/dist/src/services/FileCommandLoader.test.js.map +1 -0
- package/dist/src/services/McpPromptLoader.js +2 -2
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +4 -2
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/services/prompt-processors/argumentProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/argumentProcessor.test.js +40 -0
- package/dist/src/services/prompt-processors/argumentProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +3 -2
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/shellProcessor.test.js +482 -0
- package/dist/src/services/prompt-processors/shellProcessor.test.js.map +1 -0
- package/dist/src/test-utils/async.d.ts +9 -0
- package/dist/src/test-utils/async.js +29 -0
- package/dist/src/test-utils/async.js.map +1 -0
- package/dist/src/test-utils/createExtension.d.ts +3 -1
- package/dist/src/test-utils/createExtension.js +3 -3
- package/dist/src/test-utils/createExtension.js.map +1 -1
- package/dist/src/test-utils/render.d.ts +17 -2
- package/dist/src/test-utils/render.js +69 -4
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/test-utils/render.test.d.ts +6 -0
- package/dist/src/test-utils/render.test.js +79 -0
- package/dist/src/test-utils/render.test.js.map +1 -0
- package/dist/src/ui/App.test.d.ts +6 -0
- package/dist/src/ui/App.test.js +110 -0
- package/dist/src/ui/App.test.js.map +1 -0
- package/dist/src/ui/AppContainer.js +223 -92
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +531 -147
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.d.ts +14 -0
- package/dist/src/ui/auth/ApiAuthDialog.js +26 -0
- package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.js +91 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.d.ts +1 -1
- package/dist/src/ui/auth/AuthDialog.js +9 -3
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/useAuth.d.ts +3 -1
- package/dist/src/ui/auth/useAuth.js +35 -4
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/colors.js +3 -0
- package/dist/src/ui/colors.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +1 -1
- package/dist/src/ui/commands/aboutCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/aboutCommand.test.js +130 -0
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.js +1 -1
- package/dist/src/ui/commands/authCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/authCommand.test.js +30 -0
- package/dist/src/ui/commands/authCommand.test.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.js +1 -1
- package/dist/src/ui/commands/bugCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/bugCommand.test.js +105 -0
- package/dist/src/ui/commands/bugCommand.test.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.js +1 -1
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/chatCommand.test.js +555 -0
- package/dist/src/ui/commands/chatCommand.test.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.js +1 -1
- package/dist/src/ui/commands/clearCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/clearCommand.test.js +76 -0
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.js +1 -1
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/compressCommand.test.js +98 -0
- package/dist/src/ui/commands/compressCommand.test.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.js +2 -1
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/copyCommand.test.js +242 -0
- package/dist/src/ui/commands/copyCommand.test.js.map +1 -0
- package/dist/src/ui/commands/corgiCommand.js +1 -1
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/corgiCommand.test.js +28 -0
- package/dist/src/ui/commands/corgiCommand.test.js.map +1 -0
- package/dist/src/ui/commands/directoryCommand.js +1 -1
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/directoryCommand.test.js +144 -0
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/docsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/docsCommand.test.js +72 -0
- package/dist/src/ui/commands/docsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.js +1 -1
- package/dist/src/ui/commands/editorCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/editorCommand.test.js +27 -0
- package/dist/src/ui/commands/editorCommand.test.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.js +64 -11
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/extensionsCommand.test.js +315 -0
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.js +1 -1
- package/dist/src/ui/commands/helpCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/helpCommand.test.js +42 -0
- package/dist/src/ui/commands/helpCommand.test.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.js +6 -6
- package/dist/src/ui/commands/ideCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/ideCommand.test.js +205 -0
- package/dist/src/ui/commands/ideCommand.test.js.map +1 -0
- package/dist/src/ui/commands/initCommand.js +1 -1
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/initCommand.test.js +80 -0
- package/dist/src/ui/commands/initCommand.test.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.js +110 -100
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/mcpCommand.test.js +152 -0
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.js +6 -6
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/memoryCommand.test.js +268 -0
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -0
- package/dist/src/ui/commands/policiesCommand.d.ts +7 -0
- package/dist/src/ui/commands/policiesCommand.js +59 -0
- package/dist/src/ui/commands/policiesCommand.js.map +1 -0
- package/dist/src/ui/commands/policiesCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/policiesCommand.test.js +83 -0
- package/dist/src/ui/commands/policiesCommand.test.js.map +1 -0
- package/dist/src/ui/commands/privacyCommand.js +1 -1
- package/dist/src/ui/commands/privacyCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/privacyCommand.test.js +32 -0
- package/dist/src/ui/commands/privacyCommand.test.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.js +1 -1
- package/dist/src/ui/commands/quitCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/quitCommand.test.js +50 -0
- package/dist/src/ui/commands/quitCommand.test.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/restoreCommand.test.js +190 -0
- package/dist/src/ui/commands/restoreCommand.test.js.map +1 -0
- package/dist/src/ui/commands/settingsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/settingsCommand.test.js +30 -0
- package/dist/src/ui/commands/settingsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js +4 -3
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js +1 -2
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.js +3 -3
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/statsCommand.test.js +53 -0
- package/dist/src/ui/commands/statsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/terminalSetupCommand.test.js +66 -0
- package/dist/src/ui/commands/terminalSetupCommand.test.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.js +1 -1
- package/dist/src/ui/commands/themeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/themeCommand.test.js +32 -0
- package/dist/src/ui/commands/themeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.js +1 -1
- package/dist/src/ui/commands/toolsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/toolsCommand.test.js +100 -0
- package/dist/src/ui/commands/toolsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +1 -0
- package/dist/src/ui/commands/vimCommand.js +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +3 -3
- package/dist/src/ui/components/AsciiArt.js +3 -3
- package/dist/src/ui/components/Composer.js +6 -4
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +21 -3
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.js +4 -6
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
- package/dist/src/ui/components/ConsentPrompt.test.js +18 -8
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +2 -12
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ContextSummaryDisplay.test.js +71 -0
- package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +5 -5
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +8 -3
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.js +4 -3
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Footer.test.d.ts +6 -0
- package/dist/src/ui/components/Footer.test.js +314 -0
- package/dist/src/ui/components/Footer.test.js.map +1 -0
- package/dist/src/ui/components/Header.test.js +13 -5
- package/dist/src/ui/components/Header.test.js.map +1 -1
- package/dist/src/ui/components/Help.test.js +5 -4
- package/dist/src/ui/components/Help.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +4 -0
- package/dist/src/ui/components/InputPrompt.js +80 -12
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/InputPrompt.test.js +1786 -0
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.js +2 -2
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +28 -15
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.js +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +2 -2
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/MainContent.js +15 -4
- package/dist/src/ui/components/MainContent.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +1 -1
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +23 -13
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js +285 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/Notifications.js +38 -5
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +22 -18
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +12 -4
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/PrepareLabel.test.js +14 -8
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +14 -6
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
- package/dist/src/ui/components/QueuedMessageDisplay.js +3 -3
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -1
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +15 -6
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/RawMarkdownIndicator.d.ts +7 -0
- package/dist/src/ui/components/RawMarkdownIndicator.js +8 -0
- package/dist/src/ui/components/RawMarkdownIndicator.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +74 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.js +43 -35
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +554 -545
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +2 -2
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/StatsDisplay.test.js +351 -0
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +4 -2
- package/dist/src/ui/components/ThemeDialog.js +3 -3
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +14 -1
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ToolStatsDisplay.test.js +227 -0
- package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +25 -17
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +3 -1
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/GeminiMessage.test.js +35 -0
- package/dist/src/ui/components/messages/GeminiMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js +3 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.d.ts +7 -0
- package/dist/src/ui/components/messages/Todo.js +91 -0
- package/dist/src/ui/components/messages/Todo.js.map +1 -0
- package/dist/src/ui/components/messages/Todo.test.d.ts +6 -0
- package/dist/src/ui/components/messages/Todo.test.js +114 -0
- package/dist/src/ui/components/messages/Todo.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +29 -15
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +8 -3
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +2 -2
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +30 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserShellMessage.js +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.js +2 -2
- package/dist/src/ui/components/messages/WarningMessage.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +34 -25
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +43 -22
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/TextInput.d.ts +15 -0
- package/dist/src/ui/components/shared/TextInput.js +38 -0
- package/dist/src/ui/components/shared/TextInput.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.test.d.ts +6 -0
- package/dist/src/ui/components/shared/TextInput.test.js +242 -0
- package/dist/src/ui/components/shared/TextInput.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +9 -2
- package/dist/src/ui/components/shared/text-buffer.js +52 -14
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.d.ts +6 -0
- package/dist/src/ui/components/shared/text-buffer.test.js +1761 -0
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.d.ts +6 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js +951 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -0
- package/dist/src/ui/components/views/ChatList.test.js +7 -4
- package/dist/src/ui/components/views/ChatList.test.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +7 -1
- package/dist/src/ui/components/views/ExtensionsList.js +12 -15
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.test.js +43 -29
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.d.ts +0 -1
- package/dist/src/ui/components/views/McpStatus.js +4 -4
- package/dist/src/ui/components/views/McpStatus.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +23 -17
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/components/views/ToolsList.test.js +4 -4
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +4 -2
- package/dist/src/ui/contexts/KeypressContext.js +635 -439
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +634 -515
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/MouseContext.d.ts +21 -0
- package/dist/src/ui/contexts/MouseContext.js +89 -0
- package/dist/src/ui/contexts/MouseContext.js.map +1 -0
- package/dist/src/ui/contexts/MouseContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/MouseContext.test.js +164 -0
- package/dist/src/ui/contexts/MouseContext.test.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/SessionContext.test.js +195 -0
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +7 -4
- package/dist/src/ui/contexts/UIStateContext.d.ts +5 -3
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +33 -11
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +163 -64
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +64 -35
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +2 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +807 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.js +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js +396 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +10 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +32 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +5 -3
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.js +377 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +6 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js +127 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +40 -34
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +14 -4
- package/dist/src/ui/hooks/useExtensionUpdates.js +18 -11
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +52 -35
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -1
- package/dist/src/ui/hooks/useFlickerDetector.test.js +9 -5
- package/dist/src/ui/hooks/useFlickerDetector.test.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.test.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.test.js +131 -0
- package/dist/src/ui/hooks/useFocus.test.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js +188 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +119 -74
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js +1820 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.js +4 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +46 -34
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.js +2 -1
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +40 -9
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistory.test.js +2 -1
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistoryStore.js +2 -1
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +2 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.test.d.ts +6 -0
- package/dist/src/ui/hooks/useKeypress.test.js +223 -0
- package/dist/src/ui/hooks/useKeypress.test.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +29 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +10 -5
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +1 -0
- package/dist/src/ui/hooks/useMessageQueue.js +14 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +173 -35
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useModelCommand.test.js +21 -11
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -1
- package/dist/src/ui/hooks/useMouse.d.ts +17 -0
- package/dist/src/ui/hooks/useMouse.js +27 -0
- package/dist/src/ui/hooks/useMouse.js.map +1 -0
- package/dist/src/ui/hooks/useMouse.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMouse.test.js +57 -0
- package/dist/src/ui/hooks/useMouse.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +2 -2
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +156 -5
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.js +158 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js +26 -6
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.js +2 -2
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.js +13 -14
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +55 -48
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +8 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +61 -36
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.js +65 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +2 -2
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.js +5 -4
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.test.js +272 -183
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.test.js +52 -20
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.js +4 -3
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +20 -8
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +275 -137
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +2 -1
- package/dist/src/ui/hooks/useThemeCommand.js +6 -0
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useTimer.test.js +43 -14
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +229 -242
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/vim.js +2 -1
- package/dist/src/ui/hooks/vim.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.d.ts +6 -0
- package/dist/src/ui/hooks/vim.test.js +1269 -0
- package/dist/src/ui/hooks/vim.test.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.js +39 -6
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/state/extensions.d.ts +1 -0
- package/dist/src/ui/state/extensions.js +1 -0
- package/dist/src/ui/state/extensions.js.map +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -0
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +1 -0
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +2 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +2 -0
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +2 -0
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/color-utils.d.ts +1 -0
- package/dist/src/ui/themes/color-utils.js +8 -1
- package/dist/src/ui/themes/color-utils.js.map +1 -1
- package/dist/src/ui/themes/color-utils.test.js +13 -1
- package/dist/src/ui/themes/color-utils.test.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +2 -0
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +2 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +2 -0
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +2 -0
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +3 -0
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +2 -0
- package/dist/src/ui/themes/semantic-tokens.js +6 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +2 -0
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.js +8 -7
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +3 -0
- package/dist/src/ui/themes/theme.js +14 -3
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/theme.test.d.ts +6 -0
- package/dist/src/ui/themes/theme.test.js +151 -0
- package/dist/src/ui/themes/theme.test.js.map +1 -0
- package/dist/src/ui/themes/xcode.js +2 -0
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +3 -2
- package/dist/src/ui/types.js +2 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +6 -3
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +11 -10
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +19 -10
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +2 -2
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.js +20 -3
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +61 -6
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/computeStats.js +5 -2
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/computeStats.test.d.ts +6 -0
- package/dist/src/ui/utils/computeStats.test.js +262 -0
- package/dist/src/ui/utils/computeStats.test.js.map +1 -0
- package/dist/src/ui/utils/input.d.ts +17 -0
- package/dist/src/ui/utils/input.js +51 -0
- package/dist/src/ui/utils/input.js.map +1 -0
- package/dist/src/ui/utils/input.test.d.ts +6 -0
- package/dist/src/ui/utils/input.test.js +44 -0
- package/dist/src/ui/utils/input.test.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +13 -4
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
- package/dist/src/ui/utils/mouse.d.ts +31 -0
- package/dist/src/ui/utils/mouse.js +164 -0
- package/dist/src/ui/utils/mouse.js.map +1 -0
- package/dist/src/ui/utils/mouse.test.d.ts +6 -0
- package/dist/src/ui/utils/mouse.test.js +131 -0
- package/dist/src/ui/utils/mouse.test.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.js +3 -2
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- package/dist/src/ui/utils/textOutput.d.ts +25 -0
- package/dist/src/ui/utils/textOutput.js +49 -0
- package/dist/src/ui/utils/textOutput.js.map +1 -0
- package/dist/src/ui/utils/textOutput.test.d.ts +6 -0
- package/dist/src/ui/utils/textOutput.test.js +79 -0
- package/dist/src/ui/utils/textOutput.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +9 -2
- package/dist/src/ui/utils/updateCheck.js +38 -30
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.js +48 -59
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -1
- package/dist/src/utils/cleanup.test.d.ts +6 -0
- package/dist/src/utils/cleanup.test.js +49 -0
- package/dist/src/utils/cleanup.test.js.map +1 -0
- package/dist/src/utils/commentJson.js +2 -2
- package/dist/src/utils/commentJson.js.map +1 -1
- package/dist/src/utils/commentJson.test.js +7 -6
- package/dist/src/utils/commentJson.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.d.ts +2 -2
- package/dist/src/utils/envVarResolver.js +10 -7
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/errors.d.ts +1 -0
- package/dist/src/utils/errors.js +66 -5
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/events.d.ts +11 -2
- package/dist/src/utils/events.js +1 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/gitUtils.js +3 -2
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.js +9 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.d.ts +6 -0
- package/dist/src/utils/handleAutoUpdate.test.js +225 -0
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -0
- package/dist/src/utils/installationInfo.js +2 -2
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +8 -4
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/readStdin.js +2 -1
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/sandbox-macos-permissive-open.sb +2 -0
- package/dist/src/utils/sandbox.js +28 -30
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sessionCleanup.js +4 -4
- package/dist/src/utils/sessionCleanup.js.map +1 -1
- package/dist/src/utils/startupWarnings.test.d.ts +6 -0
- package/dist/src/utils/startupWarnings.test.js +61 -0
- package/dist/src/utils/startupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.js +6 -2
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +2 -2
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.js +2 -1
- package/dist/src/zed-integration/acp.js.map +1 -1
- package/dist/src/zed-integration/schema.d.ts +4 -4
- package/dist/src/zed-integration/zedIntegration.d.ts +2 -2
- package/dist/src/zed-integration/zedIntegration.js +16 -25
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/dist/src/config/policy.test.js +0 -336
- package/dist/src/config/policy.test.js.map +0 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +0 -11
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +0 -44
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +0 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +0 -13
- package/dist/src/ui/hooks/useWorkspaceMigration.js +0 -59
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +0 -1
- package/dist/src/utils/package.d.ts +0 -12
- package/dist/src/utils/package.js +0 -24
- package/dist/src/utils/package.js.map +0 -1
- /package/dist/src/{config/policy.test.d.ts → commands/extensions/examples/mcp-server/example.d.ts} +0 -0
|
@@ -5,13 +5,28 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
import { describe, it, expect, vi, beforeEach, afterEach, } from 'vitest';
|
|
8
|
-
import { render
|
|
8
|
+
import { render } from '../test-utils/render.js';
|
|
9
|
+
import { cleanup } from 'ink-testing-library';
|
|
10
|
+
import { act, useContext } from 'react';
|
|
9
11
|
import { AppContainer } from './AppContainer.js';
|
|
10
|
-
import { makeFakeConfig } from '@google/gemini-cli-core';
|
|
12
|
+
import { makeFakeConfig, CoreEvent, } from '@google/gemini-cli-core';
|
|
13
|
+
// Mock coreEvents
|
|
14
|
+
const mockCoreEvents = vi.hoisted(() => ({
|
|
15
|
+
on: vi.fn(),
|
|
16
|
+
off: vi.fn(),
|
|
17
|
+
drainFeedbackBacklog: vi.fn(),
|
|
18
|
+
emit: vi.fn(),
|
|
19
|
+
}));
|
|
20
|
+
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
21
|
+
const actual = await importOriginal();
|
|
22
|
+
return {
|
|
23
|
+
...actual,
|
|
24
|
+
coreEvents: mockCoreEvents,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
11
27
|
import { useQuotaAndFallback } from './hooks/useQuotaAndFallback.js';
|
|
12
28
|
import { UIStateContext } from './contexts/UIStateContext.js';
|
|
13
29
|
import { UIActionsContext, } from './contexts/UIActionsContext.js';
|
|
14
|
-
import { useContext } from 'react';
|
|
15
30
|
// Mock useStdout to capture terminal title writes
|
|
16
31
|
let mockStdout;
|
|
17
32
|
vi.mock('ink', async (importOriginal) => {
|
|
@@ -56,7 +71,6 @@ vi.mock('./hooks/useFolderTrust.js');
|
|
|
56
71
|
vi.mock('./hooks/useIdeTrustListener.js');
|
|
57
72
|
vi.mock('./hooks/useMessageQueue.js');
|
|
58
73
|
vi.mock('./hooks/useAutoAcceptIndicator.js');
|
|
59
|
-
vi.mock('./hooks/useWorkspaceMigration.js');
|
|
60
74
|
vi.mock('./hooks/useGitBranchName.js');
|
|
61
75
|
vi.mock('./contexts/VimModeContext.js');
|
|
62
76
|
vi.mock('./contexts/SessionContext.js');
|
|
@@ -67,6 +81,10 @@ vi.mock('../utils/events.js');
|
|
|
67
81
|
vi.mock('../utils/handleAutoUpdate.js');
|
|
68
82
|
vi.mock('./utils/ConsolePatcher.js');
|
|
69
83
|
vi.mock('../utils/cleanup.js');
|
|
84
|
+
vi.mock('./utils/mouse.js', () => ({
|
|
85
|
+
enableMouseEvents: vi.fn(),
|
|
86
|
+
disableMouseEvents: vi.fn(),
|
|
87
|
+
}));
|
|
70
88
|
import { useHistory } from './hooks/useHistoryManager.js';
|
|
71
89
|
import { useThemeCommand } from './hooks/useThemeCommand.js';
|
|
72
90
|
import { useAuthCommand } from './auth/useAuth.js';
|
|
@@ -81,20 +99,23 @@ import { useFolderTrust } from './hooks/useFolderTrust.js';
|
|
|
81
99
|
import { useIdeTrustListener } from './hooks/useIdeTrustListener.js';
|
|
82
100
|
import { useMessageQueue } from './hooks/useMessageQueue.js';
|
|
83
101
|
import { useAutoAcceptIndicator } from './hooks/useAutoAcceptIndicator.js';
|
|
84
|
-
import { useWorkspaceMigration } from './hooks/useWorkspaceMigration.js';
|
|
85
102
|
import { useGitBranchName } from './hooks/useGitBranchName.js';
|
|
86
103
|
import { useVimMode } from './contexts/VimModeContext.js';
|
|
87
104
|
import { useSessionStats } from './contexts/SessionContext.js';
|
|
88
105
|
import { useTextBuffer } from './components/shared/text-buffer.js';
|
|
89
106
|
import { useLogger } from './hooks/useLogger.js';
|
|
90
107
|
import { useLoadingIndicator } from './hooks/useLoadingIndicator.js';
|
|
108
|
+
import { useKeypress } from './hooks/useKeypress.js';
|
|
91
109
|
import { measureElement } from 'ink';
|
|
92
110
|
import { useTerminalSize } from './hooks/useTerminalSize.js';
|
|
93
111
|
import { ShellExecutionService } from '@google/gemini-cli-core';
|
|
112
|
+
import {} from '../config/extension-manager.js';
|
|
113
|
+
import { enableMouseEvents, disableMouseEvents } from './utils/mouse.js';
|
|
94
114
|
describe('AppContainer State Management', () => {
|
|
95
115
|
let mockConfig;
|
|
96
116
|
let mockSettings;
|
|
97
117
|
let mockInitResult;
|
|
118
|
+
let mockExtensionManager;
|
|
98
119
|
// Create typed mocks for all hooks
|
|
99
120
|
const mockedUseQuotaAndFallback = useQuotaAndFallback;
|
|
100
121
|
const mockedUseHistory = useHistory;
|
|
@@ -111,13 +132,13 @@ describe('AppContainer State Management', () => {
|
|
|
111
132
|
const mockedUseIdeTrustListener = useIdeTrustListener;
|
|
112
133
|
const mockedUseMessageQueue = useMessageQueue;
|
|
113
134
|
const mockedUseAutoAcceptIndicator = useAutoAcceptIndicator;
|
|
114
|
-
const mockedUseWorkspaceMigration = useWorkspaceMigration;
|
|
115
135
|
const mockedUseGitBranchName = useGitBranchName;
|
|
116
136
|
const mockedUseVimMode = useVimMode;
|
|
117
137
|
const mockedUseSessionStats = useSessionStats;
|
|
118
138
|
const mockedUseTextBuffer = useTextBuffer;
|
|
119
139
|
const mockedUseLogger = useLogger;
|
|
120
140
|
const mockedUseLoadingIndicator = useLoadingIndicator;
|
|
141
|
+
const mockedUseKeypress = useKeypress;
|
|
121
142
|
beforeEach(() => {
|
|
122
143
|
vi.clearAllMocks();
|
|
123
144
|
// Initialize mock stdout for terminal title tests
|
|
@@ -208,12 +229,6 @@ describe('AppContainer State Management', () => {
|
|
|
208
229
|
getQueuedMessagesText: vi.fn().mockReturnValue(''),
|
|
209
230
|
});
|
|
210
231
|
mockedUseAutoAcceptIndicator.mockReturnValue(false);
|
|
211
|
-
mockedUseWorkspaceMigration.mockReturnValue({
|
|
212
|
-
showWorkspaceMigrationDialog: false,
|
|
213
|
-
workspaceExtensions: [],
|
|
214
|
-
onWorkspaceMigrationDialogOpen: vi.fn(),
|
|
215
|
-
onWorkspaceMigrationDialogClose: vi.fn(),
|
|
216
|
-
});
|
|
217
232
|
mockedUseGitBranchName.mockReturnValue('main');
|
|
218
233
|
mockedUseVimMode.mockReturnValue({
|
|
219
234
|
isVimEnabled: false,
|
|
@@ -244,6 +259,13 @@ describe('AppContainer State Management', () => {
|
|
|
244
259
|
mockConfig = makeFakeConfig();
|
|
245
260
|
// Mock config's getTargetDir to return consistent workspace directory
|
|
246
261
|
vi.spyOn(mockConfig, 'getTargetDir').mockReturnValue('/test/workspace');
|
|
262
|
+
mockExtensionManager = vi.mockObject({
|
|
263
|
+
getExtensions: vi.fn().mockReturnValue([]),
|
|
264
|
+
setRequestConsent: vi.fn(),
|
|
265
|
+
setRequestSetting: vi.fn(),
|
|
266
|
+
start: vi.fn(),
|
|
267
|
+
});
|
|
268
|
+
vi.spyOn(mockConfig, 'getExtensionLoader').mockReturnValue(mockExtensionManager);
|
|
247
269
|
// Mock LoadedSettings
|
|
248
270
|
mockSettings = {
|
|
249
271
|
merged: {
|
|
@@ -270,27 +292,33 @@ describe('AppContainer State Management', () => {
|
|
|
270
292
|
cleanup();
|
|
271
293
|
});
|
|
272
294
|
describe('Basic Rendering', () => {
|
|
273
|
-
it('renders without crashing with minimal props', () => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
295
|
+
it('renders without crashing with minimal props', async () => {
|
|
296
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
297
|
+
await act(async () => {
|
|
298
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
299
|
+
});
|
|
300
|
+
unmount();
|
|
277
301
|
});
|
|
278
|
-
it('renders with startup warnings', () => {
|
|
302
|
+
it('renders with startup warnings', async () => {
|
|
279
303
|
const startupWarnings = ['Warning 1', 'Warning 2'];
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
304
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, startupWarnings: startupWarnings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
305
|
+
await act(async () => {
|
|
306
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
307
|
+
});
|
|
308
|
+
unmount();
|
|
283
309
|
});
|
|
284
310
|
});
|
|
285
311
|
describe('State Initialization', () => {
|
|
286
|
-
it('initializes with theme error from initialization result', () => {
|
|
312
|
+
it('initializes with theme error from initialization result', async () => {
|
|
287
313
|
const initResultWithError = {
|
|
288
314
|
...mockInitResult,
|
|
289
315
|
themeError: 'Failed to load theme',
|
|
290
316
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
317
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: initResultWithError }));
|
|
318
|
+
await act(async () => {
|
|
319
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
320
|
+
});
|
|
321
|
+
unmount();
|
|
294
322
|
});
|
|
295
323
|
it('handles debug mode state', () => {
|
|
296
324
|
const debugConfig = makeFakeConfig();
|
|
@@ -301,29 +329,38 @@ describe('AppContainer State Management', () => {
|
|
|
301
329
|
});
|
|
302
330
|
});
|
|
303
331
|
describe('Context Providers', () => {
|
|
304
|
-
it('provides AppContext with correct values', () => {
|
|
332
|
+
it('provides AppContext with correct values', async () => {
|
|
305
333
|
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "2.0.0", initializationResult: mockInitResult }));
|
|
334
|
+
await act(async () => {
|
|
335
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
336
|
+
});
|
|
306
337
|
// Should render and unmount cleanly
|
|
307
338
|
expect(() => unmount()).not.toThrow();
|
|
308
339
|
});
|
|
309
|
-
it('provides UIStateContext with state management', () => {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
340
|
+
it('provides UIStateContext with state management', async () => {
|
|
341
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
342
|
+
await act(async () => {
|
|
343
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
344
|
+
});
|
|
345
|
+
unmount();
|
|
313
346
|
});
|
|
314
|
-
it('provides UIActionsContext with action handlers', () => {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
347
|
+
it('provides UIActionsContext with action handlers', async () => {
|
|
348
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
349
|
+
await act(async () => {
|
|
350
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
351
|
+
});
|
|
352
|
+
unmount();
|
|
318
353
|
});
|
|
319
|
-
it('provides ConfigContext with config object', () => {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
354
|
+
it('provides ConfigContext with config object', async () => {
|
|
355
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
356
|
+
await act(async () => {
|
|
357
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
358
|
+
});
|
|
359
|
+
unmount();
|
|
323
360
|
});
|
|
324
361
|
});
|
|
325
362
|
describe('Settings Integration', () => {
|
|
326
|
-
it('handles settings with all display options disabled', () => {
|
|
363
|
+
it('handles settings with all display options disabled', async () => {
|
|
327
364
|
const settingsAllHidden = {
|
|
328
365
|
merged: {
|
|
329
366
|
hideBanner: true,
|
|
@@ -332,11 +369,13 @@ describe('AppContainer State Management', () => {
|
|
|
332
369
|
showMemoryUsage: false,
|
|
333
370
|
},
|
|
334
371
|
};
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
372
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: settingsAllHidden, version: "1.0.0", initializationResult: mockInitResult }));
|
|
373
|
+
await act(async () => {
|
|
374
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
375
|
+
});
|
|
376
|
+
unmount();
|
|
338
377
|
});
|
|
339
|
-
it('handles settings with memory usage enabled', () => {
|
|
378
|
+
it('handles settings with memory usage enabled', async () => {
|
|
340
379
|
const settingsWithMemory = {
|
|
341
380
|
merged: {
|
|
342
381
|
hideBanner: false,
|
|
@@ -345,36 +384,44 @@ describe('AppContainer State Management', () => {
|
|
|
345
384
|
showMemoryUsage: true,
|
|
346
385
|
},
|
|
347
386
|
};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
387
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: settingsWithMemory, version: "1.0.0", initializationResult: mockInitResult }));
|
|
388
|
+
await act(async () => {
|
|
389
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
390
|
+
});
|
|
391
|
+
unmount();
|
|
351
392
|
});
|
|
352
393
|
});
|
|
353
394
|
describe('Version Handling', () => {
|
|
354
|
-
it.each(['1.0.0', '2.1.3-beta', '3.0.0-nightly'])('handles version format: %s', (version) => {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
395
|
+
it.each(['1.0.0', '2.1.3-beta', '3.0.0-nightly'])('handles version format: %s', async (version) => {
|
|
396
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: version, initializationResult: mockInitResult }));
|
|
397
|
+
await act(async () => {
|
|
398
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
399
|
+
});
|
|
400
|
+
unmount();
|
|
358
401
|
});
|
|
359
402
|
});
|
|
360
403
|
describe('Error Handling', () => {
|
|
361
|
-
it('handles config methods that might throw', () => {
|
|
404
|
+
it('handles config methods that might throw', async () => {
|
|
362
405
|
const errorConfig = makeFakeConfig();
|
|
363
406
|
vi.spyOn(errorConfig, 'getModel').mockImplementation(() => {
|
|
364
407
|
throw new Error('Config error');
|
|
365
408
|
});
|
|
366
409
|
// Should still render without crashing - errors should be handled internally
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
410
|
+
const { unmount } = render(_jsx(AppContainer, { config: errorConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
411
|
+
await act(async () => {
|
|
412
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
413
|
+
});
|
|
414
|
+
unmount();
|
|
370
415
|
});
|
|
371
|
-
it('handles undefined settings gracefully', () => {
|
|
416
|
+
it('handles undefined settings gracefully', async () => {
|
|
372
417
|
const undefinedSettings = {
|
|
373
418
|
merged: {},
|
|
374
419
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
420
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: undefinedSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
421
|
+
await act(async () => {
|
|
422
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
423
|
+
});
|
|
424
|
+
unmount();
|
|
378
425
|
});
|
|
379
426
|
});
|
|
380
427
|
describe('Provider Hierarchy', () => {
|
|
@@ -386,13 +433,17 @@ describe('AppContainer State Management', () => {
|
|
|
386
433
|
});
|
|
387
434
|
});
|
|
388
435
|
describe('Quota and Fallback Integration', () => {
|
|
389
|
-
it('passes a null proQuotaRequest to UIStateContext by default', () => {
|
|
436
|
+
it('passes a null proQuotaRequest to UIStateContext by default', async () => {
|
|
390
437
|
// The default mock from beforeEach already sets proQuotaRequest to null
|
|
391
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
438
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
439
|
+
await act(async () => {
|
|
440
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
441
|
+
});
|
|
392
442
|
// Assert that the context value is as expected
|
|
393
443
|
expect(capturedUIState.proQuotaRequest).toBeNull();
|
|
444
|
+
unmount();
|
|
394
445
|
});
|
|
395
|
-
it('passes a valid proQuotaRequest to UIStateContext when provided by the hook', () => {
|
|
446
|
+
it('passes a valid proQuotaRequest to UIStateContext when provided by the hook', async () => {
|
|
396
447
|
// Arrange: Create a mock request object that a UI dialog would receive
|
|
397
448
|
const mockRequest = {
|
|
398
449
|
failedModel: 'gemini-pro',
|
|
@@ -404,11 +455,15 @@ describe('AppContainer State Management', () => {
|
|
|
404
455
|
handleProQuotaChoice: vi.fn(),
|
|
405
456
|
});
|
|
406
457
|
// Act: Render the container
|
|
407
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
458
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
459
|
+
await act(async () => {
|
|
460
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
461
|
+
});
|
|
408
462
|
// Assert: The mock request is correctly passed through the context
|
|
409
463
|
expect(capturedUIState.proQuotaRequest).toEqual(mockRequest);
|
|
464
|
+
unmount();
|
|
410
465
|
});
|
|
411
|
-
it('passes the handleProQuotaChoice function to UIActionsContext', () => {
|
|
466
|
+
it('passes the handleProQuotaChoice function to UIActionsContext', async () => {
|
|
412
467
|
// Arrange: Create a mock handler function
|
|
413
468
|
const mockHandler = vi.fn();
|
|
414
469
|
mockedUseQuotaAndFallback.mockReturnValue({
|
|
@@ -416,12 +471,18 @@ describe('AppContainer State Management', () => {
|
|
|
416
471
|
handleProQuotaChoice: mockHandler,
|
|
417
472
|
});
|
|
418
473
|
// Act: Render the container
|
|
419
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
474
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
475
|
+
await act(async () => {
|
|
476
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
477
|
+
});
|
|
420
478
|
// Assert: The action in the context is the mock handler we provided
|
|
421
479
|
expect(capturedUIActions.handleProQuotaChoice).toBe(mockHandler);
|
|
422
480
|
// You can even verify that the plumbed function is callable
|
|
423
|
-
|
|
481
|
+
act(() => {
|
|
482
|
+
capturedUIActions.handleProQuotaChoice('auth');
|
|
483
|
+
});
|
|
424
484
|
expect(mockHandler).toHaveBeenCalledWith('auth');
|
|
485
|
+
unmount();
|
|
425
486
|
});
|
|
426
487
|
});
|
|
427
488
|
describe('Terminal Title Update Feature', () => {
|
|
@@ -662,10 +723,67 @@ describe('AppContainer State Management', () => {
|
|
|
662
723
|
unmount();
|
|
663
724
|
});
|
|
664
725
|
});
|
|
726
|
+
describe('Queue Error Message', () => {
|
|
727
|
+
beforeEach(() => {
|
|
728
|
+
vi.useFakeTimers();
|
|
729
|
+
});
|
|
730
|
+
afterEach(() => {
|
|
731
|
+
vi.useRealTimers();
|
|
732
|
+
});
|
|
733
|
+
it('should set and clear the queue error message after a timeout', async () => {
|
|
734
|
+
const { rerender, unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
735
|
+
await act(async () => {
|
|
736
|
+
vi.advanceTimersByTime(0);
|
|
737
|
+
});
|
|
738
|
+
expect(capturedUIState.queueErrorMessage).toBeNull();
|
|
739
|
+
act(() => {
|
|
740
|
+
capturedUIActions.setQueueErrorMessage('Test error');
|
|
741
|
+
});
|
|
742
|
+
rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
743
|
+
expect(capturedUIState.queueErrorMessage).toBe('Test error');
|
|
744
|
+
act(() => {
|
|
745
|
+
vi.advanceTimersByTime(3000);
|
|
746
|
+
});
|
|
747
|
+
rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
748
|
+
expect(capturedUIState.queueErrorMessage).toBeNull();
|
|
749
|
+
unmount();
|
|
750
|
+
});
|
|
751
|
+
it('should reset the timer if a new error message is set', async () => {
|
|
752
|
+
const { rerender, unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
753
|
+
await act(async () => {
|
|
754
|
+
vi.advanceTimersByTime(0);
|
|
755
|
+
});
|
|
756
|
+
act(() => {
|
|
757
|
+
capturedUIActions.setQueueErrorMessage('First error');
|
|
758
|
+
});
|
|
759
|
+
rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
760
|
+
expect(capturedUIState.queueErrorMessage).toBe('First error');
|
|
761
|
+
act(() => {
|
|
762
|
+
vi.advanceTimersByTime(1500);
|
|
763
|
+
});
|
|
764
|
+
act(() => {
|
|
765
|
+
capturedUIActions.setQueueErrorMessage('Second error');
|
|
766
|
+
});
|
|
767
|
+
rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
768
|
+
expect(capturedUIState.queueErrorMessage).toBe('Second error');
|
|
769
|
+
act(() => {
|
|
770
|
+
vi.advanceTimersByTime(2000);
|
|
771
|
+
});
|
|
772
|
+
rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
773
|
+
expect(capturedUIState.queueErrorMessage).toBe('Second error');
|
|
774
|
+
// 5. Advance time past the 3 second timeout from the second message
|
|
775
|
+
act(() => {
|
|
776
|
+
vi.advanceTimersByTime(1000);
|
|
777
|
+
});
|
|
778
|
+
rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
779
|
+
expect(capturedUIState.queueErrorMessage).toBeNull();
|
|
780
|
+
unmount();
|
|
781
|
+
});
|
|
782
|
+
});
|
|
665
783
|
describe('Terminal Height Calculation', () => {
|
|
666
784
|
const mockedMeasureElement = measureElement;
|
|
667
785
|
const mockedUseTerminalSize = useTerminalSize;
|
|
668
|
-
it('should prevent terminal height from being less than 1', () => {
|
|
786
|
+
it('should prevent terminal height from being less than 1', async () => {
|
|
669
787
|
const resizePtySpy = vi.spyOn(ShellExecutionService, 'resizePty');
|
|
670
788
|
// Arrange: Simulate a small terminal and a large footer
|
|
671
789
|
mockedUseTerminalSize.mockReturnValue({ columns: 80, rows: 5 });
|
|
@@ -679,61 +797,55 @@ describe('AppContainer State Management', () => {
|
|
|
679
797
|
cancelOngoingRequest: vi.fn(),
|
|
680
798
|
activePtyId: 'some-id',
|
|
681
799
|
});
|
|
682
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
800
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
801
|
+
await act(async () => {
|
|
802
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
803
|
+
});
|
|
683
804
|
// Assert: The shell should be resized to a minimum height of 1, not a negative number.
|
|
684
805
|
// The old code would have tried to set a negative height.
|
|
685
806
|
expect(resizePtySpy).toHaveBeenCalled();
|
|
686
807
|
const lastCall = resizePtySpy.mock.calls[resizePtySpy.mock.calls.length - 1];
|
|
687
808
|
// Check the height argument specifically
|
|
688
809
|
expect(lastCall[2]).toBe(1);
|
|
810
|
+
unmount();
|
|
689
811
|
});
|
|
690
812
|
});
|
|
691
|
-
describe('Keyboard Input Handling', () => {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
slashCommands: [],
|
|
703
|
-
pendingHistoryItems: [],
|
|
704
|
-
commandContext: {},
|
|
705
|
-
shellConfirmationRequest: null,
|
|
706
|
-
confirmationRequest: null,
|
|
707
|
-
});
|
|
708
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
709
|
-
expect(mockHandleSlashCommand).not.toHaveBeenCalledWith('/quit');
|
|
710
|
-
});
|
|
711
|
-
it('should prevent exit command when text buffer has content', () => {
|
|
712
|
-
mockedUseTextBuffer.mockReturnValue({
|
|
713
|
-
text: 'some user input',
|
|
714
|
-
setText: vi.fn(),
|
|
715
|
-
});
|
|
716
|
-
const mockHandleSlashCommand = vi.fn();
|
|
717
|
-
mockedUseSlashCommandProcessor.mockReturnValue({
|
|
718
|
-
handleSlashCommand: mockHandleSlashCommand,
|
|
719
|
-
slashCommands: [],
|
|
720
|
-
pendingHistoryItems: [],
|
|
721
|
-
commandContext: {},
|
|
722
|
-
shellConfirmationRequest: null,
|
|
723
|
-
confirmationRequest: null,
|
|
813
|
+
describe('Keyboard Input Handling (CTRL+C / CTRL+D)', () => {
|
|
814
|
+
let handleGlobalKeypress;
|
|
815
|
+
let mockHandleSlashCommand;
|
|
816
|
+
let mockCancelOngoingRequest;
|
|
817
|
+
let rerender;
|
|
818
|
+
let unmount;
|
|
819
|
+
// Helper function to reduce boilerplate in tests
|
|
820
|
+
const setupKeypressTest = async () => {
|
|
821
|
+
const renderResult = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
822
|
+
await act(async () => {
|
|
823
|
+
vi.advanceTimersByTime(0);
|
|
724
824
|
});
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
825
|
+
rerender = () => renderResult.rerender(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
826
|
+
unmount = renderResult.unmount;
|
|
827
|
+
};
|
|
828
|
+
const pressKey = (key, times = 1) => {
|
|
829
|
+
for (let i = 0; i < times; i++) {
|
|
830
|
+
act(() => {
|
|
831
|
+
handleGlobalKeypress({
|
|
832
|
+
name: 'c',
|
|
833
|
+
ctrl: false,
|
|
834
|
+
meta: false,
|
|
835
|
+
shift: false,
|
|
836
|
+
...key,
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
rerender();
|
|
840
|
+
}
|
|
841
|
+
};
|
|
842
|
+
beforeEach(() => {
|
|
843
|
+
// Capture the keypress handler from the AppContainer
|
|
844
|
+
mockedUseKeypress.mockImplementation((callback) => {
|
|
845
|
+
handleGlobalKeypress = callback;
|
|
735
846
|
});
|
|
736
|
-
|
|
847
|
+
// Mock slash command handler
|
|
848
|
+
mockHandleSlashCommand = vi.fn();
|
|
737
849
|
mockedUseSlashCommandProcessor.mockReturnValue({
|
|
738
850
|
handleSlashCommand: mockHandleSlashCommand,
|
|
739
851
|
slashCommands: [],
|
|
@@ -742,72 +854,344 @@ describe('AppContainer State Management', () => {
|
|
|
742
854
|
shellConfirmationRequest: null,
|
|
743
855
|
confirmationRequest: null,
|
|
744
856
|
});
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
expect(mockHandleSlashCommand).not.toHaveBeenCalledWith('/quit');
|
|
748
|
-
vi.useRealTimers();
|
|
749
|
-
});
|
|
750
|
-
it('should cancel ongoing request on first Ctrl+C', () => {
|
|
751
|
-
const mockCancelOngoingRequest = vi.fn();
|
|
857
|
+
// Mock request cancellation
|
|
858
|
+
mockCancelOngoingRequest = vi.fn();
|
|
752
859
|
mockedUseGeminiStream.mockReturnValue({
|
|
753
|
-
streamingState: '
|
|
860
|
+
streamingState: 'idle',
|
|
754
861
|
submitQuery: vi.fn(),
|
|
755
862
|
initError: null,
|
|
756
863
|
pendingHistoryItems: [],
|
|
757
864
|
thought: null,
|
|
758
865
|
cancelOngoingRequest: mockCancelOngoingRequest,
|
|
759
866
|
});
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
pendingHistoryItems: [],
|
|
765
|
-
commandContext: {},
|
|
766
|
-
shellConfirmationRequest: null,
|
|
767
|
-
confirmationRequest: null,
|
|
867
|
+
// Default empty text buffer
|
|
868
|
+
mockedUseTextBuffer.mockReturnValue({
|
|
869
|
+
text: '',
|
|
870
|
+
setText: vi.fn(),
|
|
768
871
|
});
|
|
769
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
770
|
-
expect(mockHandleSlashCommand).not.toHaveBeenCalledWith('/quit');
|
|
771
|
-
});
|
|
772
|
-
it('should reset Ctrl+C state after timeout', () => {
|
|
773
872
|
vi.useFakeTimers();
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
873
|
+
});
|
|
874
|
+
afterEach(() => {
|
|
875
|
+
vi.useRealTimers();
|
|
876
|
+
});
|
|
877
|
+
describe('CTRL+C', () => {
|
|
878
|
+
it('should cancel ongoing request on first press', async () => {
|
|
879
|
+
mockedUseGeminiStream.mockReturnValue({
|
|
880
|
+
streamingState: 'responding',
|
|
881
|
+
submitQuery: vi.fn(),
|
|
882
|
+
initError: null,
|
|
883
|
+
pendingHistoryItems: [],
|
|
884
|
+
thought: null,
|
|
885
|
+
cancelOngoingRequest: mockCancelOngoingRequest,
|
|
886
|
+
});
|
|
887
|
+
await setupKeypressTest();
|
|
888
|
+
pressKey({ name: 'c', ctrl: true });
|
|
889
|
+
expect(mockCancelOngoingRequest).toHaveBeenCalledTimes(1);
|
|
890
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
891
|
+
unmount();
|
|
892
|
+
});
|
|
893
|
+
it('should quit on second press', async () => {
|
|
894
|
+
await setupKeypressTest();
|
|
895
|
+
pressKey({ name: 'c', ctrl: true }, 2);
|
|
896
|
+
expect(mockCancelOngoingRequest).toHaveBeenCalledTimes(2);
|
|
897
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/quit');
|
|
898
|
+
unmount();
|
|
899
|
+
});
|
|
900
|
+
it('should reset press count after a timeout', async () => {
|
|
901
|
+
await setupKeypressTest();
|
|
902
|
+
pressKey({ name: 'c', ctrl: true });
|
|
903
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
904
|
+
// Advance timer past the reset threshold
|
|
905
|
+
act(() => {
|
|
906
|
+
vi.advanceTimersByTime(1001);
|
|
907
|
+
});
|
|
908
|
+
pressKey({ name: 'c', ctrl: true });
|
|
909
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
910
|
+
unmount();
|
|
911
|
+
});
|
|
912
|
+
});
|
|
913
|
+
describe('CTRL+D', () => {
|
|
914
|
+
it('should do nothing if text buffer is not empty', async () => {
|
|
915
|
+
mockedUseTextBuffer.mockReturnValue({
|
|
916
|
+
text: 'some text',
|
|
917
|
+
setText: vi.fn(),
|
|
918
|
+
});
|
|
919
|
+
await setupKeypressTest();
|
|
920
|
+
pressKey({ name: 'd', ctrl: true }, 2);
|
|
921
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
922
|
+
unmount();
|
|
923
|
+
});
|
|
924
|
+
it('should quit on second press if buffer is empty', async () => {
|
|
925
|
+
await setupKeypressTest();
|
|
926
|
+
pressKey({ name: 'd', ctrl: true }, 2);
|
|
927
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/quit');
|
|
928
|
+
unmount();
|
|
929
|
+
});
|
|
930
|
+
it('should reset press count after a timeout', async () => {
|
|
931
|
+
await setupKeypressTest();
|
|
932
|
+
pressKey({ name: 'd', ctrl: true });
|
|
933
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
934
|
+
// Advance timer past the reset threshold
|
|
935
|
+
act(() => {
|
|
936
|
+
vi.advanceTimersByTime(1001);
|
|
937
|
+
});
|
|
938
|
+
pressKey({ name: 'd', ctrl: true });
|
|
939
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
940
|
+
unmount();
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
});
|
|
944
|
+
describe('Copy Mode (CTRL+S)', () => {
|
|
945
|
+
let handleGlobalKeypress;
|
|
946
|
+
let rerender;
|
|
947
|
+
let unmount;
|
|
948
|
+
const setupCopyModeTest = async (isAlternateMode = false) => {
|
|
949
|
+
// Update settings for this test run
|
|
950
|
+
const testSettings = {
|
|
951
|
+
...mockSettings,
|
|
952
|
+
merged: {
|
|
953
|
+
...mockSettings.merged,
|
|
954
|
+
ui: {
|
|
955
|
+
...mockSettings.merged.ui,
|
|
956
|
+
useAlternateBuffer: isAlternateMode,
|
|
957
|
+
},
|
|
958
|
+
},
|
|
959
|
+
};
|
|
960
|
+
const renderResult = render(_jsx(AppContainer, { config: mockConfig, settings: testSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
961
|
+
await act(async () => {
|
|
962
|
+
vi.advanceTimersByTime(0);
|
|
782
963
|
});
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
964
|
+
rerender = () => renderResult.rerender(_jsx(AppContainer, { config: mockConfig, settings: testSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
965
|
+
unmount = renderResult.unmount;
|
|
966
|
+
};
|
|
967
|
+
beforeEach(() => {
|
|
968
|
+
mockStdout.write.mockClear();
|
|
969
|
+
mockedUseKeypress.mockImplementation((callback) => {
|
|
970
|
+
handleGlobalKeypress = callback;
|
|
971
|
+
});
|
|
972
|
+
vi.useFakeTimers();
|
|
973
|
+
});
|
|
974
|
+
afterEach(() => {
|
|
787
975
|
vi.useRealTimers();
|
|
788
976
|
});
|
|
977
|
+
describe.each([
|
|
978
|
+
{
|
|
979
|
+
isAlternateMode: false,
|
|
980
|
+
shouldEnable: false,
|
|
981
|
+
modeName: 'Normal Mode',
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
isAlternateMode: true,
|
|
985
|
+
shouldEnable: true,
|
|
986
|
+
modeName: 'Alternate Buffer Mode',
|
|
987
|
+
},
|
|
988
|
+
])('$modeName', ({ isAlternateMode, shouldEnable }) => {
|
|
989
|
+
it(`should ${shouldEnable ? 'toggle' : 'NOT toggle'} mouse off when Ctrl+S is pressed`, async () => {
|
|
990
|
+
await setupCopyModeTest(isAlternateMode);
|
|
991
|
+
mockStdout.write.mockClear(); // Clear initial enable call
|
|
992
|
+
act(() => {
|
|
993
|
+
handleGlobalKeypress({
|
|
994
|
+
name: 's',
|
|
995
|
+
ctrl: true,
|
|
996
|
+
meta: false,
|
|
997
|
+
shift: false,
|
|
998
|
+
paste: false,
|
|
999
|
+
sequence: '\x13',
|
|
1000
|
+
});
|
|
1001
|
+
});
|
|
1002
|
+
rerender();
|
|
1003
|
+
if (shouldEnable) {
|
|
1004
|
+
expect(disableMouseEvents).toHaveBeenCalled();
|
|
1005
|
+
}
|
|
1006
|
+
else {
|
|
1007
|
+
expect(disableMouseEvents).not.toHaveBeenCalled();
|
|
1008
|
+
}
|
|
1009
|
+
unmount();
|
|
1010
|
+
});
|
|
1011
|
+
if (shouldEnable) {
|
|
1012
|
+
it('should toggle mouse back on when Ctrl+S is pressed again', async () => {
|
|
1013
|
+
await setupCopyModeTest(isAlternateMode);
|
|
1014
|
+
mockStdout.write.mockClear();
|
|
1015
|
+
// Turn it on (disable mouse)
|
|
1016
|
+
act(() => {
|
|
1017
|
+
handleGlobalKeypress({
|
|
1018
|
+
name: 's',
|
|
1019
|
+
ctrl: true,
|
|
1020
|
+
meta: false,
|
|
1021
|
+
shift: false,
|
|
1022
|
+
paste: false,
|
|
1023
|
+
sequence: '\x13',
|
|
1024
|
+
});
|
|
1025
|
+
});
|
|
1026
|
+
rerender();
|
|
1027
|
+
expect(disableMouseEvents).toHaveBeenCalled();
|
|
1028
|
+
// Turn it off (enable mouse)
|
|
1029
|
+
act(() => {
|
|
1030
|
+
handleGlobalKeypress({
|
|
1031
|
+
name: 'any', // Any key should exit copy mode
|
|
1032
|
+
ctrl: false,
|
|
1033
|
+
meta: false,
|
|
1034
|
+
shift: false,
|
|
1035
|
+
paste: false,
|
|
1036
|
+
sequence: 'a',
|
|
1037
|
+
});
|
|
1038
|
+
});
|
|
1039
|
+
rerender();
|
|
1040
|
+
expect(enableMouseEvents).toHaveBeenCalled();
|
|
1041
|
+
unmount();
|
|
1042
|
+
});
|
|
1043
|
+
it('should exit copy mode on any key press', async () => {
|
|
1044
|
+
await setupCopyModeTest(isAlternateMode);
|
|
1045
|
+
// Enter copy mode
|
|
1046
|
+
act(() => {
|
|
1047
|
+
handleGlobalKeypress({
|
|
1048
|
+
name: 's',
|
|
1049
|
+
ctrl: true,
|
|
1050
|
+
meta: false,
|
|
1051
|
+
shift: false,
|
|
1052
|
+
paste: false,
|
|
1053
|
+
sequence: '\x13',
|
|
1054
|
+
});
|
|
1055
|
+
});
|
|
1056
|
+
rerender();
|
|
1057
|
+
mockStdout.write.mockClear();
|
|
1058
|
+
// Press any other key
|
|
1059
|
+
act(() => {
|
|
1060
|
+
handleGlobalKeypress({
|
|
1061
|
+
name: 'a',
|
|
1062
|
+
ctrl: false,
|
|
1063
|
+
meta: false,
|
|
1064
|
+
shift: false,
|
|
1065
|
+
paste: false,
|
|
1066
|
+
sequence: 'a',
|
|
1067
|
+
});
|
|
1068
|
+
});
|
|
1069
|
+
rerender();
|
|
1070
|
+
// Should have re-enabled mouse
|
|
1071
|
+
expect(enableMouseEvents).toHaveBeenCalled();
|
|
1072
|
+
unmount();
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
});
|
|
789
1076
|
});
|
|
790
1077
|
describe('Model Dialog Integration', () => {
|
|
791
|
-
it('should provide isModelDialogOpen in the UIStateContext', () => {
|
|
1078
|
+
it('should provide isModelDialogOpen in the UIStateContext', async () => {
|
|
792
1079
|
mockedUseModelCommand.mockReturnValue({
|
|
793
1080
|
isModelDialogOpen: true,
|
|
794
1081
|
openModelDialog: vi.fn(),
|
|
795
1082
|
closeModelDialog: vi.fn(),
|
|
796
1083
|
});
|
|
797
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1084
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1085
|
+
await act(async () => {
|
|
1086
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1087
|
+
});
|
|
798
1088
|
expect(capturedUIState.isModelDialogOpen).toBe(true);
|
|
1089
|
+
unmount();
|
|
799
1090
|
});
|
|
800
|
-
it('should provide model dialog actions in the UIActionsContext', () => {
|
|
1091
|
+
it('should provide model dialog actions in the UIActionsContext', async () => {
|
|
801
1092
|
const mockCloseModelDialog = vi.fn();
|
|
802
1093
|
mockedUseModelCommand.mockReturnValue({
|
|
803
1094
|
isModelDialogOpen: false,
|
|
804
1095
|
openModelDialog: vi.fn(),
|
|
805
1096
|
closeModelDialog: mockCloseModelDialog,
|
|
806
1097
|
});
|
|
807
|
-
render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1098
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1099
|
+
await act(async () => {
|
|
1100
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1101
|
+
});
|
|
808
1102
|
// Verify that the actions are correctly passed through context
|
|
809
|
-
|
|
1103
|
+
act(() => {
|
|
1104
|
+
capturedUIActions.closeModelDialog();
|
|
1105
|
+
});
|
|
810
1106
|
expect(mockCloseModelDialog).toHaveBeenCalled();
|
|
1107
|
+
unmount();
|
|
1108
|
+
});
|
|
1109
|
+
});
|
|
1110
|
+
describe('CoreEvents Integration', () => {
|
|
1111
|
+
it('subscribes to UserFeedback and drains backlog on mount', async () => {
|
|
1112
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1113
|
+
await act(async () => {
|
|
1114
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1115
|
+
});
|
|
1116
|
+
expect(mockCoreEvents.on).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
|
|
1117
|
+
expect(mockCoreEvents.drainFeedbackBacklog).toHaveBeenCalledTimes(1);
|
|
1118
|
+
unmount();
|
|
1119
|
+
});
|
|
1120
|
+
it('unsubscribes from UserFeedback on unmount', async () => {
|
|
1121
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1122
|
+
await act(async () => {
|
|
1123
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1124
|
+
});
|
|
1125
|
+
unmount();
|
|
1126
|
+
expect(mockCoreEvents.off).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
|
|
1127
|
+
});
|
|
1128
|
+
it('adds history item when UserFeedback event is received', async () => {
|
|
1129
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1130
|
+
await act(async () => {
|
|
1131
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1132
|
+
});
|
|
1133
|
+
// Get the registered handler
|
|
1134
|
+
const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.UserFeedback)?.[1];
|
|
1135
|
+
expect(handler).toBeDefined();
|
|
1136
|
+
// Simulate an event
|
|
1137
|
+
const payload = {
|
|
1138
|
+
severity: 'error',
|
|
1139
|
+
message: 'Test error message',
|
|
1140
|
+
};
|
|
1141
|
+
act(() => {
|
|
1142
|
+
handler(payload);
|
|
1143
|
+
});
|
|
1144
|
+
expect(mockedUseHistory().addItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
1145
|
+
type: 'error',
|
|
1146
|
+
text: 'Test error message',
|
|
1147
|
+
}), expect.any(Number));
|
|
1148
|
+
unmount();
|
|
1149
|
+
});
|
|
1150
|
+
it('updates currentModel when ModelChanged event is received', async () => {
|
|
1151
|
+
// Arrange: Mock initial model
|
|
1152
|
+
vi.spyOn(mockConfig, 'getModel').mockReturnValue('initial-model');
|
|
1153
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1154
|
+
// Verify initial model
|
|
1155
|
+
await act(async () => {
|
|
1156
|
+
await vi.waitFor(() => {
|
|
1157
|
+
expect(capturedUIState?.currentModel).toBe('initial-model');
|
|
1158
|
+
});
|
|
1159
|
+
});
|
|
1160
|
+
// Get the registered handler for ModelChanged
|
|
1161
|
+
const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.ModelChanged)?.[1];
|
|
1162
|
+
expect(handler).toBeDefined();
|
|
1163
|
+
// Act: Simulate ModelChanged event
|
|
1164
|
+
act(() => {
|
|
1165
|
+
handler({ model: 'new-model' });
|
|
1166
|
+
});
|
|
1167
|
+
// Assert: Verify model is updated
|
|
1168
|
+
expect(capturedUIState.currentModel).toBe('new-model');
|
|
1169
|
+
unmount();
|
|
1170
|
+
});
|
|
1171
|
+
});
|
|
1172
|
+
describe('Shell Interaction', () => {
|
|
1173
|
+
it('should not crash if resizing the pty fails', async () => {
|
|
1174
|
+
const resizePtySpy = vi
|
|
1175
|
+
.spyOn(ShellExecutionService, 'resizePty')
|
|
1176
|
+
.mockImplementation(() => {
|
|
1177
|
+
throw new Error('Cannot resize a pty that has already exited');
|
|
1178
|
+
});
|
|
1179
|
+
mockedUseGeminiStream.mockReturnValue({
|
|
1180
|
+
streamingState: 'idle',
|
|
1181
|
+
submitQuery: vi.fn(),
|
|
1182
|
+
initError: null,
|
|
1183
|
+
pendingHistoryItems: [],
|
|
1184
|
+
thought: null,
|
|
1185
|
+
cancelOngoingRequest: vi.fn(),
|
|
1186
|
+
activePtyId: 'some-pty-id', // Make sure activePtyId is set
|
|
1187
|
+
});
|
|
1188
|
+
// The main assertion is that the render does not throw.
|
|
1189
|
+
const { unmount } = render(_jsx(AppContainer, { config: mockConfig, settings: mockSettings, version: "1.0.0", initializationResult: mockInitResult }));
|
|
1190
|
+
await act(async () => {
|
|
1191
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1192
|
+
});
|
|
1193
|
+
expect(resizePtySpy).toHaveBeenCalled();
|
|
1194
|
+
unmount();
|
|
811
1195
|
});
|
|
812
1196
|
});
|
|
813
1197
|
});
|