@umsai/ums-code 0.0.11-post6 → 0.0.13-v1
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 +9 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +9 -6
- package/dist/src/commands/extensions/disable.d.ts +14 -0
- package/dist/src/commands/extensions/disable.js +42 -0
- package/dist/src/commands/extensions/disable.js.map +1 -0
- package/dist/src/commands/extensions/enable.d.ts +14 -0
- package/dist/src/commands/extensions/enable.js +48 -0
- package/dist/src/commands/extensions/enable.js.map +1 -0
- package/dist/src/commands/extensions/install.d.ts +13 -0
- package/dist/src/commands/extensions/install.js +48 -0
- package/dist/src/commands/extensions/install.js.map +1 -0
- package/dist/src/commands/extensions/install.test.d.ts +6 -0
- package/dist/src/commands/extensions/install.test.js +25 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -0
- package/dist/src/commands/extensions/list.d.ts +8 -0
- package/dist/src/commands/extensions/list.js +32 -0
- package/dist/src/commands/extensions/list.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.d.ts +12 -0
- package/dist/src/commands/extensions/uninstall.js +38 -0
- package/dist/src/commands/extensions/uninstall.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
- package/dist/src/commands/extensions/uninstall.test.js +18 -0
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
- package/dist/src/commands/extensions/update.d.ts +12 -0
- package/dist/src/commands/extensions/update.js +38 -0
- package/dist/src/commands/extensions/update.js.map +1 -0
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +29 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/mcp/add.js +1 -0
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/list.js +1 -1
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/config/auth.js +1 -1
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +8 -6
- package/dist/src/config/config.js +128 -82
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +41 -4
- package/dist/src/config/extension.js +270 -16
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/variableSchema.d.ts +28 -0
- package/dist/src/config/extensions/variableSchema.js +18 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -0
- package/dist/src/config/extensions/variables.d.ts +17 -0
- package/dist/src/config/extensions/variables.js +40 -0
- package/dist/src/config/extensions/variables.js.map +1 -0
- package/dist/src/config/extensions/variables.test.d.ts +6 -0
- package/dist/src/config/extensions/variables.test.js +17 -0
- package/dist/src/config/extensions/variables.test.js.map +1 -0
- package/dist/src/config/keyBindings.test.js +1 -1
- package/dist/src/config/keyBindings.test.js.map +1 -1
- package/dist/src/config/sandboxConfig.d.ts +2 -2
- package/dist/src/config/sandboxConfig.js +5 -7
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +12 -6
- package/dist/src/config/settings.js +398 -87
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +664 -393
- package/dist/src/config/settingsSchema.js +659 -388
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +87 -89
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/trustedFolders.d.ts +2 -2
- package/dist/src/config/trustedFolders.js +6 -6
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +9 -5
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/gemini.d.ts +3 -1
- package/dist/src/gemini.js +96 -73
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +78 -24
- 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/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +1 -1
- package/dist/src/nonInteractiveCli.js +24 -35
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +3 -3
- package/dist/src/services/BuiltinCommandLoader.js +7 -3
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +19 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/CommandService.d.ts +2 -2
- package/dist/src/services/CommandService.test.js +1 -0
- package/dist/src/services/CommandService.test.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +3 -3
- package/dist/src/services/FileCommandLoader.js +26 -16
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.d.ts +14 -4
- package/dist/src/services/McpPromptLoader.js +43 -17
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
- package/dist/src/services/McpPromptLoader.test.js +114 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +3 -3
- package/dist/src/services/prompt-processors/argumentProcessor.js +3 -2
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +62 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
- package/dist/src/services/prompt-processors/injectionParser.js +60 -0
- package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +4 -12
- package/dist/src/services/prompt-processors/shellProcessor.js +17 -58
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/types.d.ts +13 -8
- package/dist/src/services/prompt-processors/types.js +4 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -1
- package/dist/src/services/types.d.ts +1 -1
- package/dist/src/test-utils/customMatchers.js +0 -6
- package/dist/src/test-utils/customMatchers.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.d.ts +1 -1
- package/dist/src/test-utils/mockCommandContext.js +4 -1
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/render.d.ts +1 -1
- package/dist/src/ui/App.d.ts +2 -2
- package/dist/src/ui/App.js +131 -38
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js +2 -2
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/colors.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.js +1 -1
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +1 -1
- package/dist/src/ui/commands/agentsCommand.js +1 -1
- package/dist/src/ui/commands/agentsCommand.js.map +1 -1
- package/dist/src/ui/commands/approvalModeCommand.d.ts +7 -0
- package/dist/src/ui/commands/approvalModeCommand.js +340 -0
- package/dist/src/ui/commands/approvalModeCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js +293 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +1 -1
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +1 -1
- package/dist/src/ui/commands/chatCommand.js +4 -3
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.d.ts +1 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +1 -1
- package/dist/src/ui/commands/compressCommand.js +2 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.d.ts +1 -1
- package/dist/src/ui/commands/copyCommand.js +2 -2
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/directoryCommand.js +20 -18
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.d.ts +1 -1
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +2 -2
- package/dist/src/ui/commands/ideCommand.js +6 -8
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.d.ts +1 -1
- package/dist/src/ui/commands/initCommand.js +3 -3
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.d.ts +1 -1
- package/dist/src/ui/commands/mcpCommand.js +1 -1
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/memoryCommand.js +6 -5
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +68 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/modelCommand.test.js +138 -0
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
- package/dist/src/ui/commands/privacyCommand.d.ts +1 -1
- package/dist/src/ui/commands/privacyCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +1 -1
- package/dist/src/ui/commands/restoreCommand.js +4 -8
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +1 -1
- package/dist/src/ui/commands/settingsCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +1 -1
- package/dist/src/ui/commands/setupGithubCommand.js +1 -1
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.d.ts +1 -1
- package/dist/src/ui/commands/summaryCommand.js +4 -4
- package/dist/src/ui/commands/summaryCommand.js.map +1 -1
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +1 -1
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -1
- package/dist/src/ui/commands/themeCommand.d.ts +1 -1
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +1 -1
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +8 -9
- package/dist/src/ui/commands/types.js +1 -0
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.d.ts +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.js +1 -1
- package/dist/src/ui/commands/vimCommand.d.ts +1 -1
- package/dist/src/ui/commands/vimCommand.js.map +1 -1
- package/dist/src/ui/components/AboutBox.d.ts +1 -1
- package/dist/src/ui/components/AuthDialog.d.ts +2 -2
- package/dist/src/ui/components/AuthDialog.js +7 -12
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.test.js +116 -56
- package/dist/src/ui/components/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/components/AuthInProgress.d.ts +1 -1
- package/dist/src/ui/components/AuthInProgress.js +0 -5
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.js +8 -3
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +2 -2
- package/dist/src/ui/components/DetailedMessagesDisplay.js +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +4 -3
- package/dist/src/ui/components/EditorSettingsDialog.js +8 -11
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +2 -1
- package/dist/src/ui/components/FolderTrustDialog.js +10 -4
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +41 -4
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.js +5 -3
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +1 -1
- package/dist/src/ui/components/Help.d.ts +2 -2
- package/dist/src/ui/components/Help.js +1 -1
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -5
- package/dist/src/ui/components/HistoryItemDisplay.js +4 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +2 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +5 -5
- package/dist/src/ui/components/InputPrompt.js +142 -20
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +2 -2
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.js +0 -5
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSelectionDialog.d.ts +14 -0
- package/dist/src/ui/components/ModelSelectionDialog.js +26 -0
- package/dist/src/ui/components/ModelSelectionDialog.js.map +1 -0
- package/dist/src/ui/components/ModelSelectionDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelSelectionDialog.test.js +124 -0
- package/dist/src/ui/components/ModelSelectionDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.d.ts +15 -0
- package/dist/src/ui/components/ModelSwitchDialog.js +37 -0
- package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js +125 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.js +0 -5
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/PlanSummaryDisplay.d.ts +14 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js +9 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +1 -1
- package/dist/src/ui/components/QuitConfirmationDialog.d.ts +1 -1
- package/dist/src/ui/components/QwenOAuthProgress.d.ts +2 -2
- package/dist/src/ui/components/QwenOAuthProgress.js +0 -5
- package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
- package/dist/src/ui/components/SettingsDialog.js +68 -37
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +135 -57
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +2 -2
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellModeIndicator.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.js +3 -3
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +12 -4
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +3 -2
- package/dist/src/ui/components/ThemeDialog.js +5 -10
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/Tips.d.ts +1 -1
- package/dist/src/ui/components/Tips.js +1 -0
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/TodoDisplay.d.ts +1 -1
- package/dist/src/ui/components/TodoDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.js +1 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +11 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +42 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +2 -2
- package/dist/src/ui/components/messages/CompressionMessage.js +2 -1
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +6 -2
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +2 -1
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +1 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +2 -2
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +4 -3
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +79 -25
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +102 -2
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +4 -4
- package/dist/src/ui/components/messages/ToolGroupMessage.js +1 -6
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +259 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +3 -1
- package/dist/src/ui/components/messages/ToolMessage.js +16 -4
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +3 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +4 -2
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +1 -6
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.js +5 -49
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +20 -17
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -1
- package/dist/src/ui/components/subagents/create/ColorSelector.js +1 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/CreationSummary.js +2 -2
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -1
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -1
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/LocationSelector.js +2 -2
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +1 -1
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +1 -1
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +1 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +2 -2
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +1 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +1 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +1 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +2 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +1 -1
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +1 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +1 -1
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +16 -24
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -1
- package/dist/src/ui/components/subagents/reducers.d.ts +1 -1
- package/dist/src/ui/components/subagents/reducers.js +1 -0
- package/dist/src/ui/components/subagents/reducers.js.map +1 -1
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +4 -3
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +22 -12
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -1
- package/dist/src/ui/components/subagents/types.d.ts +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.d.ts +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.js +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.js.map +1 -1
- package/dist/src/ui/constants.d.ts +8 -0
- package/dist/src/ui/constants.js +9 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +4 -3
- package/dist/src/ui/contexts/KeypressContext.js +30 -47
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +184 -44
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/OverflowContext.d.ts +1 -1
- package/dist/src/ui/contexts/OverflowContext.js +0 -5
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +2 -2
- package/dist/src/ui/contexts/SessionContext.js +1 -6
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +1 -1
- package/dist/src/ui/contexts/StreamingContext.d.ts +1 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +1 -1
- package/dist/src/ui/contexts/VimModeContext.js +4 -4
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +3 -3
- package/dist/src/ui/hooks/atCommandProcessor.js +3 -4
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +16 -8
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +3 -3
- package/dist/src/ui/hooks/shellCommandProcessor.js +7 -6
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +5 -4
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -5
- package/dist/src/ui/hooks/slashCommandProcessor.js +11 -5
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js +3 -2
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +2 -2
- package/dist/src/ui/hooks/useAuthCommand.js +6 -5
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +4 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +16 -15
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +88 -16
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +8 -5
- package/dist/src/ui/hooks/useCommandCompletion.js +30 -9
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCompletion.js +1 -1
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +1 -1
- package/dist/src/ui/hooks/useEditorSettings.d.ts +2 -2
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +2 -1
- package/dist/src/ui/hooks/useFolderTrust.js +19 -10
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +9 -5
- package/dist/src/ui/hooks/useGeminiStream.js +87 -57
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +169 -233
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.d.ts +1 -1
- package/dist/src/ui/hooks/useKeypress.d.ts +2 -2
- package/dist/src/ui/hooks/useKeypress.js +1 -1
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/useLaunchEditor.js +2 -2
- package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -1
- package/dist/src/ui/hooks/useLogger.d.ts +2 -1
- package/dist/src/ui/hooks/useLogger.js +3 -3
- package/dist/src/ui/hooks/useLogger.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/usePromptCompletion.js +177 -0
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useQwenAuth.d.ts +1 -1
- package/dist/src/ui/hooks/useQwenAuth.js +1 -1
- package/dist/src/ui/hooks/useQwenAuth.js.map +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.js +5 -1
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +2 -2
- package/dist/src/ui/hooks/useReactToolScheduler.js +2 -3
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useShellHistory.d.ts +2 -1
- package/dist/src/ui/hooks/useShellHistory.js +9 -10
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.test.js +30 -5
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +3 -3
- package/dist/src/ui/hooks/useShowMemoryCommand.js +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +8 -8
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +41 -37
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +47 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.js +262 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +1 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.d.ts +6 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +515 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +1 -0
- package/dist/src/ui/hooks/useWelcomeBack.js +2 -1
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +13 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.js +53 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +2 -1
- package/dist/src/ui/keyMatchers.js +1 -1
- package/dist/src/ui/keyMatchers.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/models/availableModels.d.ts +29 -0
- package/dist/src/ui/models/availableModels.js +40 -0
- package/dist/src/ui/models/availableModels.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +1 -1
- package/dist/src/ui/semantic-colors.d.ts +1 -1
- package/dist/src/ui/textConstants.d.ts +9 -0
- package/dist/src/ui/textConstants.js +10 -0
- package/dist/src/ui/textConstants.js.map +1 -0
- package/dist/src/ui/themes/atom-one-dark.js +1 -2
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +1 -2
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +1 -2
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/default-light.js +1 -2
- package/dist/src/ui/themes/default-light.js.map +1 -1
- package/dist/src/ui/themes/default.js +1 -2
- package/dist/src/ui/themes/default.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +1 -2
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +1 -2
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +1 -2
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +2 -3
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +1 -2
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +4 -2
- package/dist/src/ui/themes/theme-manager.js +73 -6
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.js +60 -1
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +3 -3
- package/dist/src/ui/themes/theme.js +30 -2
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +1 -2
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +4 -2
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +2 -2
- package/dist/src/ui/utils/CodeColorizer.js +1 -1
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +1 -1
- package/dist/src/ui/utils/ConsolePatcher.js +1 -1
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +12 -2
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +4 -4
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +1 -1
- package/dist/src/ui/utils/commandUtils.js +52 -14
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +76 -21
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/computeStats.d.ts +1 -1
- package/dist/src/ui/utils/platformConstants.d.ts +7 -0
- package/dist/src/ui/utils/platformConstants.js +7 -0
- package/dist/src/ui/utils/platformConstants.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.js +5 -5
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +18 -0
- package/dist/src/ui/utils/textUtils.js +44 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.d.ts +1 -1
- package/dist/src/ui/utils/updateCheck.js +8 -2
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/cleanup.js +5 -4
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +2 -1
- package/dist/src/utils/dialogScopeUtils.js.map +1 -1
- package/dist/src/utils/errors.d.ts +6 -0
- package/dist/src/utils/errors.js +12 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/events.d.ts +1 -1
- package/dist/src/utils/events.js +1 -1
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/gitUtils.js +1 -1
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.test.js +4 -4
- package/dist/src/utils/gitUtils.test.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +4 -4
- package/dist/src/utils/handleAutoUpdate.js +4 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/installationInfo.js +8 -8
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +9 -9
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/package.js +2 -2
- package/dist/src/utils/package.js.map +1 -1
- package/dist/src/utils/readStdin.js +15 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/readStdin.test.d.ts +6 -0
- package/dist/src/utils/readStdin.test.js +88 -0
- package/dist/src/utils/readStdin.test.js.map +1 -0
- package/dist/src/utils/resolvePath.js +2 -2
- package/dist/src/utils/resolvePath.js.map +1 -1
- package/dist/src/utils/sandbox.d.ts +2 -2
- package/dist/src/utils/sandbox.js +20 -27
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +2 -2
- package/dist/src/utils/settingsUtils.js +2 -8
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/settingsUtils.test.js +145 -148
- package/dist/src/utils/settingsUtils.test.js.map +1 -1
- package/dist/src/utils/spawnWrapper.d.ts +1 -1
- package/dist/src/utils/spawnWrapper.js +1 -1
- package/dist/src/utils/spawnWrapper.js.map +1 -1
- package/dist/src/utils/startupWarnings.js +2 -2
- package/dist/src/utils/startupWarnings.js.map +1 -1
- package/dist/src/utils/updateEventEmitter.d.ts +1 -1
- package/dist/src/utils/updateEventEmitter.js +1 -1
- package/dist/src/utils/updateEventEmitter.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +3 -3
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.js +3 -3
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +1 -1
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.d.ts +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/fileSystemService.d.ts +2 -2
- package/dist/src/zed-integration/schema.d.ts +1732 -1732
- package/dist/src/zed-integration/zedIntegration.d.ts +4 -4
- package/dist/src/zed-integration/zedIntegration.js +43 -21
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -6
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { render } from 'ink-testing-library';
|
|
8
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
9
|
+
import { Text } from 'ink';
|
|
10
|
+
import { ToolGroupMessage } from './ToolGroupMessage.js';
|
|
11
|
+
import { ToolCallStatus } from '../../types.js';
|
|
12
|
+
import { TOOL_STATUS } from '../../constants.js';
|
|
13
|
+
// Mock child components to isolate ToolGroupMessage behavior
|
|
14
|
+
vi.mock('./ToolMessage.js', () => ({
|
|
15
|
+
ToolMessage: function MockToolMessage({ callId, name, description, status, emphasis, }) {
|
|
16
|
+
// Use the same constants as the real component
|
|
17
|
+
const statusSymbolMap = {
|
|
18
|
+
[ToolCallStatus.Success]: TOOL_STATUS.SUCCESS,
|
|
19
|
+
[ToolCallStatus.Pending]: TOOL_STATUS.PENDING,
|
|
20
|
+
[ToolCallStatus.Executing]: TOOL_STATUS.EXECUTING,
|
|
21
|
+
[ToolCallStatus.Confirming]: TOOL_STATUS.CONFIRMING,
|
|
22
|
+
[ToolCallStatus.Canceled]: TOOL_STATUS.CANCELED,
|
|
23
|
+
[ToolCallStatus.Error]: TOOL_STATUS.ERROR,
|
|
24
|
+
};
|
|
25
|
+
const statusSymbol = statusSymbolMap[status] || '?';
|
|
26
|
+
return (_jsxs(Text, { children: ["MockTool[", callId, "]: ", statusSymbol, " ", name, " - ", description, " (", emphasis, ")"] }));
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
vi.mock('./ToolConfirmationMessage.js', () => ({
|
|
30
|
+
ToolConfirmationMessage: function MockToolConfirmationMessage({ confirmationDetails, }) {
|
|
31
|
+
const displayText = confirmationDetails?.type === 'info'
|
|
32
|
+
? confirmationDetails.prompt
|
|
33
|
+
: confirmationDetails?.title || 'confirm';
|
|
34
|
+
return _jsxs(Text, { children: ["MockConfirmation: ", displayText] });
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
describe('<ToolGroupMessage />', () => {
|
|
38
|
+
const mockConfig = {};
|
|
39
|
+
const createToolCall = (overrides = {}) => ({
|
|
40
|
+
callId: 'tool-123',
|
|
41
|
+
name: 'test-tool',
|
|
42
|
+
description: 'A tool for testing',
|
|
43
|
+
resultDisplay: 'Test result',
|
|
44
|
+
status: ToolCallStatus.Success,
|
|
45
|
+
confirmationDetails: undefined,
|
|
46
|
+
renderOutputAsMarkdown: false,
|
|
47
|
+
...overrides,
|
|
48
|
+
});
|
|
49
|
+
const baseProps = {
|
|
50
|
+
groupId: 1,
|
|
51
|
+
terminalWidth: 80,
|
|
52
|
+
config: mockConfig,
|
|
53
|
+
isFocused: true,
|
|
54
|
+
};
|
|
55
|
+
describe('Golden Snapshots', () => {
|
|
56
|
+
it('renders single successful tool call', () => {
|
|
57
|
+
const toolCalls = [createToolCall()];
|
|
58
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
59
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
60
|
+
});
|
|
61
|
+
it('renders multiple tool calls with different statuses', () => {
|
|
62
|
+
const toolCalls = [
|
|
63
|
+
createToolCall({
|
|
64
|
+
callId: 'tool-1',
|
|
65
|
+
name: 'successful-tool',
|
|
66
|
+
description: 'This tool succeeded',
|
|
67
|
+
status: ToolCallStatus.Success,
|
|
68
|
+
}),
|
|
69
|
+
createToolCall({
|
|
70
|
+
callId: 'tool-2',
|
|
71
|
+
name: 'pending-tool',
|
|
72
|
+
description: 'This tool is pending',
|
|
73
|
+
status: ToolCallStatus.Pending,
|
|
74
|
+
}),
|
|
75
|
+
createToolCall({
|
|
76
|
+
callId: 'tool-3',
|
|
77
|
+
name: 'error-tool',
|
|
78
|
+
description: 'This tool failed',
|
|
79
|
+
status: ToolCallStatus.Error,
|
|
80
|
+
}),
|
|
81
|
+
];
|
|
82
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
83
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
84
|
+
});
|
|
85
|
+
it('renders tool call awaiting confirmation', () => {
|
|
86
|
+
const toolCalls = [
|
|
87
|
+
createToolCall({
|
|
88
|
+
callId: 'tool-confirm',
|
|
89
|
+
name: 'confirmation-tool',
|
|
90
|
+
description: 'This tool needs confirmation',
|
|
91
|
+
status: ToolCallStatus.Confirming,
|
|
92
|
+
confirmationDetails: {
|
|
93
|
+
type: 'info',
|
|
94
|
+
title: 'Confirm Tool Execution',
|
|
95
|
+
prompt: 'Are you sure you want to proceed?',
|
|
96
|
+
onConfirm: vi.fn(),
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
];
|
|
100
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
101
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
102
|
+
});
|
|
103
|
+
it('renders shell command with yellow border', () => {
|
|
104
|
+
const toolCalls = [
|
|
105
|
+
createToolCall({
|
|
106
|
+
callId: 'shell-1',
|
|
107
|
+
name: 'run_shell_command',
|
|
108
|
+
description: 'Execute shell command',
|
|
109
|
+
status: ToolCallStatus.Success,
|
|
110
|
+
}),
|
|
111
|
+
];
|
|
112
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
113
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
114
|
+
});
|
|
115
|
+
it('renders mixed tool calls including shell command', () => {
|
|
116
|
+
const toolCalls = [
|
|
117
|
+
createToolCall({
|
|
118
|
+
callId: 'tool-1',
|
|
119
|
+
name: 'read_file',
|
|
120
|
+
description: 'Read a file',
|
|
121
|
+
status: ToolCallStatus.Success,
|
|
122
|
+
}),
|
|
123
|
+
createToolCall({
|
|
124
|
+
callId: 'tool-2',
|
|
125
|
+
name: 'run_shell_command',
|
|
126
|
+
description: 'Run command',
|
|
127
|
+
status: ToolCallStatus.Executing,
|
|
128
|
+
}),
|
|
129
|
+
createToolCall({
|
|
130
|
+
callId: 'tool-3',
|
|
131
|
+
name: 'write_file',
|
|
132
|
+
description: 'Write to file',
|
|
133
|
+
status: ToolCallStatus.Pending,
|
|
134
|
+
}),
|
|
135
|
+
];
|
|
136
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
137
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
138
|
+
});
|
|
139
|
+
it('renders with limited terminal height', () => {
|
|
140
|
+
const toolCalls = [
|
|
141
|
+
createToolCall({
|
|
142
|
+
callId: 'tool-1',
|
|
143
|
+
name: 'tool-with-result',
|
|
144
|
+
description: 'Tool with output',
|
|
145
|
+
resultDisplay: 'This is a long result that might need height constraints',
|
|
146
|
+
}),
|
|
147
|
+
createToolCall({
|
|
148
|
+
callId: 'tool-2',
|
|
149
|
+
name: 'another-tool',
|
|
150
|
+
description: 'Another tool',
|
|
151
|
+
resultDisplay: 'More output here',
|
|
152
|
+
}),
|
|
153
|
+
];
|
|
154
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls, availableTerminalHeight: 10 }));
|
|
155
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
156
|
+
});
|
|
157
|
+
it('renders when not focused', () => {
|
|
158
|
+
const toolCalls = [createToolCall()];
|
|
159
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls, isFocused: false }));
|
|
160
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
161
|
+
});
|
|
162
|
+
it('renders with narrow terminal width', () => {
|
|
163
|
+
const toolCalls = [
|
|
164
|
+
createToolCall({
|
|
165
|
+
name: 'very-long-tool-name-that-might-wrap',
|
|
166
|
+
description: 'This is a very long description that might cause wrapping issues',
|
|
167
|
+
}),
|
|
168
|
+
];
|
|
169
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls, terminalWidth: 40 }));
|
|
170
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
171
|
+
});
|
|
172
|
+
it('renders empty tool calls array', () => {
|
|
173
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: [] }));
|
|
174
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
describe('Border Color Logic', () => {
|
|
178
|
+
it('uses yellow border when tools are pending', () => {
|
|
179
|
+
const toolCalls = [createToolCall({ status: ToolCallStatus.Pending })];
|
|
180
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
181
|
+
// The snapshot will capture the visual appearance including border color
|
|
182
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
183
|
+
});
|
|
184
|
+
it('uses yellow border for shell commands even when successful', () => {
|
|
185
|
+
const toolCalls = [
|
|
186
|
+
createToolCall({
|
|
187
|
+
name: 'run_shell_command',
|
|
188
|
+
status: ToolCallStatus.Success,
|
|
189
|
+
}),
|
|
190
|
+
];
|
|
191
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
192
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
193
|
+
});
|
|
194
|
+
it('uses gray border when all tools are successful and no shell commands', () => {
|
|
195
|
+
const toolCalls = [
|
|
196
|
+
createToolCall({ status: ToolCallStatus.Success }),
|
|
197
|
+
createToolCall({
|
|
198
|
+
callId: 'tool-2',
|
|
199
|
+
name: 'another-tool',
|
|
200
|
+
status: ToolCallStatus.Success,
|
|
201
|
+
}),
|
|
202
|
+
];
|
|
203
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
204
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
describe('Height Calculation', () => {
|
|
208
|
+
it('calculates available height correctly with multiple tools with results', () => {
|
|
209
|
+
const toolCalls = [
|
|
210
|
+
createToolCall({
|
|
211
|
+
callId: 'tool-1',
|
|
212
|
+
resultDisplay: 'Result 1',
|
|
213
|
+
}),
|
|
214
|
+
createToolCall({
|
|
215
|
+
callId: 'tool-2',
|
|
216
|
+
resultDisplay: 'Result 2',
|
|
217
|
+
}),
|
|
218
|
+
createToolCall({
|
|
219
|
+
callId: 'tool-3',
|
|
220
|
+
resultDisplay: '', // No result
|
|
221
|
+
}),
|
|
222
|
+
];
|
|
223
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls, availableTerminalHeight: 20 }));
|
|
224
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe('Confirmation Handling', () => {
|
|
228
|
+
it('shows confirmation dialog for first confirming tool only', () => {
|
|
229
|
+
const toolCalls = [
|
|
230
|
+
createToolCall({
|
|
231
|
+
callId: 'tool-1',
|
|
232
|
+
name: 'first-confirm',
|
|
233
|
+
status: ToolCallStatus.Confirming,
|
|
234
|
+
confirmationDetails: {
|
|
235
|
+
type: 'info',
|
|
236
|
+
title: 'Confirm First Tool',
|
|
237
|
+
prompt: 'Confirm first tool',
|
|
238
|
+
onConfirm: vi.fn(),
|
|
239
|
+
},
|
|
240
|
+
}),
|
|
241
|
+
createToolCall({
|
|
242
|
+
callId: 'tool-2',
|
|
243
|
+
name: 'second-confirm',
|
|
244
|
+
status: ToolCallStatus.Confirming,
|
|
245
|
+
confirmationDetails: {
|
|
246
|
+
type: 'info',
|
|
247
|
+
title: 'Confirm Second Tool',
|
|
248
|
+
prompt: 'Confirm second tool',
|
|
249
|
+
onConfirm: vi.fn(),
|
|
250
|
+
},
|
|
251
|
+
}),
|
|
252
|
+
];
|
|
253
|
+
const { lastFrame } = render(_jsx(ToolGroupMessage, { ...baseProps, toolCalls: toolCalls }));
|
|
254
|
+
// Should only show confirmation for the first tool
|
|
255
|
+
expect(lastFrame()).toMatchSnapshot();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
//# sourceMappingURL=ToolGroupMessage.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolGroupMessage.test.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolGroupMessage.test.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAkC,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,6DAA6D;AAC7D,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjC,WAAW,EAAE,SAAS,eAAe,CAAC,EACpC,MAAM,EACN,IAAI,EACJ,WAAW,EACX,MAAM,EACN,QAAQ,GAOT;QACC,+CAA+C;QAC/C,MAAM,eAAe,GAAmC;YACtD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO;YAC7C,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO;YAC7C,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,SAAS;YACjD,CAAC,cAAc,CAA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from '../../types.js';
|
|
7
|
+
import type { IndividualToolCallDisplay } from '../../types.js';
|
|
8
|
+
import type { Config } from '@umsai/ums-code-core';
|
|
8
9
|
export type TextEmphasis = 'high' | 'medium' | 'low';
|
|
9
10
|
export interface ToolMessageProps extends IndividualToolCallDisplay {
|
|
10
11
|
availableTerminalHeight?: number;
|
|
11
12
|
terminalWidth: number;
|
|
12
13
|
emphasis?: TextEmphasis;
|
|
13
14
|
renderOutputAsMarkdown?: boolean;
|
|
15
|
+
config: Config;
|
|
14
16
|
}
|
|
15
17
|
export declare const ToolMessage: React.FC<ToolMessageProps>;
|
|
@@ -13,7 +13,9 @@ import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js';
|
|
|
13
13
|
import { GeminiRespondingSpinner } from '../GeminiRespondingSpinner.js';
|
|
14
14
|
import { MaxSizedBox } from '../shared/MaxSizedBox.js';
|
|
15
15
|
import { TodoDisplay } from '../TodoDisplay.js';
|
|
16
|
+
import { TOOL_STATUS } from '../../constants.js';
|
|
16
17
|
import { AgentExecutionDisplay } from '../subagents/index.js';
|
|
18
|
+
import { PlanSummaryDisplay } from '../PlanSummaryDisplay.js';
|
|
17
19
|
const STATIC_HEIGHT = 1;
|
|
18
20
|
const RESERVED_LINE_COUNT = 5; // for tool name, status, padding etc.
|
|
19
21
|
const STATUS_INDICATOR_WIDTH = 3;
|
|
@@ -38,6 +40,15 @@ const useResultDisplayRenderer = (resultDisplay) => React.useMemo(() => {
|
|
|
38
40
|
data: resultDisplay,
|
|
39
41
|
};
|
|
40
42
|
}
|
|
43
|
+
if (typeof resultDisplay === 'object' &&
|
|
44
|
+
resultDisplay !== null &&
|
|
45
|
+
'type' in resultDisplay &&
|
|
46
|
+
resultDisplay.type === 'plan_summary') {
|
|
47
|
+
return {
|
|
48
|
+
type: 'plan',
|
|
49
|
+
data: resultDisplay,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
41
52
|
// Check for SubagentExecutionResultDisplay (for non-task tools)
|
|
42
53
|
if (typeof resultDisplay === 'object' &&
|
|
43
54
|
resultDisplay !== null &&
|
|
@@ -67,10 +78,11 @@ const useResultDisplayRenderer = (resultDisplay) => React.useMemo(() => {
|
|
|
67
78
|
* Component to render todo list results
|
|
68
79
|
*/
|
|
69
80
|
const TodoResultRenderer = ({ data, }) => _jsx(TodoDisplay, { todos: data.todos });
|
|
81
|
+
const PlanResultRenderer = ({ data, availableHeight, childWidth }) => (_jsx(PlanSummaryDisplay, { data: data, availableHeight: availableHeight, childWidth: childWidth }));
|
|
70
82
|
/**
|
|
71
83
|
* Component to render subagent execution results
|
|
72
84
|
*/
|
|
73
|
-
const SubagentExecutionRenderer = ({ data, availableHeight, childWidth }) => (_jsx(AgentExecutionDisplay, { data: data, availableHeight: availableHeight, childWidth: childWidth }));
|
|
85
|
+
const SubagentExecutionRenderer = ({ data, availableHeight, childWidth, config }) => (_jsx(AgentExecutionDisplay, { data: data, availableHeight: availableHeight, childWidth: childWidth, config: config }));
|
|
74
86
|
/**
|
|
75
87
|
* Component to render string results (markdown or plain text)
|
|
76
88
|
*/
|
|
@@ -89,7 +101,7 @@ const StringResultRenderer = ({ data, renderAsMarkdown, availableHeight, childWi
|
|
|
89
101
|
* Component to render diff results
|
|
90
102
|
*/
|
|
91
103
|
const DiffResultRenderer = ({ data, availableHeight, childWidth }) => (_jsx(DiffRenderer, { diffContent: data.fileDiff, filename: data.fileName, availableTerminalHeight: availableHeight, terminalWidth: childWidth }));
|
|
92
|
-
export const ToolMessage = ({ name, description, resultDisplay, status, availableTerminalHeight, terminalWidth, emphasis = 'medium', renderOutputAsMarkdown = true, }) => {
|
|
104
|
+
export const ToolMessage = ({ name, description, resultDisplay, status, availableTerminalHeight, terminalWidth, emphasis = 'medium', renderOutputAsMarkdown = true, config, }) => {
|
|
93
105
|
const availableHeight = availableTerminalHeight
|
|
94
106
|
? Math.max(availableTerminalHeight - STATIC_HEIGHT - RESERVED_LINE_COUNT, MIN_LINES_SHOWN + 1)
|
|
95
107
|
: undefined;
|
|
@@ -102,9 +114,9 @@ export const ToolMessage = ({ name, description, resultDisplay, status, availabl
|
|
|
102
114
|
const childWidth = terminalWidth - 3; // account for padding.
|
|
103
115
|
// Use the custom hook to determine the display type
|
|
104
116
|
const displayRenderer = useResultDisplayRenderer(resultDisplay);
|
|
105
|
-
return (_jsxs(Box, { paddingX: 1, paddingY: 0, flexDirection: "column", children: [_jsxs(Box, { minHeight: 1, children: [_jsx(ToolStatusIndicator, { status: status }), _jsx(ToolInfo, { name: name, status: status, description: description, emphasis: emphasis }), emphasis === 'high' && _jsx(TrailingIndicator, {})] }), displayRenderer.type !== 'none' && (_jsx(Box, { paddingLeft: STATUS_INDICATOR_WIDTH, width: "100%", marginTop: 1, children: _jsxs(Box, { flexDirection: "column", children: [displayRenderer.type === 'todo' && (_jsx(TodoResultRenderer, { data: displayRenderer.data })), displayRenderer.type === 'task' && (_jsx(SubagentExecutionRenderer, { data: displayRenderer.data, availableHeight: availableHeight, childWidth: childWidth })), displayRenderer.type === 'string' && (_jsx(StringResultRenderer, { data: displayRenderer.data, renderAsMarkdown: renderOutputAsMarkdown, availableHeight: availableHeight, childWidth: childWidth })), displayRenderer.type === 'diff' && (_jsx(DiffResultRenderer, { data: displayRenderer.data, availableHeight: availableHeight, childWidth: childWidth }))] }) }))] }));
|
|
117
|
+
return (_jsxs(Box, { paddingX: 1, paddingY: 0, flexDirection: "column", children: [_jsxs(Box, { minHeight: 1, children: [_jsx(ToolStatusIndicator, { status: status }), _jsx(ToolInfo, { name: name, status: status, description: description, emphasis: emphasis }), emphasis === 'high' && _jsx(TrailingIndicator, {})] }), displayRenderer.type !== 'none' && (_jsx(Box, { paddingLeft: STATUS_INDICATOR_WIDTH, width: "100%", marginTop: 1, children: _jsxs(Box, { flexDirection: "column", children: [displayRenderer.type === 'todo' && (_jsx(TodoResultRenderer, { data: displayRenderer.data })), displayRenderer.type === 'plan' && (_jsx(PlanResultRenderer, { data: displayRenderer.data, availableHeight: availableHeight, childWidth: childWidth })), displayRenderer.type === 'task' && (_jsx(SubagentExecutionRenderer, { data: displayRenderer.data, availableHeight: availableHeight, childWidth: childWidth, config: config })), displayRenderer.type === 'string' && (_jsx(StringResultRenderer, { data: displayRenderer.data, renderAsMarkdown: renderOutputAsMarkdown, availableHeight: availableHeight, childWidth: childWidth })), displayRenderer.type === 'diff' && (_jsx(DiffResultRenderer, { data: displayRenderer.data, availableHeight: availableHeight, childWidth: childWidth }))] }) }))] }));
|
|
106
118
|
};
|
|
107
|
-
const ToolStatusIndicator = ({ status, }) => (_jsxs(Box, { minWidth: STATUS_INDICATOR_WIDTH, children: [status === ToolCallStatus.Pending && (_jsx(Text, { color: Colors.AccentGreen, children:
|
|
119
|
+
const ToolStatusIndicator = ({ status, }) => (_jsxs(Box, { minWidth: STATUS_INDICATOR_WIDTH, children: [status === ToolCallStatus.Pending && (_jsx(Text, { color: Colors.AccentGreen, children: TOOL_STATUS.PENDING })), status === ToolCallStatus.Executing && (_jsx(GeminiRespondingSpinner, { spinnerType: "toggle", nonRespondingDisplay: TOOL_STATUS.EXECUTING })), status === ToolCallStatus.Success && (_jsx(Text, { color: Colors.AccentGreen, "aria-label": 'Success:', children: TOOL_STATUS.SUCCESS })), status === ToolCallStatus.Confirming && (_jsx(Text, { color: Colors.AccentYellow, "aria-label": 'Confirming:', children: TOOL_STATUS.CONFIRMING })), status === ToolCallStatus.Canceled && (_jsx(Text, { color: Colors.AccentYellow, "aria-label": 'Canceled:', bold: true, children: TOOL_STATUS.CANCELED })), status === ToolCallStatus.Error && (_jsx(Text, { color: Colors.AccentRed, "aria-label": 'Error:', bold: true, children: TOOL_STATUS.ERROR }))] }));
|
|
108
120
|
const ToolInfo = ({ name, description, status, emphasis, }) => {
|
|
109
121
|
const nameColor = React.useMemo(() => {
|
|
110
122
|
switch (emphasis) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolMessage.tsx"],"names":[],"mappings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,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,CACL,KAAC,GAAG,cACF,MAAC,IAAI,IACH,IAAI,EAAC,cAAc,EACnB,aAAa,EAAE,MAAM,KAAK,cAAc,CAAC,QAAQ,aAEjD,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,EAAE,IAAI,kBACzB,IAAI,GACA,EACP,KAAC,IAAI,oBAAS,EACd,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,WAAW,GAAQ,IACzC,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAa,GAAG,EAAE,CAAC,CACxC,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAC,UAAU,aAC5C,GAAG,cAEC,CACR,CAAC"}
|
|
@@ -41,6 +41,7 @@ const renderWithContext = (ui, streamingState) => {
|
|
|
41
41
|
return render(_jsx(StreamingContext.Provider, { value: contextValue, children: ui }));
|
|
42
42
|
};
|
|
43
43
|
describe('<ToolMessage />', () => {
|
|
44
|
+
const mockConfig = {};
|
|
44
45
|
const baseProps = {
|
|
45
46
|
callId: 'tool-123',
|
|
46
47
|
name: 'test-tool',
|
|
@@ -50,6 +51,7 @@ describe('<ToolMessage />', () => {
|
|
|
50
51
|
terminalWidth: 80,
|
|
51
52
|
confirmationDetails: undefined,
|
|
52
53
|
emphasis: 'medium',
|
|
54
|
+
config: mockConfig,
|
|
53
55
|
};
|
|
54
56
|
it('renders basic tool information', () => {
|
|
55
57
|
const { lastFrame } = renderWithContext(_jsx(ToolMessage, { ...baseProps }), StreamingState.Idle);
|
|
@@ -135,6 +137,7 @@ describe('<ToolMessage />', () => {
|
|
|
135
137
|
terminalWidth: 80,
|
|
136
138
|
callId: 'test-call-id-2',
|
|
137
139
|
confirmationDetails: undefined,
|
|
140
|
+
config: mockConfig,
|
|
138
141
|
};
|
|
139
142
|
const { lastFrame } = renderWithContext(_jsx(ToolMessage, { ...props }), StreamingState.Responding);
|
|
140
143
|
const output = lastFrame();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolMessage.test.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolMessage.test.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolMessage.test.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolMessage.test.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,8EAA8E;AAC9E,EAAE,CAAC,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9C,uBAAuB,EAAE,CAAC,EACxB,oBAAoB,GAGrB,EAAE,EAAE;QACH,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAE,CAAC;QAC3D,IAAI,cAAc,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;YACjD,OAAO,KAAC,IAAI,wCAA6B,CAAC;QAC5C,CAAC;QACD,OAAO,oBAAoB,CAAC,CAAC,CAAC,KAAC,IAAI,cAAE,oBAAoB,GAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC,CAAC;AACJ,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAA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,CACrC,KAAC,WAAW,OAAK,KAAK,GAAI,EAC1B,cAAc,CAAC,UAAU,CAC1B,CAAC;QAEF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,yCAAyC;QACzE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,uBAAuB;QAChE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC,CAAC,0BAA0B;IAC3F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, Box } from 'ink';
|
|
3
3
|
import { Colors } from '../../colors.js';
|
|
4
|
+
import { SCREEN_READER_USER_PREFIX } from '../../textConstants.js';
|
|
5
|
+
import { isSlashCommand as checkIsSlashCommand } from '../../utils/commandUtils.js';
|
|
4
6
|
export const UserMessage = ({ text }) => {
|
|
5
7
|
const prefix = '> ';
|
|
6
8
|
const prefixWidth = prefix.length;
|
|
7
|
-
const isSlashCommand = text
|
|
9
|
+
const isSlashCommand = checkIsSlashCommand(text);
|
|
8
10
|
const textColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray;
|
|
9
11
|
const borderColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray;
|
|
10
|
-
return (_jsxs(Box, { borderStyle: "round", borderColor: borderColor, flexDirection: "row", paddingX: 2, paddingY: 0, marginY: 1, alignSelf: "flex-start", children: [_jsx(Box, { width: prefixWidth, children: _jsx(Text, { color: textColor, children: prefix }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { wrap: "wrap", color: textColor, children: text }) })] }));
|
|
12
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: borderColor, flexDirection: "row", paddingX: 2, paddingY: 0, marginY: 1, alignSelf: "flex-start", children: [_jsx(Box, { width: prefixWidth, children: _jsx(Text, { color: textColor, "aria-label": SCREEN_READER_USER_PREFIX, children: prefix }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { wrap: "wrap", color: textColor, children: text }) })] }));
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=UserMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/UserMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/UserMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAMpF,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,MAAM,cAAc,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IACrE,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAEvE,OAAO,CACL,MAAC,GAAG,IACF,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAC,KAAK,EACnB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,CAAC,EACV,SAAS,EAAC,YAAY,aAEtB,KAAC,GAAG,IAAC,KAAK,EAAE,WAAW,YACrB,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,gBAAc,yBAAyB,YAC1D,MAAM,GACF,GACH,EACN,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,YAC/B,IAAI,GACA,GACH,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import type React from 'react';
|
|
7
7
|
/**
|
|
8
8
|
* Represents a single option for the RadioButtonSelect.
|
|
9
9
|
* Requires a label for display and a value to be returned on selection.
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
2
|
import { useEffect, useState, useRef } from 'react';
|
|
8
3
|
import { Text, Box } from 'ink';
|
|
9
4
|
import { Colors } from '../../colors.js';
|
|
@@ -113,7 +108,7 @@ export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlig
|
|
|
113
108
|
}
|
|
114
109
|
const numberColumnWidth = String(items.length).length;
|
|
115
110
|
const itemNumberText = `${String(itemIndex + 1).padStart(numberColumnWidth)}.`;
|
|
116
|
-
return (_jsxs(Box, { alignItems: "center", children: [_jsx(Box, { minWidth: 2, flexShrink: 0, children: _jsx(Text, { color: isSelected ? Colors.AccentGreen : Colors.Foreground, children: isSelected ? '●' : ' ' }) }), _jsx(Box, { marginRight: 1, flexShrink: 0, minWidth: itemNumberText.length, children: _jsx(Text, { color: numberColor, children: itemNumberText }) }), item.themeNameDisplay && item.themeTypeDisplay ? (_jsxs(Text, { color: textColor, wrap: "truncate", children: [item.themeNameDisplay, ' ', _jsx(Text, { color: Colors.Gray, children: item.themeTypeDisplay })] })) : (_jsx(Text, { color: textColor, wrap: "truncate", children: item.label }))] }, item.label));
|
|
111
|
+
return (_jsxs(Box, { alignItems: "center", children: [_jsx(Box, { minWidth: 2, flexShrink: 0, children: _jsx(Text, { color: isSelected ? Colors.AccentGreen : Colors.Foreground, "aria-hidden": true, children: isSelected ? '●' : ' ' }) }), _jsx(Box, { marginRight: 1, flexShrink: 0, minWidth: itemNumberText.length, "aria-state": { checked: isSelected }, children: _jsx(Text, { color: numberColor, children: itemNumberText }) }), item.themeNameDisplay && item.themeTypeDisplay ? (_jsxs(Text, { color: textColor, wrap: "truncate", children: [item.themeNameDisplay, ' ', _jsx(Text, { color: Colors.Gray, children: item.themeTypeDisplay })] })) : (_jsx(Text, { color: textColor, wrap: "truncate", children: item.label }))] }, item.label));
|
|
117
112
|
}), showScrollArrows && (_jsx(Text, { color: scrollOffset + maxItemsToShow < items.length
|
|
118
113
|
? Colors.Foreground
|
|
119
114
|
: Colors.Gray, children: "\u25BC" }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtonSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/RadioButtonSelect.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RadioButtonSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/RadioButtonSelect.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,GAA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AAC,CAAC,MAAM,CAAC,UAAU;oBACnB,CAAC,CAAC,MAAM,CAAC,IAAI,uBAIZ,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import os from 'os';
|
|
11
|
-
import pathMod from 'path';
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import os from 'node:os';
|
|
9
|
+
import pathMod from 'node:path';
|
|
12
10
|
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
|
13
11
|
import stringWidth from 'string-width';
|
|
14
12
|
import { unescapePath } from '@umsai/ums-code-core';
|
|
15
|
-
import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
|
|
13
|
+
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, } from '../../utils/textUtils.js';
|
|
16
14
|
import { handleVimAction } from './vim-buffer-actions.js';
|
|
17
15
|
// Simple helper for word‑wise ops.
|
|
18
16
|
function isWordChar(ch) {
|
|
@@ -373,48 +371,6 @@ export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol,
|
|
|
373
371
|
preferredCol: null,
|
|
374
372
|
};
|
|
375
373
|
};
|
|
376
|
-
/**
|
|
377
|
-
* Strip characters that can break terminal rendering.
|
|
378
|
-
*
|
|
379
|
-
* Uses Node.js built-in stripVTControlCharacters to handle VT sequences,
|
|
380
|
-
* then filters remaining control characters that can disrupt display.
|
|
381
|
-
*
|
|
382
|
-
* Characters stripped:
|
|
383
|
-
* - ANSI escape sequences (via strip-ansi)
|
|
384
|
-
* - VT control sequences (via Node.js util.stripVTControlCharacters)
|
|
385
|
-
* - C0 control chars (0x00-0x1F) except CR/LF which are handled elsewhere
|
|
386
|
-
* - C1 control chars (0x80-0x9F) that can cause display issues
|
|
387
|
-
*
|
|
388
|
-
* Characters preserved:
|
|
389
|
-
* - All printable Unicode including emojis
|
|
390
|
-
* - DEL (0x7F) - handled functionally by applyOperations, not a display issue
|
|
391
|
-
* - CR/LF (0x0D/0x0A) - needed for line breaks
|
|
392
|
-
*/
|
|
393
|
-
function stripUnsafeCharacters(str) {
|
|
394
|
-
const strippedAnsi = stripAnsi(str);
|
|
395
|
-
const strippedVT = stripVTControlCharacters(strippedAnsi);
|
|
396
|
-
return toCodePoints(strippedVT)
|
|
397
|
-
.filter((char) => {
|
|
398
|
-
const code = char.codePointAt(0);
|
|
399
|
-
if (code === undefined)
|
|
400
|
-
return false;
|
|
401
|
-
// Preserve CR/LF for line handling
|
|
402
|
-
if (code === 0x0a || code === 0x0d)
|
|
403
|
-
return true;
|
|
404
|
-
// Remove C0 control chars (except CR/LF) that can break display
|
|
405
|
-
// Examples: BELL(0x07) makes noise, BS(0x08) moves cursor, VT(0x0B), FF(0x0C)
|
|
406
|
-
if (code >= 0x00 && code <= 0x1f)
|
|
407
|
-
return false;
|
|
408
|
-
// Remove C1 control chars (0x80-0x9F) - legacy 8-bit control codes
|
|
409
|
-
if (code >= 0x80 && code <= 0x9f)
|
|
410
|
-
return false;
|
|
411
|
-
// Preserve DEL (0x7F) - it's handled functionally by applyOperations as backspace
|
|
412
|
-
// and doesn't cause rendering issues when displayed
|
|
413
|
-
// Preserve all other characters including Unicode/emojis
|
|
414
|
-
return true;
|
|
415
|
-
})
|
|
416
|
-
.join('');
|
|
417
|
-
}
|
|
418
374
|
function clamp(v, min, max) {
|
|
419
375
|
return v < min ? min : v > max ? max : v;
|
|
420
376
|
}
|