@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
|
@@ -20,7 +20,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* - Display values for inherited and overridden settings
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import { render } from '
|
|
23
|
+
import { render } from '../../test-utils/render.js';
|
|
24
|
+
import { waitFor } from '../../test-utils/async.js';
|
|
24
25
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
25
26
|
import { SettingsDialog } from './SettingsDialog.js';
|
|
26
27
|
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
|
@@ -105,147 +106,186 @@ vi.mock('../../utils/settingsUtils.js', async () => {
|
|
|
105
106
|
saveModifiedSettings: vi.fn(),
|
|
106
107
|
};
|
|
107
108
|
});
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
109
|
+
// Shared test schemas
|
|
110
|
+
var StringEnum;
|
|
111
|
+
(function (StringEnum) {
|
|
112
|
+
StringEnum["FOO"] = "foo";
|
|
113
|
+
StringEnum["BAR"] = "bar";
|
|
114
|
+
StringEnum["BAZ"] = "baz";
|
|
115
|
+
})(StringEnum || (StringEnum = {}));
|
|
116
|
+
const ENUM_SETTING = {
|
|
117
|
+
type: 'enum',
|
|
118
|
+
label: 'Theme',
|
|
119
|
+
options: [
|
|
120
|
+
{
|
|
121
|
+
label: 'Foo',
|
|
122
|
+
value: StringEnum.FOO,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: 'Bar',
|
|
126
|
+
value: StringEnum.BAR,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: 'Baz',
|
|
130
|
+
value: StringEnum.BAZ,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
category: 'UI',
|
|
134
|
+
requiresRestart: false,
|
|
135
|
+
default: StringEnum.BAR,
|
|
136
|
+
description: 'The color theme for the UI.',
|
|
137
|
+
showInDialog: true,
|
|
138
|
+
};
|
|
139
|
+
const ENUM_FAKE_SCHEMA = {
|
|
140
|
+
ui: {
|
|
141
|
+
showInDialog: false,
|
|
142
|
+
properties: {
|
|
143
|
+
theme: {
|
|
144
|
+
...ENUM_SETTING,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
const TOOLS_SHELL_FAKE_SCHEMA = {
|
|
150
|
+
tools: {
|
|
151
|
+
type: 'object',
|
|
152
|
+
label: 'Tools',
|
|
153
|
+
category: 'Tools',
|
|
154
|
+
requiresRestart: false,
|
|
155
|
+
default: {},
|
|
156
|
+
description: 'Tool settings.',
|
|
157
|
+
showInDialog: false,
|
|
158
|
+
properties: {
|
|
159
|
+
shell: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
label: 'Shell',
|
|
162
|
+
category: 'Tools',
|
|
163
|
+
requiresRestart: false,
|
|
164
|
+
default: {},
|
|
165
|
+
description: 'Shell tool settings.',
|
|
166
|
+
showInDialog: false,
|
|
167
|
+
properties: {
|
|
168
|
+
showColor: {
|
|
169
|
+
type: 'boolean',
|
|
170
|
+
label: 'Show Color',
|
|
171
|
+
category: 'Tools',
|
|
172
|
+
requiresRestart: false,
|
|
173
|
+
default: false,
|
|
174
|
+
description: 'Show color in shell output.',
|
|
175
|
+
showInDialog: true,
|
|
176
|
+
},
|
|
177
|
+
enableInteractiveShell: {
|
|
178
|
+
type: 'boolean',
|
|
179
|
+
label: 'Enable Interactive Shell',
|
|
180
|
+
category: 'Tools',
|
|
181
|
+
requiresRestart: true,
|
|
182
|
+
default: true,
|
|
183
|
+
description: 'Enable interactive shell mode.',
|
|
184
|
+
showInDialog: true,
|
|
185
|
+
},
|
|
186
|
+
pager: {
|
|
187
|
+
type: 'string',
|
|
188
|
+
label: 'Pager',
|
|
189
|
+
category: 'Tools',
|
|
190
|
+
requiresRestart: false,
|
|
191
|
+
default: 'cat',
|
|
192
|
+
description: 'The pager command to use for shell output.',
|
|
193
|
+
showInDialog: true,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
// Helper function to render SettingsDialog with standard wrapper
|
|
201
|
+
const renderDialog = (settings, onSelect, options) => render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect, onRestartRequest: options?.onRestartRequest, availableTerminalHeight: options?.availableTerminalHeight }) }));
|
|
127
202
|
describe('SettingsDialog', () => {
|
|
128
|
-
// Simple delay function for remaining tests that need gradual migration
|
|
129
|
-
const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
130
|
-
// Custom waitFor utility for ink testing environment (not compatible with @testing-library/react)
|
|
131
|
-
const waitFor = async (predicate, options = {}) => {
|
|
132
|
-
const { timeout = 1000, interval = 10 } = options;
|
|
133
|
-
const start = Date.now();
|
|
134
|
-
let lastError;
|
|
135
|
-
while (Date.now() - start < timeout) {
|
|
136
|
-
try {
|
|
137
|
-
predicate();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
catch (e) {
|
|
141
|
-
lastError = e;
|
|
142
|
-
}
|
|
143
|
-
await new Promise((resolve) => setTimeout(resolve, interval));
|
|
144
|
-
}
|
|
145
|
-
if (lastError) {
|
|
146
|
-
throw lastError;
|
|
147
|
-
}
|
|
148
|
-
throw new Error('waitFor timed out');
|
|
149
|
-
};
|
|
150
203
|
beforeEach(() => {
|
|
151
|
-
// Reset keypress mock state (variables are commented out)
|
|
152
|
-
// currentKeypressHandler = null;
|
|
153
|
-
// isKeypressActive = false;
|
|
154
|
-
// console.log = vi.fn();
|
|
155
|
-
// console.error = vi.fn();
|
|
156
204
|
mockToggleVimEnabled.mockResolvedValue(true);
|
|
157
205
|
});
|
|
158
206
|
afterEach(() => {
|
|
159
207
|
TEST_ONLY.clearFlattenedSchema();
|
|
160
208
|
vi.clearAllMocks();
|
|
161
209
|
vi.resetAllMocks();
|
|
162
|
-
// Reset keypress mock state (variables are commented out)
|
|
163
|
-
// currentKeypressHandler = null;
|
|
164
|
-
// isKeypressActive = false;
|
|
165
|
-
// console.log = originalConsoleLog;
|
|
166
|
-
// console.error = originalConsoleError;
|
|
167
210
|
});
|
|
168
211
|
describe('Initial Rendering', () => {
|
|
169
212
|
it('should render the settings dialog with default state', () => {
|
|
170
213
|
const settings = createMockSettings();
|
|
171
214
|
const onSelect = vi.fn();
|
|
172
|
-
const { lastFrame } =
|
|
215
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
173
216
|
const output = lastFrame();
|
|
174
217
|
expect(output).toContain('Settings');
|
|
175
218
|
expect(output).toContain('Apply To');
|
|
176
|
-
|
|
219
|
+
// Use regex for more flexible help text matching
|
|
220
|
+
expect(output).toMatch(/Enter.*select.*Esc.*close/);
|
|
177
221
|
});
|
|
178
222
|
it('should accept availableTerminalHeight prop without errors', () => {
|
|
179
223
|
const settings = createMockSettings();
|
|
180
224
|
const onSelect = vi.fn();
|
|
181
|
-
const { lastFrame } =
|
|
225
|
+
const { lastFrame } = renderDialog(settings, onSelect, {
|
|
226
|
+
availableTerminalHeight: 20,
|
|
227
|
+
});
|
|
182
228
|
const output = lastFrame();
|
|
183
229
|
// Should still render properly with the height prop
|
|
184
230
|
expect(output).toContain('Settings');
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
it('should show settings list with default values', () => {
|
|
188
|
-
const settings = createMockSettings();
|
|
189
|
-
const onSelect = vi.fn();
|
|
190
|
-
const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
191
|
-
const output = lastFrame();
|
|
192
|
-
// Should show some default settings
|
|
193
|
-
expect(output).toContain('●'); // Active indicator
|
|
231
|
+
// Use regex for more flexible help text matching
|
|
232
|
+
expect(output).toMatch(/Enter.*select.*Esc.*close/);
|
|
194
233
|
});
|
|
195
|
-
it('should
|
|
234
|
+
it('should render settings list with visual indicators', () => {
|
|
196
235
|
const settings = createMockSettings();
|
|
197
236
|
const onSelect = vi.fn();
|
|
198
|
-
const { lastFrame } =
|
|
237
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
199
238
|
const output = lastFrame();
|
|
200
|
-
//
|
|
201
|
-
expect(output).
|
|
239
|
+
// Use snapshot to capture visual layout including indicators
|
|
240
|
+
expect(output).toMatchSnapshot();
|
|
202
241
|
});
|
|
203
242
|
});
|
|
204
243
|
describe('Settings Navigation', () => {
|
|
205
|
-
it(
|
|
244
|
+
it.each([
|
|
245
|
+
{
|
|
246
|
+
name: 'arrow keys',
|
|
247
|
+
down: TerminalKeys.DOWN_ARROW,
|
|
248
|
+
up: TerminalKeys.UP_ARROW,
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: 'vim keys (j/k)',
|
|
252
|
+
down: 'j',
|
|
253
|
+
up: 'k',
|
|
254
|
+
},
|
|
255
|
+
])('should navigate with $name', async ({ down, up }) => {
|
|
206
256
|
const settings = createMockSettings();
|
|
207
257
|
const onSelect = vi.fn();
|
|
208
|
-
const { stdin, unmount, lastFrame } =
|
|
209
|
-
|
|
258
|
+
const { stdin, unmount, lastFrame } = renderDialog(settings, onSelect);
|
|
259
|
+
const initialFrame = lastFrame();
|
|
260
|
+
expect(initialFrame).toContain('Vim Mode');
|
|
261
|
+
// Navigate down
|
|
210
262
|
act(() => {
|
|
211
|
-
stdin.write(
|
|
263
|
+
stdin.write(down);
|
|
264
|
+
});
|
|
265
|
+
await waitFor(() => {
|
|
266
|
+
expect(lastFrame()).toContain('Disable Auto Update');
|
|
267
|
+
});
|
|
268
|
+
// Navigate up
|
|
269
|
+
act(() => {
|
|
270
|
+
stdin.write(up);
|
|
271
|
+
});
|
|
272
|
+
await waitFor(() => {
|
|
273
|
+
expect(lastFrame()).toContain('Vim Mode');
|
|
212
274
|
});
|
|
213
|
-
expect(lastFrame()).toContain('● Disable Auto Update');
|
|
214
|
-
// The active index should have changed (tested indirectly through behavior)
|
|
215
|
-
unmount();
|
|
216
|
-
});
|
|
217
|
-
it('should navigate up with arrow key', async () => {
|
|
218
|
-
const settings = createMockSettings();
|
|
219
|
-
const onSelect = vi.fn();
|
|
220
|
-
const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
221
|
-
// First go down, then up
|
|
222
|
-
stdin.write(TerminalKeys.DOWN_ARROW); // Down arrow
|
|
223
|
-
await wait();
|
|
224
|
-
stdin.write(TerminalKeys.UP_ARROW);
|
|
225
|
-
await wait();
|
|
226
|
-
unmount();
|
|
227
|
-
});
|
|
228
|
-
it('should navigate with vim keys (j/k)', async () => {
|
|
229
|
-
const settings = createMockSettings();
|
|
230
|
-
const onSelect = vi.fn();
|
|
231
|
-
const { stdin, unmount } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
232
|
-
// Navigate with vim keys
|
|
233
|
-
stdin.write('j'); // Down
|
|
234
|
-
await wait();
|
|
235
|
-
stdin.write('k'); // Up
|
|
236
|
-
await wait();
|
|
237
275
|
unmount();
|
|
238
276
|
});
|
|
239
277
|
it('wraps around when at the top of the list', async () => {
|
|
240
278
|
const settings = createMockSettings();
|
|
241
279
|
const onSelect = vi.fn();
|
|
242
|
-
const { stdin, unmount, lastFrame } =
|
|
280
|
+
const { stdin, unmount, lastFrame } = renderDialog(settings, onSelect);
|
|
243
281
|
// Try to go up from first item
|
|
244
282
|
act(() => {
|
|
245
283
|
stdin.write(TerminalKeys.UP_ARROW);
|
|
246
284
|
});
|
|
247
|
-
await
|
|
248
|
-
|
|
285
|
+
await waitFor(() => {
|
|
286
|
+
// Should wrap to last setting (without relying on exact bullet character)
|
|
287
|
+
expect(lastFrame()).toContain('Codebase Investigator Max Num Turns');
|
|
288
|
+
});
|
|
249
289
|
unmount();
|
|
250
290
|
});
|
|
251
291
|
});
|
|
@@ -254,18 +294,17 @@ describe('SettingsDialog', () => {
|
|
|
254
294
|
vi.mocked(saveModifiedSettings).mockClear();
|
|
255
295
|
const settings = createMockSettings();
|
|
256
296
|
const onSelect = vi.fn();
|
|
257
|
-
const
|
|
258
|
-
const { stdin, unmount, lastFrame } = render(component);
|
|
297
|
+
const { stdin, unmount, lastFrame } = renderDialog(settings, onSelect);
|
|
259
298
|
// Wait for initial render and verify we're on Vim Mode (first setting)
|
|
260
299
|
await waitFor(() => {
|
|
261
|
-
expect(lastFrame()).toContain('
|
|
300
|
+
expect(lastFrame()).toContain('Vim Mode');
|
|
262
301
|
});
|
|
263
302
|
// Navigate to Disable Auto Update setting and verify we're there
|
|
264
303
|
act(() => {
|
|
265
304
|
stdin.write(TerminalKeys.DOWN_ARROW);
|
|
266
305
|
});
|
|
267
306
|
await waitFor(() => {
|
|
268
|
-
expect(lastFrame()).toContain('
|
|
307
|
+
expect(lastFrame()).toContain('Disable Auto Update');
|
|
269
308
|
});
|
|
270
309
|
// Toggle the setting
|
|
271
310
|
act(() => {
|
|
@@ -279,116 +318,68 @@ describe('SettingsDialog', () => {
|
|
|
279
318
|
await waitFor(() => {
|
|
280
319
|
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalled();
|
|
281
320
|
});
|
|
282
|
-
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['general.disableAutoUpdate']), {
|
|
283
|
-
general: {
|
|
321
|
+
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['general.disableAutoUpdate']), expect.objectContaining({
|
|
322
|
+
general: expect.objectContaining({
|
|
284
323
|
disableAutoUpdate: true,
|
|
285
|
-
},
|
|
286
|
-
}, expect.any(LoadedSettings), SettingScope.User);
|
|
324
|
+
}),
|
|
325
|
+
}), expect.any(LoadedSettings), SettingScope.User);
|
|
287
326
|
unmount();
|
|
288
327
|
});
|
|
289
328
|
describe('enum values', () => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
{
|
|
301
|
-
label: 'Foo',
|
|
302
|
-
value: StringEnum.FOO,
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
label: 'Bar',
|
|
306
|
-
value: StringEnum.BAR,
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
label: 'Baz',
|
|
310
|
-
value: StringEnum.BAZ,
|
|
311
|
-
},
|
|
312
|
-
],
|
|
313
|
-
category: 'UI',
|
|
314
|
-
requiresRestart: false,
|
|
315
|
-
default: StringEnum.BAR,
|
|
316
|
-
description: 'The color theme for the UI.',
|
|
317
|
-
showInDialog: true,
|
|
318
|
-
};
|
|
319
|
-
const FAKE_SCHEMA = {
|
|
320
|
-
ui: {
|
|
321
|
-
showInDialog: false,
|
|
322
|
-
properties: {
|
|
323
|
-
theme: {
|
|
324
|
-
...SETTING,
|
|
325
|
-
},
|
|
326
|
-
},
|
|
329
|
+
it.each([
|
|
330
|
+
{
|
|
331
|
+
name: 'toggles to next value',
|
|
332
|
+
initialValue: undefined,
|
|
333
|
+
expectedValue: StringEnum.BAZ,
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'loops back to first value when at end',
|
|
337
|
+
initialValue: StringEnum.BAZ,
|
|
338
|
+
expectedValue: StringEnum.FOO,
|
|
327
339
|
},
|
|
328
|
-
}
|
|
329
|
-
it('toggles enum values with the enter key', async () => {
|
|
340
|
+
])('$name', async ({ initialValue, expectedValue }) => {
|
|
330
341
|
vi.mocked(saveModifiedSettings).mockClear();
|
|
331
|
-
vi.mocked(getSettingsSchema).mockReturnValue(
|
|
342
|
+
vi.mocked(getSettingsSchema).mockReturnValue(ENUM_FAKE_SCHEMA);
|
|
332
343
|
const settings = createMockSettings();
|
|
344
|
+
if (initialValue !== undefined) {
|
|
345
|
+
settings.setValue(SettingScope.User, 'ui.theme', initialValue);
|
|
346
|
+
}
|
|
333
347
|
const onSelect = vi.fn();
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
await wait();
|
|
339
|
-
stdin.write(TerminalKeys.ENTER);
|
|
340
|
-
await wait();
|
|
341
|
-
await waitFor(() => {
|
|
342
|
-
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalled();
|
|
348
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
349
|
+
act(() => {
|
|
350
|
+
stdin.write(TerminalKeys.DOWN_ARROW);
|
|
351
|
+
stdin.write(TerminalKeys.ENTER);
|
|
343
352
|
});
|
|
344
|
-
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['ui.theme']), {
|
|
345
|
-
ui: {
|
|
346
|
-
theme: StringEnum.BAZ,
|
|
347
|
-
},
|
|
348
|
-
}, expect.any(LoadedSettings), SettingScope.User);
|
|
349
|
-
unmount();
|
|
350
|
-
});
|
|
351
|
-
it('loops back when reaching the end of an enum', async () => {
|
|
352
|
-
vi.mocked(saveModifiedSettings).mockClear();
|
|
353
|
-
vi.mocked(getSettingsSchema).mockReturnValue(FAKE_SCHEMA);
|
|
354
|
-
const settings = createMockSettings();
|
|
355
|
-
settings.setValue(SettingScope.User, 'ui.theme', StringEnum.BAZ);
|
|
356
|
-
const onSelect = vi.fn();
|
|
357
|
-
const component = (_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
358
|
-
const { stdin, unmount } = render(component);
|
|
359
|
-
// Press Enter to toggle current setting
|
|
360
|
-
stdin.write(TerminalKeys.DOWN_ARROW);
|
|
361
|
-
await wait();
|
|
362
|
-
stdin.write(TerminalKeys.ENTER);
|
|
363
|
-
await wait();
|
|
364
353
|
await waitFor(() => {
|
|
365
354
|
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalled();
|
|
366
355
|
});
|
|
367
|
-
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['ui.theme']), {
|
|
368
|
-
ui: {
|
|
369
|
-
theme:
|
|
370
|
-
},
|
|
371
|
-
}, expect.any(LoadedSettings), SettingScope.User);
|
|
356
|
+
expect(vi.mocked(saveModifiedSettings)).toHaveBeenCalledWith(new Set(['ui.theme']), expect.objectContaining({
|
|
357
|
+
ui: expect.objectContaining({
|
|
358
|
+
theme: expectedValue,
|
|
359
|
+
}),
|
|
360
|
+
}), expect.any(LoadedSettings), SettingScope.User);
|
|
372
361
|
unmount();
|
|
373
362
|
});
|
|
374
363
|
});
|
|
375
364
|
it('should toggle setting with Space key', async () => {
|
|
376
365
|
const settings = createMockSettings();
|
|
377
366
|
const onSelect = vi.fn();
|
|
378
|
-
const { stdin, unmount } =
|
|
367
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
379
368
|
// Press Space to toggle current setting
|
|
380
|
-
|
|
381
|
-
|
|
369
|
+
act(() => {
|
|
370
|
+
stdin.write(' '); // Space key
|
|
371
|
+
});
|
|
382
372
|
unmount();
|
|
383
373
|
});
|
|
384
374
|
it('should handle vim mode setting specially', async () => {
|
|
385
375
|
const settings = createMockSettings();
|
|
386
376
|
const onSelect = vi.fn();
|
|
387
|
-
const { stdin, unmount } =
|
|
377
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
388
378
|
// Navigate to vim mode setting and toggle it
|
|
389
379
|
// This would require knowing the exact position, so we'll just test that the mock is called
|
|
390
|
-
|
|
391
|
-
|
|
380
|
+
act(() => {
|
|
381
|
+
stdin.write(TerminalKeys.ENTER); // Enter key
|
|
382
|
+
});
|
|
392
383
|
// The mock should potentially be called if vim mode was toggled
|
|
393
384
|
unmount();
|
|
394
385
|
});
|
|
@@ -397,26 +388,26 @@ describe('SettingsDialog', () => {
|
|
|
397
388
|
it('should switch between scopes', async () => {
|
|
398
389
|
const settings = createMockSettings();
|
|
399
390
|
const onSelect = vi.fn();
|
|
400
|
-
const { stdin, unmount } =
|
|
391
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
401
392
|
// Switch to scope focus
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
393
|
+
act(() => {
|
|
394
|
+
stdin.write(TerminalKeys.TAB); // Tab key
|
|
395
|
+
// Select different scope (numbers 1-3 typically available)
|
|
396
|
+
stdin.write('2'); // Select second scope option
|
|
397
|
+
});
|
|
407
398
|
unmount();
|
|
408
399
|
});
|
|
409
400
|
it('should reset to settings focus when scope is selected', async () => {
|
|
410
401
|
const settings = createMockSettings();
|
|
411
402
|
const onSelect = vi.fn();
|
|
412
|
-
const { lastFrame, unmount } =
|
|
403
|
+
const { lastFrame, unmount } = renderDialog(settings, onSelect);
|
|
413
404
|
// Wait for initial render
|
|
414
405
|
await waitFor(() => {
|
|
415
406
|
expect(lastFrame()).toContain('Vim Mode');
|
|
416
407
|
});
|
|
417
408
|
// The UI should show the settings section is active and scope section is inactive
|
|
418
|
-
expect(lastFrame()).toContain('
|
|
419
|
-
expect(lastFrame()).toContain('
|
|
409
|
+
expect(lastFrame()).toContain('Vim Mode'); // Settings section active
|
|
410
|
+
expect(lastFrame()).toContain('Apply To'); // Scope section (don't rely on exact spacing)
|
|
420
411
|
// This test validates the initial state - scope selection behavior
|
|
421
412
|
// is complex due to keypress handling, so we focus on state validation
|
|
422
413
|
unmount();
|
|
@@ -426,19 +417,23 @@ describe('SettingsDialog', () => {
|
|
|
426
417
|
it('should show restart prompt for restart-required settings', async () => {
|
|
427
418
|
const settings = createMockSettings();
|
|
428
419
|
const onRestartRequest = vi.fn();
|
|
429
|
-
const { unmount } =
|
|
420
|
+
const { unmount } = renderDialog(settings, vi.fn(), {
|
|
421
|
+
onRestartRequest,
|
|
422
|
+
});
|
|
430
423
|
// This test would need to trigger a restart-required setting change
|
|
431
424
|
// The exact steps depend on which settings require restart
|
|
432
|
-
await wait();
|
|
433
425
|
unmount();
|
|
434
426
|
});
|
|
435
427
|
it('should handle restart request when r is pressed', async () => {
|
|
436
428
|
const settings = createMockSettings();
|
|
437
429
|
const onRestartRequest = vi.fn();
|
|
438
|
-
const { stdin, unmount } =
|
|
430
|
+
const { stdin, unmount } = renderDialog(settings, vi.fn(), {
|
|
431
|
+
onRestartRequest,
|
|
432
|
+
});
|
|
439
433
|
// Press 'r' key (this would only work if restart prompt is showing)
|
|
440
|
-
|
|
441
|
-
|
|
434
|
+
act(() => {
|
|
435
|
+
stdin.write('r');
|
|
436
|
+
});
|
|
442
437
|
// If restart prompt was showing, onRestartRequest should be called
|
|
443
438
|
unmount();
|
|
444
439
|
});
|
|
@@ -447,7 +442,7 @@ describe('SettingsDialog', () => {
|
|
|
447
442
|
it('should call onSelect with undefined when Escape is pressed', async () => {
|
|
448
443
|
const settings = createMockSettings();
|
|
449
444
|
const onSelect = vi.fn();
|
|
450
|
-
const { lastFrame, unmount } =
|
|
445
|
+
const { lastFrame, unmount } = renderDialog(settings, onSelect);
|
|
451
446
|
// Wait for initial render
|
|
452
447
|
await waitFor(() => {
|
|
453
448
|
expect(lastFrame()).toContain('Hide Window Title');
|
|
@@ -464,13 +459,12 @@ describe('SettingsDialog', () => {
|
|
|
464
459
|
it('should persist settings across scope changes', async () => {
|
|
465
460
|
const settings = createMockSettings({ vimMode: true });
|
|
466
461
|
const onSelect = vi.fn();
|
|
467
|
-
const { stdin, unmount } =
|
|
468
|
-
// Switch to scope selector
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
await wait();
|
|
462
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
463
|
+
// Switch to scope selector and change scope
|
|
464
|
+
act(() => {
|
|
465
|
+
stdin.write(TerminalKeys.TAB); // Tab
|
|
466
|
+
stdin.write('2'); // Select workspace scope
|
|
467
|
+
});
|
|
474
468
|
// Settings should be reloaded for new scope
|
|
475
469
|
unmount();
|
|
476
470
|
});
|
|
@@ -479,7 +473,7 @@ describe('SettingsDialog', () => {
|
|
|
479
473
|
{ vimMode: false }, // System settings
|
|
480
474
|
{ autoUpdate: false });
|
|
481
475
|
const onSelect = vi.fn();
|
|
482
|
-
const { lastFrame } =
|
|
476
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
483
477
|
// Should show user scope values initially
|
|
484
478
|
const output = lastFrame();
|
|
485
479
|
expect(output).toContain('Settings');
|
|
@@ -490,10 +484,11 @@ describe('SettingsDialog', () => {
|
|
|
490
484
|
mockToggleVimEnabled.mockRejectedValue(new Error('Toggle failed'));
|
|
491
485
|
const settings = createMockSettings();
|
|
492
486
|
const onSelect = vi.fn();
|
|
493
|
-
const { stdin, unmount } =
|
|
487
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
494
488
|
// Try to toggle a setting (this might trigger vim mode toggle)
|
|
495
|
-
|
|
496
|
-
|
|
489
|
+
act(() => {
|
|
490
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
491
|
+
});
|
|
497
492
|
// Should not crash
|
|
498
493
|
unmount();
|
|
499
494
|
});
|
|
@@ -502,27 +497,26 @@ describe('SettingsDialog', () => {
|
|
|
502
497
|
it('should track modified settings correctly', async () => {
|
|
503
498
|
const settings = createMockSettings();
|
|
504
499
|
const onSelect = vi.fn();
|
|
505
|
-
const { stdin, unmount } =
|
|
506
|
-
// Toggle a setting
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
stdin.write(TerminalKeys.ENTER); // Enter
|
|
513
|
-
await wait();
|
|
500
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
501
|
+
// Toggle a setting, then toggle another setting
|
|
502
|
+
act(() => {
|
|
503
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
504
|
+
stdin.write(TerminalKeys.DOWN_ARROW); // Down
|
|
505
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
506
|
+
});
|
|
514
507
|
// Should track multiple modified settings
|
|
515
508
|
unmount();
|
|
516
509
|
});
|
|
517
510
|
it('should handle scrolling when there are many settings', async () => {
|
|
518
511
|
const settings = createMockSettings();
|
|
519
512
|
const onSelect = vi.fn();
|
|
520
|
-
const { stdin, unmount } =
|
|
513
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
521
514
|
// Navigate down many times to test scrolling
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
515
|
+
act(() => {
|
|
516
|
+
for (let i = 0; i < 10; i++) {
|
|
517
|
+
stdin.write(TerminalKeys.DOWN_ARROW); // Down arrow
|
|
518
|
+
}
|
|
519
|
+
});
|
|
526
520
|
unmount();
|
|
527
521
|
});
|
|
528
522
|
});
|
|
@@ -533,8 +527,9 @@ describe('SettingsDialog', () => {
|
|
|
533
527
|
const { stdin, unmount } = render(_jsx(VimModeProvider, { settings: settings, children: _jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }) }));
|
|
534
528
|
// Navigate to and toggle vim mode setting
|
|
535
529
|
// This would require knowing the exact position of vim mode setting
|
|
536
|
-
|
|
537
|
-
|
|
530
|
+
act(() => {
|
|
531
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
532
|
+
});
|
|
538
533
|
unmount();
|
|
539
534
|
});
|
|
540
535
|
});
|
|
@@ -544,7 +539,7 @@ describe('SettingsDialog', () => {
|
|
|
544
539
|
{ hideWindowTitle: true }, // System settings
|
|
545
540
|
{ ideMode: false });
|
|
546
541
|
const onSelect = vi.fn();
|
|
547
|
-
const { lastFrame } =
|
|
542
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
548
543
|
const output = lastFrame();
|
|
549
544
|
// Should contain settings labels
|
|
550
545
|
expect(output).toContain('Settings');
|
|
@@ -552,28 +547,30 @@ describe('SettingsDialog', () => {
|
|
|
552
547
|
it('should handle immediate settings save for non-restart-required settings', async () => {
|
|
553
548
|
const settings = createMockSettings();
|
|
554
549
|
const onSelect = vi.fn();
|
|
555
|
-
const { stdin, unmount } =
|
|
550
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
556
551
|
// Toggle a non-restart-required setting (like hideTips)
|
|
557
|
-
|
|
558
|
-
|
|
552
|
+
act(() => {
|
|
553
|
+
stdin.write(TerminalKeys.ENTER); // Enter - toggle current setting
|
|
554
|
+
});
|
|
559
555
|
// Should save immediately without showing restart prompt
|
|
560
556
|
unmount();
|
|
561
557
|
});
|
|
562
558
|
it('should show restart prompt for restart-required settings', async () => {
|
|
563
559
|
const settings = createMockSettings();
|
|
564
560
|
const onSelect = vi.fn();
|
|
565
|
-
const { lastFrame, unmount } =
|
|
561
|
+
const { lastFrame, unmount } = renderDialog(settings, onSelect);
|
|
566
562
|
// This test would need to navigate to a specific restart-required setting
|
|
567
563
|
// Since we can't easily target specific settings, we test the general behavior
|
|
568
|
-
await wait();
|
|
569
564
|
// Should not show restart prompt initially
|
|
570
|
-
|
|
565
|
+
await waitFor(() => {
|
|
566
|
+
expect(lastFrame()).not.toContain('To see changes, Gemini CLI must be restarted');
|
|
567
|
+
});
|
|
571
568
|
unmount();
|
|
572
569
|
});
|
|
573
570
|
it('should clear restart prompt when switching scopes', async () => {
|
|
574
571
|
const settings = createMockSettings();
|
|
575
572
|
const onSelect = vi.fn();
|
|
576
|
-
const { unmount } =
|
|
573
|
+
const { unmount } = renderDialog(settings, onSelect);
|
|
577
574
|
// Restart prompt should be cleared when switching scopes
|
|
578
575
|
unmount();
|
|
579
576
|
});
|
|
@@ -583,7 +580,7 @@ describe('SettingsDialog', () => {
|
|
|
583
580
|
const settings = createMockSettings({}, { vimMode: true, hideWindowTitle: false }, // System settings
|
|
584
581
|
{});
|
|
585
582
|
const onSelect = vi.fn();
|
|
586
|
-
const { lastFrame } =
|
|
583
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
587
584
|
const output = lastFrame();
|
|
588
585
|
// Settings should show inherited values
|
|
589
586
|
expect(output).toContain('Settings');
|
|
@@ -593,68 +590,122 @@ describe('SettingsDialog', () => {
|
|
|
593
590
|
{ vimMode: true }, // System default
|
|
594
591
|
{});
|
|
595
592
|
const onSelect = vi.fn();
|
|
596
|
-
const { lastFrame } =
|
|
593
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
597
594
|
const output = lastFrame();
|
|
598
595
|
// Should show settings with override indicators
|
|
599
596
|
expect(output).toContain('Settings');
|
|
600
597
|
});
|
|
601
598
|
});
|
|
599
|
+
describe('Race Condition Regression Tests', () => {
|
|
600
|
+
it.each([
|
|
601
|
+
{
|
|
602
|
+
name: 'not reset sibling settings when toggling a nested setting multiple times',
|
|
603
|
+
toggleCount: 5,
|
|
604
|
+
shellSettings: {
|
|
605
|
+
showColor: false,
|
|
606
|
+
enableInteractiveShell: true,
|
|
607
|
+
},
|
|
608
|
+
expectedSiblings: {
|
|
609
|
+
enableInteractiveShell: true,
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: 'preserve multiple sibling settings in nested objects during rapid toggles',
|
|
614
|
+
toggleCount: 3,
|
|
615
|
+
shellSettings: {
|
|
616
|
+
showColor: false,
|
|
617
|
+
enableInteractiveShell: true,
|
|
618
|
+
pager: 'less',
|
|
619
|
+
},
|
|
620
|
+
expectedSiblings: {
|
|
621
|
+
enableInteractiveShell: true,
|
|
622
|
+
pager: 'less',
|
|
623
|
+
},
|
|
624
|
+
},
|
|
625
|
+
])('should $name', async ({ toggleCount, shellSettings, expectedSiblings }) => {
|
|
626
|
+
vi.mocked(saveModifiedSettings).mockClear();
|
|
627
|
+
vi.mocked(getSettingsSchema).mockReturnValue(TOOLS_SHELL_FAKE_SCHEMA);
|
|
628
|
+
const settings = createMockSettings({
|
|
629
|
+
tools: {
|
|
630
|
+
shell: shellSettings,
|
|
631
|
+
},
|
|
632
|
+
});
|
|
633
|
+
const onSelect = vi.fn();
|
|
634
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
635
|
+
for (let i = 0; i < toggleCount; i++) {
|
|
636
|
+
act(() => {
|
|
637
|
+
stdin.write(TerminalKeys.ENTER);
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
await waitFor(() => {
|
|
641
|
+
expect(vi.mocked(saveModifiedSettings).mock.calls.length).toBeGreaterThan(0);
|
|
642
|
+
});
|
|
643
|
+
const calls = vi.mocked(saveModifiedSettings).mock.calls;
|
|
644
|
+
calls.forEach((call) => {
|
|
645
|
+
const [modifiedKeys, pendingSettings] = call;
|
|
646
|
+
if (modifiedKeys.has('tools.shell.showColor')) {
|
|
647
|
+
const shellSettings = pendingSettings.tools?.shell;
|
|
648
|
+
Object.entries(expectedSiblings).forEach(([key, value]) => {
|
|
649
|
+
expect(shellSettings?.[key]).toBe(value);
|
|
650
|
+
expect(modifiedKeys.has(`tools.shell.${key}`)).toBe(false);
|
|
651
|
+
});
|
|
652
|
+
expect(modifiedKeys.size).toBe(1);
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
expect(calls.length).toBeGreaterThan(0);
|
|
656
|
+
unmount();
|
|
657
|
+
});
|
|
658
|
+
});
|
|
602
659
|
describe('Keyboard Shortcuts Edge Cases', () => {
|
|
603
660
|
it('should handle rapid key presses gracefully', async () => {
|
|
604
661
|
const settings = createMockSettings();
|
|
605
662
|
const onSelect = vi.fn();
|
|
606
|
-
const { stdin, unmount } =
|
|
663
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
607
664
|
// Rapid navigation
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
665
|
+
act(() => {
|
|
666
|
+
for (let i = 0; i < 5; i++) {
|
|
667
|
+
stdin.write(TerminalKeys.DOWN_ARROW);
|
|
668
|
+
stdin.write(TerminalKeys.UP_ARROW);
|
|
669
|
+
}
|
|
670
|
+
});
|
|
613
671
|
// Should not crash
|
|
614
672
|
unmount();
|
|
615
673
|
});
|
|
616
|
-
it(
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
stdin.write('\u0003'); // Ctrl+C
|
|
622
|
-
await wait();
|
|
623
|
-
// Should reset the current setting to its default value
|
|
624
|
-
unmount();
|
|
625
|
-
});
|
|
626
|
-
it('should handle Ctrl+L to reset current setting to default', async () => {
|
|
627
|
-
const settings = createMockSettings({ vimMode: true }); // Start with vimMode enabled
|
|
674
|
+
it.each([
|
|
675
|
+
{ key: 'Ctrl+C', code: '\u0003' },
|
|
676
|
+
{ key: 'Ctrl+L', code: '\u000C' },
|
|
677
|
+
])('should handle $key to reset current setting to default', async ({ code }) => {
|
|
678
|
+
const settings = createMockSettings({ vimMode: true });
|
|
628
679
|
const onSelect = vi.fn();
|
|
629
|
-
const { stdin, unmount } =
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
680
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
681
|
+
act(() => {
|
|
682
|
+
stdin.write(code);
|
|
683
|
+
});
|
|
633
684
|
// Should reset the current setting to its default value
|
|
634
685
|
unmount();
|
|
635
686
|
});
|
|
636
687
|
it('should handle navigation when only one setting exists', async () => {
|
|
637
688
|
const settings = createMockSettings();
|
|
638
689
|
const onSelect = vi.fn();
|
|
639
|
-
const { stdin, unmount } =
|
|
690
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
640
691
|
// Try to navigate when potentially at bounds
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
692
|
+
act(() => {
|
|
693
|
+
stdin.write(TerminalKeys.DOWN_ARROW);
|
|
694
|
+
stdin.write(TerminalKeys.UP_ARROW);
|
|
695
|
+
});
|
|
645
696
|
unmount();
|
|
646
697
|
});
|
|
647
698
|
it('should properly handle Tab navigation between sections', async () => {
|
|
648
699
|
const settings = createMockSettings();
|
|
649
700
|
const onSelect = vi.fn();
|
|
650
|
-
const { lastFrame, unmount } =
|
|
701
|
+
const { lastFrame, unmount } = renderDialog(settings, onSelect);
|
|
651
702
|
// Wait for initial render
|
|
652
703
|
await waitFor(() => {
|
|
653
704
|
expect(lastFrame()).toContain('Vim Mode');
|
|
654
705
|
});
|
|
655
706
|
// Verify initial state: settings section active, scope section inactive
|
|
656
|
-
expect(lastFrame()).toContain('
|
|
657
|
-
expect(lastFrame()).toContain('
|
|
707
|
+
expect(lastFrame()).toContain('Vim Mode'); // Settings section active
|
|
708
|
+
expect(lastFrame()).toContain('Apply To'); // Scope section (don't rely on exact spacing)
|
|
658
709
|
// This test validates the rendered UI structure for tab navigation
|
|
659
710
|
// Actual tab behavior testing is complex due to keypress handling
|
|
660
711
|
unmount();
|
|
@@ -666,7 +717,7 @@ describe('SettingsDialog', () => {
|
|
|
666
717
|
const settings = createMockSettings({ vimMode: null }, // Invalid value
|
|
667
718
|
{}, {});
|
|
668
719
|
const onSelect = vi.fn();
|
|
669
|
-
const { lastFrame } =
|
|
720
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
670
721
|
// Should still render without crashing
|
|
671
722
|
expect(lastFrame()).toContain('Settings');
|
|
672
723
|
});
|
|
@@ -674,7 +725,7 @@ describe('SettingsDialog', () => {
|
|
|
674
725
|
const settings = createMockSettings();
|
|
675
726
|
const onSelect = vi.fn();
|
|
676
727
|
// Should not crash even if some settings are missing definitions
|
|
677
|
-
const { lastFrame } =
|
|
728
|
+
const { lastFrame } = renderDialog(settings, onSelect);
|
|
678
729
|
expect(lastFrame()).toContain('Settings');
|
|
679
730
|
});
|
|
680
731
|
});
|
|
@@ -682,17 +733,18 @@ describe('SettingsDialog', () => {
|
|
|
682
733
|
it('should handle complete user workflow: navigate, toggle, change scope, exit', async () => {
|
|
683
734
|
const settings = createMockSettings();
|
|
684
735
|
const onSelect = vi.fn();
|
|
685
|
-
const { lastFrame, unmount } =
|
|
736
|
+
const { lastFrame, unmount } = renderDialog(settings, onSelect);
|
|
686
737
|
// Wait for initial render
|
|
687
738
|
await waitFor(() => {
|
|
688
739
|
expect(lastFrame()).toContain('Vim Mode');
|
|
689
740
|
});
|
|
690
741
|
// Verify the complete UI is rendered with all necessary sections
|
|
691
742
|
expect(lastFrame()).toContain('Settings'); // Title
|
|
692
|
-
expect(lastFrame()).toContain('
|
|
743
|
+
expect(lastFrame()).toContain('Vim Mode'); // Active setting
|
|
693
744
|
expect(lastFrame()).toContain('Apply To'); // Scope section
|
|
694
745
|
expect(lastFrame()).toContain('User Settings'); // Scope options (no numbers when settings focused)
|
|
695
|
-
|
|
746
|
+
// Use regex for more flexible help text matching
|
|
747
|
+
expect(lastFrame()).toMatch(/Enter.*select.*Tab.*focus.*Esc.*close/);
|
|
696
748
|
// This test validates the complete UI structure is available for user workflow
|
|
697
749
|
// Individual interactions are tested in focused unit tests
|
|
698
750
|
unmount();
|
|
@@ -700,20 +752,15 @@ describe('SettingsDialog', () => {
|
|
|
700
752
|
it('should allow changing multiple settings without losing pending changes', async () => {
|
|
701
753
|
const settings = createMockSettings();
|
|
702
754
|
const onSelect = vi.fn();
|
|
703
|
-
const { stdin, unmount } =
|
|
704
|
-
// Toggle
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
// Navigate to another setting and toggle it (should also require restart)
|
|
713
|
-
stdin.write(TerminalKeys.DOWN_ARROW); // Down
|
|
714
|
-
await wait();
|
|
715
|
-
stdin.write(TerminalKeys.ENTER); // Enter
|
|
716
|
-
await wait();
|
|
755
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
756
|
+
// Toggle multiple settings
|
|
757
|
+
act(() => {
|
|
758
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
759
|
+
stdin.write(TerminalKeys.DOWN_ARROW); // Down
|
|
760
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
761
|
+
stdin.write(TerminalKeys.DOWN_ARROW); // Down
|
|
762
|
+
stdin.write(TerminalKeys.ENTER); // Enter
|
|
763
|
+
});
|
|
717
764
|
// The test verifies that all changes are preserved and the dialog still works
|
|
718
765
|
// This tests the fix for the bug where changing one setting would reset all pending changes
|
|
719
766
|
unmount();
|
|
@@ -721,28 +768,28 @@ describe('SettingsDialog', () => {
|
|
|
721
768
|
it('should maintain state consistency during complex interactions', async () => {
|
|
722
769
|
const settings = createMockSettings({ vimMode: true });
|
|
723
770
|
const onSelect = vi.fn();
|
|
724
|
-
const { stdin, unmount } =
|
|
771
|
+
const { stdin, unmount } = renderDialog(settings, onSelect);
|
|
725
772
|
// Multiple scope changes
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
await wait();
|
|
734
|
-
stdin.write('1'); // User
|
|
735
|
-
await wait();
|
|
773
|
+
act(() => {
|
|
774
|
+
stdin.write(TerminalKeys.TAB); // Tab to scope
|
|
775
|
+
stdin.write('2'); // Workspace
|
|
776
|
+
stdin.write(TerminalKeys.TAB); // Tab to settings
|
|
777
|
+
stdin.write(TerminalKeys.TAB); // Tab to scope
|
|
778
|
+
stdin.write('1'); // User
|
|
779
|
+
});
|
|
736
780
|
// Should maintain consistent state
|
|
737
781
|
unmount();
|
|
738
782
|
});
|
|
739
783
|
it('should handle restart workflow correctly', async () => {
|
|
740
784
|
const settings = createMockSettings();
|
|
741
785
|
const onRestartRequest = vi.fn();
|
|
742
|
-
const { stdin, unmount } =
|
|
786
|
+
const { stdin, unmount } = renderDialog(settings, vi.fn(), {
|
|
787
|
+
onRestartRequest,
|
|
788
|
+
});
|
|
743
789
|
// This would test the restart workflow if we could trigger it
|
|
744
|
-
|
|
745
|
-
|
|
790
|
+
act(() => {
|
|
791
|
+
stdin.write('r'); // Try restart key
|
|
792
|
+
});
|
|
746
793
|
// Without restart prompt showing, this should have no effect
|
|
747
794
|
expect(onRestartRequest).not.toHaveBeenCalled();
|
|
748
795
|
unmount();
|
|
@@ -753,282 +800,244 @@ describe('SettingsDialog', () => {
|
|
|
753
800
|
let settings = createMockSettings({ 'a.string.setting': 'initial' });
|
|
754
801
|
const onSelect = vi.fn();
|
|
755
802
|
const { stdin, unmount, rerender } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
756
|
-
// Wait for the dialog to render
|
|
757
|
-
await wait();
|
|
758
803
|
// Navigate to the last setting
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
stdin.write('\r');
|
|
771
|
-
await wait();
|
|
804
|
+
act(() => {
|
|
805
|
+
for (let i = 0; i < 20; i++) {
|
|
806
|
+
stdin.write('j'); // Down
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
// Press Enter to start editing, type new value, and commit
|
|
810
|
+
act(() => {
|
|
811
|
+
stdin.write('\r'); // Start editing
|
|
812
|
+
stdin.write('new value');
|
|
813
|
+
stdin.write('\r'); // Commit
|
|
814
|
+
});
|
|
772
815
|
settings = createMockSettings({ 'a.string.setting': 'new value' }, {}, {});
|
|
773
816
|
rerender(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
774
|
-
await wait();
|
|
775
817
|
// Press Escape to exit
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
818
|
+
act(() => {
|
|
819
|
+
stdin.write('\u001B');
|
|
820
|
+
});
|
|
821
|
+
await waitFor(() => {
|
|
822
|
+
expect(onSelect).toHaveBeenCalledWith(undefined, 'User');
|
|
823
|
+
});
|
|
779
824
|
unmount();
|
|
780
825
|
});
|
|
781
826
|
});
|
|
782
827
|
describe('Snapshot Tests', () => {
|
|
783
828
|
/**
|
|
784
829
|
* Snapshot tests for SettingsDialog component using ink-testing-library.
|
|
785
|
-
* These tests capture the visual output of the component in various states
|
|
786
|
-
*
|
|
787
|
-
* - Default rendering with no custom settings
|
|
788
|
-
* - Various combinations of boolean settings (enabled/disabled)
|
|
789
|
-
* - Mixed boolean and number settings configurations
|
|
790
|
-
* - Different focus states (settings vs scope selector)
|
|
791
|
-
* - Different scope selections (User, System, Workspace)
|
|
792
|
-
* - Accessibility settings enabled
|
|
793
|
-
* - File filtering configurations
|
|
794
|
-
* - Tools and security settings
|
|
795
|
-
* - All settings disabled state
|
|
796
|
-
*
|
|
830
|
+
* These tests capture the visual output of the component in various states.
|
|
797
831
|
* The snapshots help ensure UI consistency and catch unintended visual changes.
|
|
798
832
|
*/
|
|
799
|
-
it(
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
hideTips: true,
|
|
816
|
-
showMemoryUsage: true,
|
|
817
|
-
showLineNumbers: true,
|
|
818
|
-
showCitations: true,
|
|
819
|
-
accessibility: {
|
|
820
|
-
disableLoadingPhrases: true,
|
|
821
|
-
screenReader: true,
|
|
833
|
+
it.each([
|
|
834
|
+
{
|
|
835
|
+
name: 'default state',
|
|
836
|
+
userSettings: {},
|
|
837
|
+
systemSettings: {},
|
|
838
|
+
workspaceSettings: {},
|
|
839
|
+
stdinActions: undefined,
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
name: 'various boolean settings enabled',
|
|
843
|
+
userSettings: {
|
|
844
|
+
general: {
|
|
845
|
+
vimMode: true,
|
|
846
|
+
disableAutoUpdate: true,
|
|
847
|
+
debugKeystrokeLogging: true,
|
|
848
|
+
enablePromptCompletion: true,
|
|
822
849
|
},
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
disableFuzzySearch: false,
|
|
850
|
+
ui: {
|
|
851
|
+
hideWindowTitle: true,
|
|
852
|
+
hideTips: true,
|
|
853
|
+
showMemoryUsage: true,
|
|
854
|
+
showLineNumbers: true,
|
|
855
|
+
showCitations: true,
|
|
856
|
+
accessibility: {
|
|
857
|
+
disableLoadingPhrases: true,
|
|
858
|
+
screenReader: true,
|
|
859
|
+
},
|
|
834
860
|
},
|
|
835
|
-
|
|
836
|
-
tools: {
|
|
837
|
-
enableInteractiveShell: true,
|
|
838
|
-
autoAccept: true,
|
|
839
|
-
useRipgrep: true,
|
|
840
|
-
},
|
|
841
|
-
security: {
|
|
842
|
-
folderTrust: {
|
|
861
|
+
ide: {
|
|
843
862
|
enabled: true,
|
|
844
863
|
},
|
|
864
|
+
context: {
|
|
865
|
+
loadMemoryFromIncludeDirectories: true,
|
|
866
|
+
fileFiltering: {
|
|
867
|
+
respectGitIgnore: true,
|
|
868
|
+
respectGeminiIgnore: true,
|
|
869
|
+
enableRecursiveFileSearch: true,
|
|
870
|
+
disableFuzzySearch: false,
|
|
871
|
+
},
|
|
872
|
+
},
|
|
873
|
+
tools: {
|
|
874
|
+
enableInteractiveShell: true,
|
|
875
|
+
autoAccept: true,
|
|
876
|
+
useRipgrep: true,
|
|
877
|
+
},
|
|
878
|
+
security: {
|
|
879
|
+
folderTrust: {
|
|
880
|
+
enabled: true,
|
|
881
|
+
},
|
|
882
|
+
},
|
|
845
883
|
},
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
});
|
|
851
|
-
it('should render with mixed boolean and number settings', () => {
|
|
852
|
-
const settings = createMockSettings({
|
|
853
|
-
general: {
|
|
854
|
-
vimMode: false,
|
|
855
|
-
disableAutoUpdate: true,
|
|
856
|
-
},
|
|
857
|
-
ui: {
|
|
858
|
-
showMemoryUsage: true,
|
|
859
|
-
hideWindowTitle: false,
|
|
860
|
-
},
|
|
861
|
-
tools: {
|
|
862
|
-
truncateToolOutputThreshold: 50000,
|
|
863
|
-
truncateToolOutputLines: 1000,
|
|
864
|
-
},
|
|
865
|
-
context: {
|
|
866
|
-
discoveryMaxDirs: 500,
|
|
867
|
-
},
|
|
868
|
-
model: {
|
|
869
|
-
maxSessionTurns: 100,
|
|
870
|
-
skipNextSpeakerCheck: false,
|
|
871
|
-
},
|
|
872
|
-
});
|
|
873
|
-
const onSelect = vi.fn();
|
|
874
|
-
const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
875
|
-
expect(lastFrame()).toMatchSnapshot();
|
|
876
|
-
});
|
|
877
|
-
it('should render focused on scope selector', () => {
|
|
878
|
-
const settings = createMockSettings();
|
|
879
|
-
const onSelect = vi.fn();
|
|
880
|
-
const { lastFrame, stdin } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
881
|
-
// Switch focus to scope selector with Tab
|
|
882
|
-
stdin.write('\t');
|
|
883
|
-
expect(lastFrame()).toMatchSnapshot();
|
|
884
|
-
});
|
|
885
|
-
it('should render with different scope selected (System)', () => {
|
|
886
|
-
const settings = createMockSettings({}, // userSettings
|
|
884
|
+
systemSettings: {},
|
|
885
|
+
workspaceSettings: {},
|
|
886
|
+
stdinActions: undefined,
|
|
887
|
+
},
|
|
887
888
|
{
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
889
|
+
name: 'mixed boolean and number settings',
|
|
890
|
+
userSettings: {
|
|
891
|
+
general: {
|
|
892
|
+
vimMode: false,
|
|
893
|
+
disableAutoUpdate: true,
|
|
894
|
+
},
|
|
895
|
+
ui: {
|
|
896
|
+
showMemoryUsage: true,
|
|
897
|
+
hideWindowTitle: false,
|
|
898
|
+
},
|
|
899
|
+
tools: {
|
|
900
|
+
truncateToolOutputThreshold: 50000,
|
|
901
|
+
truncateToolOutputLines: 1000,
|
|
902
|
+
},
|
|
903
|
+
context: {
|
|
904
|
+
discoveryMaxDirs: 500,
|
|
905
|
+
},
|
|
906
|
+
model: {
|
|
907
|
+
maxSessionTurns: 100,
|
|
908
|
+
skipNextSpeakerCheck: false,
|
|
909
|
+
},
|
|
895
910
|
},
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
stdin.write('\t');
|
|
901
|
-
// Navigate to System scope
|
|
902
|
-
stdin.write('ArrowDown');
|
|
903
|
-
stdin.write('\r'); // Enter to select
|
|
904
|
-
expect(lastFrame()).toMatchSnapshot();
|
|
905
|
-
});
|
|
906
|
-
it('should render with different scope selected (Workspace)', () => {
|
|
907
|
-
const settings = createMockSettings({}, // userSettings
|
|
908
|
-
{}, // systemSettings
|
|
911
|
+
systemSettings: {},
|
|
912
|
+
workspaceSettings: {},
|
|
913
|
+
stdinActions: undefined,
|
|
914
|
+
},
|
|
909
915
|
{
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
916
|
+
name: 'focused on scope selector',
|
|
917
|
+
userSettings: {},
|
|
918
|
+
systemSettings: {},
|
|
919
|
+
workspaceSettings: {},
|
|
920
|
+
stdinActions: (stdin) => {
|
|
921
|
+
act(() => {
|
|
922
|
+
stdin.write('\t');
|
|
923
|
+
});
|
|
918
924
|
},
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
it('should render with accessibility settings enabled', () => {
|
|
931
|
-
const settings = createMockSettings({
|
|
932
|
-
ui: {
|
|
933
|
-
accessibility: {
|
|
934
|
-
disableLoadingPhrases: true,
|
|
935
|
-
screenReader: true,
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
name: 'accessibility settings enabled',
|
|
928
|
+
userSettings: {
|
|
929
|
+
ui: {
|
|
930
|
+
accessibility: {
|
|
931
|
+
disableLoadingPhrases: true,
|
|
932
|
+
screenReader: true,
|
|
933
|
+
},
|
|
934
|
+
showMemoryUsage: true,
|
|
935
|
+
showLineNumbers: true,
|
|
936
936
|
},
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
},
|
|
940
|
-
general: {
|
|
941
|
-
vimMode: true,
|
|
942
|
-
},
|
|
943
|
-
});
|
|
944
|
-
const onSelect = vi.fn();
|
|
945
|
-
const { lastFrame } = render(_jsx(KeypressProvider, { kittyProtocolEnabled: false, children: _jsx(SettingsDialog, { settings: settings, onSelect: onSelect }) }));
|
|
946
|
-
expect(lastFrame()).toMatchSnapshot();
|
|
947
|
-
});
|
|
948
|
-
it('should render with file filtering settings configured', () => {
|
|
949
|
-
const settings = createMockSettings({
|
|
950
|
-
context: {
|
|
951
|
-
fileFiltering: {
|
|
952
|
-
respectGitIgnore: false,
|
|
953
|
-
respectGeminiIgnore: true,
|
|
954
|
-
enableRecursiveFileSearch: false,
|
|
955
|
-
disableFuzzySearch: true,
|
|
937
|
+
general: {
|
|
938
|
+
vimMode: true,
|
|
956
939
|
},
|
|
957
|
-
loadMemoryFromIncludeDirectories: true,
|
|
958
|
-
discoveryMaxDirs: 100,
|
|
959
940
|
},
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
enabled: true,
|
|
941
|
+
systemSettings: {},
|
|
942
|
+
workspaceSettings: {},
|
|
943
|
+
stdinActions: undefined,
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
name: 'file filtering settings configured',
|
|
947
|
+
userSettings: {
|
|
948
|
+
context: {
|
|
949
|
+
fileFiltering: {
|
|
950
|
+
respectGitIgnore: false,
|
|
951
|
+
respectGeminiIgnore: true,
|
|
952
|
+
enableRecursiveFileSearch: false,
|
|
953
|
+
disableFuzzySearch: true,
|
|
954
|
+
},
|
|
955
|
+
loadMemoryFromIncludeDirectories: true,
|
|
956
|
+
discoveryMaxDirs: 100,
|
|
977
957
|
},
|
|
978
958
|
},
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
disableAutoUpdate: false,
|
|
993
|
-
debugKeystrokeLogging: false,
|
|
994
|
-
enablePromptCompletion: false,
|
|
995
|
-
},
|
|
996
|
-
ui: {
|
|
997
|
-
hideWindowTitle: false,
|
|
998
|
-
hideTips: false,
|
|
999
|
-
showMemoryUsage: false,
|
|
1000
|
-
showLineNumbers: false,
|
|
1001
|
-
showCitations: false,
|
|
1002
|
-
accessibility: {
|
|
1003
|
-
disableLoadingPhrases: false,
|
|
1004
|
-
screenReader: false,
|
|
959
|
+
systemSettings: {},
|
|
960
|
+
workspaceSettings: {},
|
|
961
|
+
stdinActions: undefined,
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
name: 'tools and security settings',
|
|
965
|
+
userSettings: {
|
|
966
|
+
tools: {
|
|
967
|
+
enableInteractiveShell: true,
|
|
968
|
+
autoAccept: false,
|
|
969
|
+
useRipgrep: true,
|
|
970
|
+
truncateToolOutputThreshold: 25000,
|
|
971
|
+
truncateToolOutputLines: 500,
|
|
1005
972
|
},
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
respectGeminiIgnore: false,
|
|
1015
|
-
enableRecursiveFileSearch: false,
|
|
1016
|
-
disableFuzzySearch: false,
|
|
973
|
+
security: {
|
|
974
|
+
folderTrust: {
|
|
975
|
+
enabled: true,
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
model: {
|
|
979
|
+
maxSessionTurns: 50,
|
|
980
|
+
skipNextSpeakerCheck: true,
|
|
1017
981
|
},
|
|
1018
982
|
},
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
983
|
+
systemSettings: {},
|
|
984
|
+
workspaceSettings: {},
|
|
985
|
+
stdinActions: undefined,
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
name: 'all boolean settings disabled',
|
|
989
|
+
userSettings: {
|
|
990
|
+
general: {
|
|
991
|
+
vimMode: false,
|
|
992
|
+
disableAutoUpdate: false,
|
|
993
|
+
debugKeystrokeLogging: false,
|
|
994
|
+
enablePromptCompletion: false,
|
|
995
|
+
},
|
|
996
|
+
ui: {
|
|
997
|
+
hideWindowTitle: false,
|
|
998
|
+
hideTips: false,
|
|
999
|
+
showMemoryUsage: false,
|
|
1000
|
+
showLineNumbers: false,
|
|
1001
|
+
showCitations: false,
|
|
1002
|
+
accessibility: {
|
|
1003
|
+
disableLoadingPhrases: false,
|
|
1004
|
+
screenReader: false,
|
|
1005
|
+
},
|
|
1006
|
+
},
|
|
1007
|
+
ide: {
|
|
1026
1008
|
enabled: false,
|
|
1027
1009
|
},
|
|
1010
|
+
context: {
|
|
1011
|
+
loadMemoryFromIncludeDirectories: false,
|
|
1012
|
+
fileFiltering: {
|
|
1013
|
+
respectGitIgnore: false,
|
|
1014
|
+
respectGeminiIgnore: false,
|
|
1015
|
+
enableRecursiveFileSearch: false,
|
|
1016
|
+
disableFuzzySearch: false,
|
|
1017
|
+
},
|
|
1018
|
+
},
|
|
1019
|
+
tools: {
|
|
1020
|
+
enableInteractiveShell: false,
|
|
1021
|
+
autoAccept: false,
|
|
1022
|
+
useRipgrep: false,
|
|
1023
|
+
},
|
|
1024
|
+
security: {
|
|
1025
|
+
folderTrust: {
|
|
1026
|
+
enabled: false,
|
|
1027
|
+
},
|
|
1028
|
+
},
|
|
1028
1029
|
},
|
|
1029
|
-
|
|
1030
|
+
systemSettings: {},
|
|
1031
|
+
workspaceSettings: {},
|
|
1032
|
+
stdinActions: undefined,
|
|
1033
|
+
},
|
|
1034
|
+
])('should render $name correctly', ({ userSettings, systemSettings, workspaceSettings, stdinActions }) => {
|
|
1035
|
+
const settings = createMockSettings(userSettings, systemSettings, workspaceSettings);
|
|
1030
1036
|
const onSelect = vi.fn();
|
|
1031
|
-
const { lastFrame } =
|
|
1037
|
+
const { lastFrame, stdin } = renderDialog(settings, onSelect);
|
|
1038
|
+
if (stdinActions) {
|
|
1039
|
+
stdinActions(stdin);
|
|
1040
|
+
}
|
|
1032
1041
|
expect(lastFrame()).toMatchSnapshot();
|
|
1033
1042
|
});
|
|
1034
1043
|
});
|