@umsai/ums-code 0.0.14-v1 → 0.0.14-v2
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 +10 -7
- 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.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +167 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +110 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +44 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +23 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/config/auth.js +13 -12
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.d.ts +6 -0
- package/dist/src/config/auth.test.js +57 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/config.d.ts +11 -9
- package/dist/src/config/config.js +257 -133
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +41 -3
- package/dist/src/config/extension.js +277 -18
- 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.d.ts +66 -0
- package/dist/src/config/keyBindings.js +141 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/keyBindings.test.d.ts +6 -0
- package/dist/src/config/keyBindings.test.js +51 -0
- package/dist/src/config/keyBindings.test.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +2 -2
- package/dist/src/config/sandboxConfig.js +8 -10
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +14 -69
- package/dist/src/config/settings.js +425 -94
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +884 -0
- package/dist/src/config/settingsSchema.js +857 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/config/settingsSchema.test.d.ts +6 -0
- package/dist/src/config/settingsSchema.test.js +194 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +37 -0
- package/dist/src/config/trustedFolders.js +118 -0
- package/dist/src/config/trustedFolders.js.map +1 -0
- package/dist/src/config/trustedFolders.test.d.ts +6 -0
- package/dist/src/config/trustedFolders.test.js +164 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- package/dist/src/gemini.d.ts +3 -1
- package/dist/src/gemini.js +118 -99
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +247 -0
- package/dist/src/gemini.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +2 -1
- package/dist/src/generated/git-commit.js +2 -1
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +1 -1
- package/dist/src/nonInteractiveCli.js +26 -42
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +3 -4
- package/dist/src/services/BuiltinCommandLoader.js +15 -4
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
- package/dist/src/services/BuiltinCommandLoader.test.js +130 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +2 -2
- package/dist/src/services/CommandService.test.d.ts +6 -0
- package/dist/src/services/CommandService.test.js +233 -0
- package/dist/src/services/CommandService.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +3 -3
- package/dist/src/services/FileCommandLoader.js +31 -19
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.d.ts +14 -4
- package/dist/src/services/McpPromptLoader.js +46 -20
- 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 +5 -10
- package/dist/src/services/prompt-processors/argumentProcessor.js +5 -12
- 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 +11 -16
- package/dist/src/services/prompt-processors/shellProcessor.js +85 -41
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/types.d.ts +15 -8
- package/dist/src/services/prompt-processors/types.js +6 -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.d.ts +14 -0
- package/dist/src/test-utils/customMatchers.js +40 -0
- package/dist/src/test-utils/customMatchers.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
- package/dist/src/test-utils/mockCommandContext.js +90 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
- package/dist/src/test-utils/mockCommandContext.test.js +51 -0
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +8 -0
- package/dist/src/test-utils/render.js +10 -0
- package/dist/src/test-utils/render.js.map +1 -0
- package/dist/src/ui/App.d.ts +2 -2
- package/dist/src/ui/App.js +342 -70
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +52 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- 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 +10 -6
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
- package/dist/src/ui/commands/agentsCommand.js +32 -0
- package/dist/src/ui/commands/agentsCommand.js.map +1 -0
- 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/bugCommand.js +13 -5
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +1 -1
- package/dist/src/ui/commands/chatCommand.js +27 -9
- 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 +0 -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 +7 -8
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/docsCommand.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 +92 -22
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.d.ts +2 -2
- package/dist/src/ui/commands/initCommand.js +20 -10
- 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 +12 -8
- 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 +143 -9
- 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/quitCommand.d.ts +1 -0
- package/dist/src/ui/commands/quitCommand.js +25 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +1 -1
- package/dist/src/ui/commands/restoreCommand.js +4 -8
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +16 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.d.ts +3 -1
- package/dist/src/ui/commands/setupGithubCommand.js +133 -27
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js +167 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.d.ts +7 -0
- package/dist/src/ui/commands/summaryCommand.js +149 -0
- package/dist/src/ui/commands/summaryCommand.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
- package/dist/src/ui/commands/terminalSetupCommand.js +41 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
- 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 +26 -11
- 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 +54 -20
- package/dist/src/ui/commands/ums/umsInitCommand.js.map +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 +2 -1
- package/dist/src/ui/components/AboutBox.js +1 -1
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +1 -0
- package/dist/src/ui/components/AsciiArt.js +8 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.d.ts +2 -2
- package/dist/src/ui/components/AuthDialog.js +23 -22
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/components/AuthDialog.test.js +280 -0
- package/dist/src/ui/components/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/components/AuthInProgress.d.ts +1 -1
- package/dist/src/ui/components/AuthInProgress.js +6 -10
- 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 +23 -25
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +9 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +14 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.js +5 -4
- package/dist/src/ui/components/DebugProfiler.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 +14 -16
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
- package/dist/src/ui/components/FolderTrustDialog.js +45 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js +63 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +2 -1
- package/dist/src/ui/components/Footer.js +16 -6
- package/dist/src/ui/components/Footer.js.map +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 -2
- package/dist/src/ui/components/Header.js +13 -5
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Header.test.d.ts +6 -0
- package/dist/src/ui/components/Header.test.js +37 -0
- package/dist/src/ui/components/Header.test.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +2 -2
- package/dist/src/ui/components/Help.js +2 -2
- 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 +5 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js +93 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +6 -5
- package/dist/src/ui/components/InputPrompt.js +238 -53
- 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/LoadingIndicator.js +10 -5
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/LoadingIndicator.test.js +190 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- 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/OpenAIKeyPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +44 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -0
- 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 +17 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js +44 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -0
- 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/QwenOAuthProgress.test.d.ts +6 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js +292 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +15 -0
- package/dist/src/ui/components/SettingsDialog.js +550 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsDialog.test.js +646 -0
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +8 -6
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +40 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
- 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 +9 -8
- 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 +14 -29
- 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 +16 -0
- package/dist/src/ui/components/TodoDisplay.js +27 -0
- package/dist/src/ui/components/TodoDisplay.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/TodoDisplay.test.js +77 -0
- package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +13 -0
- package/dist/src/ui/components/WelcomeBackDialog.js +32 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
- 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 +16 -3
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js +239 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
- 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/InfoMessage.js +6 -1
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/SummaryMessage.js +35 -0
- package/dist/src/ui/components/messages/SummaryMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +4 -3
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +111 -35
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +137 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +4 -4
- package/dist/src/ui/components/messages/ToolGroupMessage.js +2 -7
- 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 +88 -11
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js +149 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
- 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/MaxSizedBox.js +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +12 -15
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +111 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.d.ts +16 -0
- package/dist/src/ui/components/shared/TextInput.js +127 -0
- package/dist/src/ui/components/shared/TextInput.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +17 -4
- package/dist/src/ui/components/shared/text-buffer.js +235 -97
- 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 +139 -152
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/components/subagents/constants.d.ts +23 -0
- package/dist/src/ui/components/subagents/constants.js +67 -0
- package/dist/src/ui/components/subagents/constants.js.map +1 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +174 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js +42 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js +163 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +105 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +33 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js +33 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +26 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +28 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +16 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js +143 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/index.d.ts +8 -0
- package/dist/src/ui/components/subagents/index.js +12 -0
- package/dist/src/ui/components/subagents/index.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +46 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +33 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +63 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +12 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +225 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +11 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +19 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +212 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/components/subagents/reducers.d.ts +14 -0
- package/dist/src/ui/components/subagents/reducers.js +162 -0
- package/dist/src/ui/components/subagents/reducers.js.map +1 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +20 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +194 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -0
- package/dist/src/ui/components/subagents/types.d.ts +137 -0
- package/dist/src/ui/components/subagents/types.js +15 -0
- package/dist/src/ui/components/subagents/types.js.map +1 -0
- package/dist/src/ui/components/subagents/utils.d.ts +15 -0
- package/dist/src/ui/components/subagents/utils.js +79 -0
- package/dist/src/ui/components/subagents/utils.js.map +1 -0
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +4 -4
- 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 +32 -0
- package/dist/src/ui/contexts/KeypressContext.js +371 -0
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js +894 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
- 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 +5 -3
- package/dist/src/ui/contexts/SessionContext.js +3 -16
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- 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 +20 -20
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +832 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +3 -3
- package/dist/src/ui/hooks/shellCommandProcessor.js +15 -19
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +329 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +14 -6
- package/dist/src/ui/hooks/slashCommandProcessor.js +243 -65
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js +21 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js +6 -4
- 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 +5 -4
- 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 +20 -19
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +263 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
- 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 +34 -0
- package/dist/src/ui/hooks/useDialogClose.js +62 -0
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +4 -0
- package/dist/src/ui/hooks/useFocus.js +4 -4
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +13 -0
- package/dist/src/ui/hooks/useFolderTrust.js +64 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +10 -5
- package/dist/src/ui/hooks/useGeminiStream.js +118 -71
- 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.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js +175 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js +171 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +4 -16
- package/dist/src/ui/hooks/useKeypress.js +8 -140
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
- package/dist/src/ui/hooks/useLaunchEditor.d.ts +10 -0
- package/dist/src/ui/hooks/useLaunchEditor.js +70 -0
- package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +91 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
- 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/useMessageQueue.d.ts +22 -0
- package/dist/src/ui/hooks/useMessageQueue.js +49 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js +158 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +6 -2
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js +154 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -0
- 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/useQuitConfirmation.d.ts +14 -0
- package/dist/src/ui/hooks/useQuitConfirmation.js +36 -0
- package/dist/src/ui/hooks/useQuitConfirmation.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.d.ts +6 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js +292 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -3
- package/dist/src/ui/hooks/useReactToolScheduler.js +17 -18
- 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/useReverseSearchCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +187 -0
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
- 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/useSlashCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +272 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +10 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js +21 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +9 -9
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTimer.test.js +90 -0
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +850 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
- 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.d.ts +23 -0
- package/dist/src/ui/hooks/useWelcomeBack.js +79 -0
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
- 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 +27 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/keyMatchers.test.js +276 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- 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/privacy/CloudFreePrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- 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/ansi-light.js +2 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
- package/dist/src/ui/themes/color-utils.test.js +197 -0
- package/dist/src/ui/themes/color-utils.test.js.map +1 -0
- package/dist/src/ui/themes/googlecode.js +1 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +30 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/qwen-dark.js +2 -1
- package/dist/src/ui/themes/qwen-dark.js.map +1 -1
- package/dist/src/ui/themes/qwen-light.js +2 -1
- package/dist/src/ui/themes/qwen-light.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
- package/dist/src/ui/themes/semantic-tokens.js +94 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +9 -1
- package/dist/src/ui/themes/theme-manager.js +81 -7
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.test.js +142 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +45 -2
- package/dist/src/ui/themes/theme.js +120 -107
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +34 -6
- 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 +3 -2
- package/dist/src/ui/utils/CodeColorizer.js +5 -4
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +2 -1
- package/dist/src/ui/utils/ConsolePatcher.js +4 -1
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +8 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +5 -3
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js +161 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.js +4 -4
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.test.js +65 -0
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +2 -1
- package/dist/src/ui/utils/commandUtils.js +74 -15
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/commandUtils.test.js +349 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +1 -1
- package/dist/src/ui/utils/computeStats.js +3 -1
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +42 -0
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
- package/dist/src/ui/utils/formatters.test.d.ts +6 -0
- package/dist/src/ui/utils/formatters.test.js +56 -0
- package/dist/src/ui/utils/formatters.test.js.map +1 -0
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +13 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +88 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
- package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
- package/dist/src/ui/utils/platformConstants.d.ts +52 -0
- package/dist/src/ui/utils/platformConstants.js +53 -0
- package/dist/src/ui/utils/platformConstants.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
- package/dist/src/ui/utils/terminalSetup.js +281 -0
- package/dist/src/ui/utils/terminalSetup.js.map +1 -0
- 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 +2 -2
- package/dist/src/ui/utils/updateCheck.js +2 -2
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.test.js +145 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
- package/dist/src/utils/checks.d.ts +19 -0
- package/dist/src/utils/checks.js +24 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +7 -6
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +32 -0
- package/dist/src/utils/dialogScopeUtils.js +48 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- 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.d.ts +21 -1
- package/dist/src/utils/gitUtils.js +69 -4
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.test.d.ts +6 -0
- package/dist/src/utils/gitUtils.test.js +113 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -0
- 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 +3 -3
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.d.ts +6 -0
- package/dist/src/utils/installationInfo.test.js +242 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -0
- package/dist/src/utils/package.js +2 -2
- package/dist/src/utils/package.js.map +1 -1
- package/dist/src/utils/readStdin.js +25 -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 +460 -444
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +134 -0
- package/dist/src/utils/settingsUtils.js +330 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/src/utils/settingsUtils.test.d.ts +6 -0
- package/dist/src/utils/settingsUtils.test.js +511 -0
- package/dist/src/utils/settingsUtils.test.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.test.js +67 -0
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.js +1 -1
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +1 -1
- package/dist/src/validateNonInterActiveAuth.js +4 -7
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.d.ts +63 -0
- package/dist/src/{acp → zed-integration}/acp.js +78 -45
- package/dist/src/zed-integration/acp.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.d.ts +19 -0
- package/dist/src/zed-integration/fileSystemService.js +43 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -0
- package/dist/src/zed-integration/schema.d.ts +11782 -0
- package/dist/src/zed-integration/schema.js +311 -0
- package/dist/src/zed-integration/schema.js.map +1 -0
- package/dist/src/zed-integration/zedIntegration.d.ts +10 -0
- package/dist/src/zed-integration/zedIntegration.js +787 -0
- package/dist/src/zed-integration/zedIntegration.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -7
- package/dist/src/acp/acp.d.ts +0 -208
- package/dist/src/acp/acp.js.map +0 -1
- package/dist/src/acp/acpPeer.d.ts +0 -8
- package/dist/src/acp/acpPeer.js +0 -537
- package/dist/src/acp/acpPeer.js.map +0 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +0 -1
- package/dist/src/ui/utils/errorParsing.d.ts +0 -7
- package/dist/src/ui/utils/errorParsing.js +0 -90
- package/dist/src/ui/utils/errorParsing.js.map +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { 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 { HistoryItemDisplay } from './HistoryItemDisplay.js';
|
|
10
|
+
import { MessageType } from '../types.js';
|
|
11
|
+
import { SessionStatsProvider } from '../contexts/SessionContext.js';
|
|
12
|
+
// Mock child components
|
|
13
|
+
vi.mock('./messages/ToolGroupMessage.js', () => ({
|
|
14
|
+
ToolGroupMessage: () => _jsx("div", {}),
|
|
15
|
+
}));
|
|
16
|
+
describe('<HistoryItemDisplay />', () => {
|
|
17
|
+
const mockConfig = {};
|
|
18
|
+
const baseItem = {
|
|
19
|
+
id: 1,
|
|
20
|
+
timestamp: 12345,
|
|
21
|
+
isPending: false,
|
|
22
|
+
terminalWidth: 80,
|
|
23
|
+
config: mockConfig,
|
|
24
|
+
};
|
|
25
|
+
it('renders UserMessage for "user" type', () => {
|
|
26
|
+
const item = {
|
|
27
|
+
...baseItem,
|
|
28
|
+
type: MessageType.USER,
|
|
29
|
+
text: 'Hello',
|
|
30
|
+
};
|
|
31
|
+
const { lastFrame } = render(_jsx(HistoryItemDisplay, { ...baseItem, item: item }));
|
|
32
|
+
expect(lastFrame()).toContain('Hello');
|
|
33
|
+
});
|
|
34
|
+
it('renders UserMessage for "user" type with slash command', () => {
|
|
35
|
+
const item = {
|
|
36
|
+
...baseItem,
|
|
37
|
+
type: MessageType.USER,
|
|
38
|
+
text: '/theme',
|
|
39
|
+
};
|
|
40
|
+
const { lastFrame } = render(_jsx(HistoryItemDisplay, { ...baseItem, item: item }));
|
|
41
|
+
expect(lastFrame()).toContain('/theme');
|
|
42
|
+
});
|
|
43
|
+
it('renders StatsDisplay for "stats" type', () => {
|
|
44
|
+
const item = {
|
|
45
|
+
...baseItem,
|
|
46
|
+
type: MessageType.STATS,
|
|
47
|
+
duration: '1s',
|
|
48
|
+
};
|
|
49
|
+
const { lastFrame } = render(_jsx(SessionStatsProvider, { children: _jsx(HistoryItemDisplay, { ...baseItem, item: item }) }));
|
|
50
|
+
expect(lastFrame()).toContain('Stats');
|
|
51
|
+
});
|
|
52
|
+
it('renders AboutBox for "about" type', () => {
|
|
53
|
+
const item = {
|
|
54
|
+
...baseItem,
|
|
55
|
+
type: MessageType.ABOUT,
|
|
56
|
+
cliVersion: '1.0.0',
|
|
57
|
+
osVersion: 'test-os',
|
|
58
|
+
sandboxEnv: 'test-env',
|
|
59
|
+
modelVersion: 'test-model',
|
|
60
|
+
selectedAuthType: 'test-auth',
|
|
61
|
+
gcpProject: 'test-project',
|
|
62
|
+
ideClient: 'test-ide',
|
|
63
|
+
};
|
|
64
|
+
const { lastFrame } = render(_jsx(HistoryItemDisplay, { ...baseItem, item: item }));
|
|
65
|
+
expect(lastFrame()).toContain('About Qwen Code');
|
|
66
|
+
});
|
|
67
|
+
it('renders ModelStatsDisplay for "model_stats" type', () => {
|
|
68
|
+
const item = {
|
|
69
|
+
...baseItem,
|
|
70
|
+
type: 'model_stats',
|
|
71
|
+
};
|
|
72
|
+
const { lastFrame } = render(_jsx(SessionStatsProvider, { children: _jsx(HistoryItemDisplay, { ...baseItem, item: item }) }));
|
|
73
|
+
expect(lastFrame()).toContain('No API calls have been made in this session.');
|
|
74
|
+
});
|
|
75
|
+
it('renders ToolStatsDisplay for "tool_stats" type', () => {
|
|
76
|
+
const item = {
|
|
77
|
+
...baseItem,
|
|
78
|
+
type: 'tool_stats',
|
|
79
|
+
};
|
|
80
|
+
const { lastFrame } = render(_jsx(SessionStatsProvider, { children: _jsx(HistoryItemDisplay, { ...baseItem, item: item }) }));
|
|
81
|
+
expect(lastFrame()).toContain('No tool calls have been made in this session.');
|
|
82
|
+
});
|
|
83
|
+
it('renders SessionSummaryDisplay for "quit" type', () => {
|
|
84
|
+
const item = {
|
|
85
|
+
...baseItem,
|
|
86
|
+
type: 'quit',
|
|
87
|
+
duration: '1s',
|
|
88
|
+
};
|
|
89
|
+
const { lastFrame } = render(_jsx(SessionStatsProvider, { children: _jsx(HistoryItemDisplay, { ...baseItem, item: item }) }));
|
|
90
|
+
expect(lastFrame()).toContain('Agent powering down. Goodbye!');
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=HistoryItemDisplay.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryItemDisplay.test.js","sourceRoot":"","sources":["../../../../src/ui/components/HistoryItemDisplay.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,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,wBAAwB;AACxB,EAAE,CAAC,IAAI,CAAC,gCAAgC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/C,gBAAgB,EAAE,GAAG,EAAE,CAAC,eAAO;CAChC,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,MAAM,UAAU,GAAG,EAAuB,CAAC;IAC3C,MAAM,QAAQ,GAAG;QACf,EAAE,EAAE,CAAC;QACL,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,EAAE;QACjB,MAAM,EAAE,UAAU;KACnB,CAAC;IAEF,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,IAAI,EAAE,OAAO;SACd,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,CACjD,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,IAAI,EAAE,QAAQ;SACf,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,CACjD,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,WAAW,CAAC,KAAK;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,oBAAoB,cACnB,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,GAC3B,CACxB,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,WAAW,CAAC,KAAK;YACvB,UAAU,EAAE,OAAO;YACnB,SAAS,EAAE,SAAS;YACpB,UAAU,EAAE,UAAU;YACtB,YAAY,EAAE,YAAY;YAC1B,gBAAgB,EAAE,WAAW;YAC7B,UAAU,EAAE,cAAc;YAC1B,SAAS,EAAE,UAAU;SACtB,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,CACjD,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,aAAa;SACpB,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,oBAAoB,cACnB,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,GAC3B,CACxB,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAC3B,8CAA8C,CAC/C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,YAAY;SACnB,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,oBAAoB,cACnB,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,GAC3B,CACxB,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAC3B,+CAA+C,CAChD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,IAAI,GAAgB;YACxB,GAAG,QAAQ;YACX,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,oBAAoB,cACnB,KAAC,kBAAkB,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,GAC3B,CACxB,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { TextBuffer } from './shared/text-buffer.js';
|
|
8
|
-
import { Key } from '../hooks/useKeypress.js';
|
|
9
|
-
import { CommandContext, SlashCommand } from '../commands/types.js';
|
|
10
|
-
import { Config } from '@umsai/ums-code-core';
|
|
6
|
+
import type React from 'react';
|
|
7
|
+
import type { TextBuffer } from './shared/text-buffer.js';
|
|
8
|
+
import type { Key } from '../hooks/useKeypress.js';
|
|
9
|
+
import type { CommandContext, SlashCommand } from '../commands/types.js';
|
|
10
|
+
import type { Config } from '@umsai/ums-code-core';
|
|
11
11
|
export interface InputPromptProps {
|
|
12
12
|
buffer: TextBuffer;
|
|
13
13
|
onSubmit: (value: string) => void;
|
|
@@ -22,6 +22,7 @@ export interface InputPromptProps {
|
|
|
22
22
|
suggestionsWidth: number;
|
|
23
23
|
shellModeActive: boolean;
|
|
24
24
|
setShellModeActive: (value: boolean) => void;
|
|
25
|
+
onEscapePromptChange?: (showPrompt: boolean) => void;
|
|
25
26
|
vimHandleInput?: (key: Key) => boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare const InputPrompt: React.FC<InputPromptProps>;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState, useRef } from 'react';
|
|
8
3
|
import { Box, Text } from 'ink';
|
|
9
|
-
import {
|
|
4
|
+
import { theme } from '../semantic-colors.js';
|
|
10
5
|
import { SuggestionsDisplay } from './SuggestionsDisplay.js';
|
|
11
6
|
import { useInputHistory } from '../hooks/useInputHistory.js';
|
|
12
7
|
import { logicalPosToOffset } from './shared/text-buffer.js';
|
|
13
|
-
import { cpSlice, cpLen } from '../utils/textUtils.js';
|
|
8
|
+
import { cpSlice, cpLen, toCodePoints } from '../utils/textUtils.js';
|
|
14
9
|
import chalk from 'chalk';
|
|
15
10
|
import stringWidth from 'string-width';
|
|
16
11
|
import { useShellHistory } from '../hooks/useShellHistory.js';
|
|
17
12
|
import { useReverseSearchCompletion } from '../hooks/useReverseSearchCompletion.js';
|
|
18
13
|
import { useCommandCompletion } from '../hooks/useCommandCompletion.js';
|
|
19
14
|
import { useKeypress } from '../hooks/useKeypress.js';
|
|
15
|
+
import { keyMatchers, Command } from '../keyMatchers.js';
|
|
20
16
|
import { clipboardHasImage, saveClipboardImage, cleanupOldClipboardImages, } from '../utils/clipboardUtils.js';
|
|
21
|
-
import * as path from 'path';
|
|
17
|
+
import * as path from 'node:path';
|
|
18
|
+
import { SCREEN_READER_USER_PREFIX } from '../textConstants.js';
|
|
22
19
|
// 输入组件
|
|
23
|
-
export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, config, slashCommands, commandContext, placeholder = ' Type your message or @path/to/file', focus = true, inputWidth, suggestionsWidth, shellModeActive, setShellModeActive, vimHandleInput, }) => {
|
|
20
|
+
export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, config, slashCommands, commandContext, placeholder = ' Type your message or @path/to/file', focus = true, inputWidth, suggestionsWidth, shellModeActive, setShellModeActive, onEscapePromptChange, vimHandleInput, }) => {
|
|
24
21
|
const [justNavigatedHistory, setJustNavigatedHistory] = useState(false);
|
|
22
|
+
const [escPressCount, setEscPressCount] = useState(0);
|
|
23
|
+
const [showEscapePrompt, setShowEscapePrompt] = useState(false);
|
|
24
|
+
const escapeTimerRef = useRef(null);
|
|
25
25
|
const [dirs, setDirs] = useState(config.getWorkspaceContext().getDirectories());
|
|
26
26
|
const dirsChanged = config.getWorkspaceContext().getDirectories();
|
|
27
27
|
useEffect(() => {
|
|
@@ -34,12 +34,32 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
34
34
|
const [cursorPosition, setCursorPosition] = useState([
|
|
35
35
|
0, 0,
|
|
36
36
|
]);
|
|
37
|
-
const shellHistory = useShellHistory(config.getProjectRoot());
|
|
37
|
+
const shellHistory = useShellHistory(config.getProjectRoot(), config.storage);
|
|
38
38
|
const historyData = shellHistory.history;
|
|
39
39
|
const completion = useCommandCompletion(buffer, dirs, config.getTargetDir(), slashCommands, commandContext, reverseSearchActive, config);
|
|
40
40
|
const reverseSearchCompletion = useReverseSearchCompletion(buffer, historyData, reverseSearchActive);
|
|
41
41
|
const resetCompletionState = completion.resetCompletionState;
|
|
42
42
|
const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
|
|
43
|
+
const resetEscapeState = useCallback(() => {
|
|
44
|
+
if (escapeTimerRef.current) {
|
|
45
|
+
clearTimeout(escapeTimerRef.current);
|
|
46
|
+
escapeTimerRef.current = null;
|
|
47
|
+
}
|
|
48
|
+
setEscPressCount(0);
|
|
49
|
+
setShowEscapePrompt(false);
|
|
50
|
+
}, []);
|
|
51
|
+
// Notify parent component about escape prompt state changes
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (onEscapePromptChange) {
|
|
54
|
+
onEscapePromptChange(showEscapePrompt);
|
|
55
|
+
}
|
|
56
|
+
}, [showEscapePrompt, onEscapePromptChange]);
|
|
57
|
+
// Clear escape prompt timer on unmount
|
|
58
|
+
useEffect(() => () => {
|
|
59
|
+
if (escapeTimerRef.current) {
|
|
60
|
+
clearTimeout(escapeTimerRef.current);
|
|
61
|
+
}
|
|
62
|
+
}, []);
|
|
43
63
|
const handleSubmitAndClear = useCallback((submittedValue) => {
|
|
44
64
|
if (shellModeActive) {
|
|
45
65
|
shellHistory.addCommandToHistory(submittedValue);
|
|
@@ -130,9 +150,20 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
130
150
|
if (!focus && !key.paste) {
|
|
131
151
|
return;
|
|
132
152
|
}
|
|
153
|
+
if (key.paste) {
|
|
154
|
+
// Ensure we never accidentally interpret paste as regular input.
|
|
155
|
+
buffer.handleInput(key);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
133
158
|
if (vimHandleInput && vimHandleInput(key)) {
|
|
134
159
|
return;
|
|
135
160
|
}
|
|
161
|
+
// Reset ESC count and hide prompt on any non-ESC key
|
|
162
|
+
if (key.name !== 'escape') {
|
|
163
|
+
if (escPressCount > 0 || showEscapePrompt) {
|
|
164
|
+
resetEscapeState();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
136
167
|
if (key.sequence === '!' &&
|
|
137
168
|
buffer.text === '' &&
|
|
138
169
|
!completion.showSuggestions) {
|
|
@@ -140,7 +171,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
140
171
|
buffer.setText(''); // Clear the '!' from input
|
|
141
172
|
return;
|
|
142
173
|
}
|
|
143
|
-
if (key
|
|
174
|
+
if (keyMatchers[Command.ESCAPE](key)) {
|
|
144
175
|
if (reverseSearchActive) {
|
|
145
176
|
setReverseSearchActive(false);
|
|
146
177
|
reverseSearchCompletion.resetCompletionState();
|
|
@@ -151,42 +182,65 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
151
182
|
}
|
|
152
183
|
if (shellModeActive) {
|
|
153
184
|
setShellModeActive(false);
|
|
185
|
+
resetEscapeState();
|
|
154
186
|
return;
|
|
155
187
|
}
|
|
156
188
|
if (completion.showSuggestions) {
|
|
157
189
|
completion.resetCompletionState();
|
|
190
|
+
resetEscapeState();
|
|
158
191
|
return;
|
|
159
192
|
}
|
|
193
|
+
// Handle double ESC for clearing input
|
|
194
|
+
if (escPressCount === 0) {
|
|
195
|
+
if (buffer.text === '') {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
setEscPressCount(1);
|
|
199
|
+
setShowEscapePrompt(true);
|
|
200
|
+
if (escapeTimerRef.current) {
|
|
201
|
+
clearTimeout(escapeTimerRef.current);
|
|
202
|
+
}
|
|
203
|
+
escapeTimerRef.current = setTimeout(() => {
|
|
204
|
+
resetEscapeState();
|
|
205
|
+
}, 500);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
// clear input and immediately reset state
|
|
209
|
+
buffer.setText('');
|
|
210
|
+
resetCompletionState();
|
|
211
|
+
resetEscapeState();
|
|
212
|
+
}
|
|
213
|
+
return;
|
|
160
214
|
}
|
|
161
|
-
if (shellModeActive &&
|
|
215
|
+
if (shellModeActive && keyMatchers[Command.REVERSE_SEARCH](key)) {
|
|
162
216
|
setReverseSearchActive(true);
|
|
163
217
|
setTextBeforeReverseSearch(buffer.text);
|
|
164
218
|
setCursorPosition(buffer.cursor);
|
|
165
219
|
return;
|
|
166
220
|
}
|
|
167
|
-
if (
|
|
221
|
+
if (keyMatchers[Command.CLEAR_SCREEN](key)) {
|
|
168
222
|
onClearScreen();
|
|
169
223
|
return;
|
|
170
224
|
}
|
|
171
225
|
if (reverseSearchActive) {
|
|
172
226
|
const { activeSuggestionIndex, navigateUp, navigateDown, showSuggestions, suggestions, } = reverseSearchCompletion;
|
|
173
227
|
if (showSuggestions) {
|
|
174
|
-
if (key
|
|
228
|
+
if (keyMatchers[Command.NAVIGATION_UP](key)) {
|
|
175
229
|
navigateUp();
|
|
176
230
|
return;
|
|
177
231
|
}
|
|
178
|
-
if (key
|
|
232
|
+
if (keyMatchers[Command.NAVIGATION_DOWN](key)) {
|
|
179
233
|
navigateDown();
|
|
180
234
|
return;
|
|
181
235
|
}
|
|
182
|
-
if (key
|
|
236
|
+
if (keyMatchers[Command.ACCEPT_SUGGESTION_REVERSE_SEARCH](key)) {
|
|
183
237
|
reverseSearchCompletion.handleAutocomplete(activeSuggestionIndex);
|
|
184
238
|
reverseSearchCompletion.resetCompletionState();
|
|
185
239
|
setReverseSearchActive(false);
|
|
186
240
|
return;
|
|
187
241
|
}
|
|
188
242
|
}
|
|
189
|
-
if (
|
|
243
|
+
if (keyMatchers[Command.SUBMIT_REVERSE_SEARCH](key)) {
|
|
190
244
|
const textToSubmit = showSuggestions && activeSuggestionIndex > -1
|
|
191
245
|
? suggestions[activeSuggestionIndex].value
|
|
192
246
|
: buffer.text;
|
|
@@ -196,27 +250,28 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
196
250
|
return;
|
|
197
251
|
}
|
|
198
252
|
// Prevent up/down from falling through to regular history navigation
|
|
199
|
-
if (
|
|
253
|
+
if (keyMatchers[Command.NAVIGATION_UP](key) ||
|
|
254
|
+
keyMatchers[Command.NAVIGATION_DOWN](key)) {
|
|
200
255
|
return;
|
|
201
256
|
}
|
|
202
257
|
}
|
|
203
258
|
// If the command is a perfect match, pressing enter should execute it.
|
|
204
|
-
if (completion.isPerfectMatch && key
|
|
259
|
+
if (completion.isPerfectMatch && keyMatchers[Command.RETURN](key)) {
|
|
205
260
|
handleSubmitAndClear(buffer.text);
|
|
206
261
|
return;
|
|
207
262
|
}
|
|
208
263
|
if (completion.showSuggestions) {
|
|
209
264
|
if (completion.suggestions.length > 1) {
|
|
210
|
-
if (
|
|
265
|
+
if (keyMatchers[Command.COMPLETION_UP](key)) {
|
|
211
266
|
completion.navigateUp();
|
|
212
267
|
return;
|
|
213
268
|
}
|
|
214
|
-
if (
|
|
269
|
+
if (keyMatchers[Command.COMPLETION_DOWN](key)) {
|
|
215
270
|
completion.navigateDown();
|
|
216
271
|
return;
|
|
217
272
|
}
|
|
218
273
|
}
|
|
219
|
-
if (
|
|
274
|
+
if (keyMatchers[Command.ACCEPT_SUGGESTION](key)) {
|
|
220
275
|
if (completion.suggestions.length > 0) {
|
|
221
276
|
const targetIndex = completion.activeSuggestionIndex === -1
|
|
222
277
|
? 0 // Default to the first if none is active
|
|
@@ -228,23 +283,30 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
228
283
|
return;
|
|
229
284
|
}
|
|
230
285
|
}
|
|
286
|
+
// Handle Tab key for ghost text acceptance
|
|
287
|
+
if (key.name === 'tab' &&
|
|
288
|
+
!completion.showSuggestions &&
|
|
289
|
+
completion.promptCompletion.text) {
|
|
290
|
+
completion.promptCompletion.accept();
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
231
293
|
if (!shellModeActive) {
|
|
232
|
-
if (
|
|
294
|
+
if (keyMatchers[Command.HISTORY_UP](key)) {
|
|
233
295
|
inputHistory.navigateUp();
|
|
234
296
|
return;
|
|
235
297
|
}
|
|
236
|
-
if (
|
|
298
|
+
if (keyMatchers[Command.HISTORY_DOWN](key)) {
|
|
237
299
|
inputHistory.navigateDown();
|
|
238
300
|
return;
|
|
239
301
|
}
|
|
240
302
|
// Handle arrow-up/down for history on single-line or at edges
|
|
241
|
-
if (key
|
|
303
|
+
if (keyMatchers[Command.NAVIGATION_UP](key) &&
|
|
242
304
|
(buffer.allVisualLines.length === 1 ||
|
|
243
305
|
(buffer.visualCursor[0] === 0 && buffer.visualScrollRow === 0))) {
|
|
244
306
|
inputHistory.navigateUp();
|
|
245
307
|
return;
|
|
246
308
|
}
|
|
247
|
-
if (key
|
|
309
|
+
if (keyMatchers[Command.NAVIGATION_DOWN](key) &&
|
|
248
310
|
(buffer.allVisualLines.length === 1 ||
|
|
249
311
|
buffer.visualCursor[0] === buffer.allVisualLines.length - 1)) {
|
|
250
312
|
inputHistory.navigateDown();
|
|
@@ -252,20 +314,21 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
252
314
|
}
|
|
253
315
|
}
|
|
254
316
|
else {
|
|
255
|
-
|
|
317
|
+
// Shell History Navigation
|
|
318
|
+
if (keyMatchers[Command.NAVIGATION_UP](key)) {
|
|
256
319
|
const prevCommand = shellHistory.getPreviousCommand();
|
|
257
320
|
if (prevCommand !== null)
|
|
258
321
|
buffer.setText(prevCommand);
|
|
259
322
|
return;
|
|
260
323
|
}
|
|
261
|
-
if (key
|
|
324
|
+
if (keyMatchers[Command.NAVIGATION_DOWN](key)) {
|
|
262
325
|
const nextCommand = shellHistory.getNextCommand();
|
|
263
326
|
if (nextCommand !== null)
|
|
264
327
|
buffer.setText(nextCommand);
|
|
265
328
|
return;
|
|
266
329
|
}
|
|
267
330
|
}
|
|
268
|
-
if (
|
|
331
|
+
if (keyMatchers[Command.SUBMIT](key)) {
|
|
269
332
|
if (buffer.text.trim()) {
|
|
270
333
|
const [row, col] = buffer.cursor;
|
|
271
334
|
const line = buffer.lines[row];
|
|
@@ -281,51 +344,56 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
281
344
|
return;
|
|
282
345
|
}
|
|
283
346
|
// Newline insertion
|
|
284
|
-
if (
|
|
347
|
+
if (keyMatchers[Command.NEWLINE](key)) {
|
|
285
348
|
buffer.newline();
|
|
286
349
|
return;
|
|
287
350
|
}
|
|
288
351
|
// Ctrl+A (Home) / Ctrl+E (End)
|
|
289
|
-
if (
|
|
352
|
+
if (keyMatchers[Command.HOME](key)) {
|
|
290
353
|
buffer.move('home');
|
|
291
354
|
return;
|
|
292
355
|
}
|
|
293
|
-
if (
|
|
356
|
+
if (keyMatchers[Command.END](key)) {
|
|
294
357
|
buffer.move('end');
|
|
295
|
-
buffer.moveToOffset(cpLen(buffer.text));
|
|
296
358
|
return;
|
|
297
359
|
}
|
|
298
360
|
// Ctrl+C (Clear input)
|
|
299
|
-
if (
|
|
361
|
+
if (keyMatchers[Command.CLEAR_INPUT](key)) {
|
|
300
362
|
if (buffer.text.length > 0) {
|
|
301
363
|
buffer.setText('');
|
|
302
364
|
resetCompletionState();
|
|
303
|
-
return;
|
|
304
365
|
}
|
|
305
366
|
return;
|
|
306
367
|
}
|
|
307
368
|
// Kill line commands
|
|
308
|
-
if (
|
|
369
|
+
if (keyMatchers[Command.KILL_LINE_RIGHT](key)) {
|
|
309
370
|
buffer.killLineRight();
|
|
310
371
|
return;
|
|
311
372
|
}
|
|
312
|
-
if (
|
|
373
|
+
if (keyMatchers[Command.KILL_LINE_LEFT](key)) {
|
|
313
374
|
buffer.killLineLeft();
|
|
314
375
|
return;
|
|
315
376
|
}
|
|
316
377
|
// External editor
|
|
317
|
-
|
|
318
|
-
if (isCtrlX) {
|
|
378
|
+
if (keyMatchers[Command.OPEN_EXTERNAL_EDITOR](key)) {
|
|
319
379
|
buffer.openInExternalEditor();
|
|
320
380
|
return;
|
|
321
381
|
}
|
|
322
382
|
// Ctrl+V for clipboard image paste
|
|
323
|
-
if (
|
|
383
|
+
if (keyMatchers[Command.PASTE_CLIPBOARD_IMAGE](key)) {
|
|
324
384
|
handleClipboardImage();
|
|
325
385
|
return;
|
|
326
386
|
}
|
|
327
387
|
// Fall back to the text buffer's default input handling for all other keys
|
|
328
388
|
buffer.handleInput(key);
|
|
389
|
+
// Clear ghost text when user types regular characters (not navigation/control keys)
|
|
390
|
+
if (completion.promptCompletion.text &&
|
|
391
|
+
key.sequence &&
|
|
392
|
+
key.sequence.length === 1 &&
|
|
393
|
+
!key.ctrl &&
|
|
394
|
+
!key.meta) {
|
|
395
|
+
completion.promptCompletion.clear();
|
|
396
|
+
}
|
|
329
397
|
}, [
|
|
330
398
|
focus,
|
|
331
399
|
buffer,
|
|
@@ -339,22 +407,124 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
339
407
|
reverseSearchCompletion,
|
|
340
408
|
handleClipboardImage,
|
|
341
409
|
resetCompletionState,
|
|
410
|
+
escPressCount,
|
|
411
|
+
showEscapePrompt,
|
|
412
|
+
resetEscapeState,
|
|
342
413
|
vimHandleInput,
|
|
343
414
|
reverseSearchActive,
|
|
344
415
|
textBeforeReverseSearch,
|
|
345
416
|
cursorPosition,
|
|
346
417
|
]);
|
|
347
|
-
useKeypress(handleInput, {
|
|
418
|
+
useKeypress(handleInput, {
|
|
419
|
+
isActive: true,
|
|
420
|
+
});
|
|
348
421
|
const linesToRender = buffer.viewportVisualLines;
|
|
349
422
|
const [cursorVisualRowAbsolute, cursorVisualColAbsolute] = buffer.visualCursor;
|
|
350
423
|
const scrollVisualRow = buffer.visualScrollRow;
|
|
351
|
-
|
|
424
|
+
const getGhostTextLines = useCallback(() => {
|
|
425
|
+
if (!completion.promptCompletion.text ||
|
|
426
|
+
!buffer.text ||
|
|
427
|
+
!completion.promptCompletion.text.startsWith(buffer.text)) {
|
|
428
|
+
return { inlineGhost: '', additionalLines: [] };
|
|
429
|
+
}
|
|
430
|
+
const ghostSuffix = completion.promptCompletion.text.slice(buffer.text.length);
|
|
431
|
+
if (!ghostSuffix) {
|
|
432
|
+
return { inlineGhost: '', additionalLines: [] };
|
|
433
|
+
}
|
|
434
|
+
const currentLogicalLine = buffer.lines[buffer.cursor[0]] || '';
|
|
435
|
+
const cursorCol = buffer.cursor[1];
|
|
436
|
+
const textBeforeCursor = cpSlice(currentLogicalLine, 0, cursorCol);
|
|
437
|
+
const usedWidth = stringWidth(textBeforeCursor);
|
|
438
|
+
const remainingWidth = Math.max(0, inputWidth - usedWidth);
|
|
439
|
+
const ghostTextLinesRaw = ghostSuffix.split('\n');
|
|
440
|
+
const firstLineRaw = ghostTextLinesRaw.shift() || '';
|
|
441
|
+
let inlineGhost = '';
|
|
442
|
+
let remainingFirstLine = '';
|
|
443
|
+
if (stringWidth(firstLineRaw) <= remainingWidth) {
|
|
444
|
+
inlineGhost = firstLineRaw;
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
const words = firstLineRaw.split(' ');
|
|
448
|
+
let currentLine = '';
|
|
449
|
+
let wordIdx = 0;
|
|
450
|
+
for (const word of words) {
|
|
451
|
+
const prospectiveLine = currentLine ? `${currentLine} ${word}` : word;
|
|
452
|
+
if (stringWidth(prospectiveLine) > remainingWidth) {
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
currentLine = prospectiveLine;
|
|
456
|
+
wordIdx++;
|
|
457
|
+
}
|
|
458
|
+
inlineGhost = currentLine;
|
|
459
|
+
if (words.length > wordIdx) {
|
|
460
|
+
remainingFirstLine = words.slice(wordIdx).join(' ');
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
const linesToWrap = [];
|
|
464
|
+
if (remainingFirstLine) {
|
|
465
|
+
linesToWrap.push(remainingFirstLine);
|
|
466
|
+
}
|
|
467
|
+
linesToWrap.push(...ghostTextLinesRaw);
|
|
468
|
+
const remainingGhostText = linesToWrap.join('\n');
|
|
469
|
+
const additionalLines = [];
|
|
470
|
+
if (remainingGhostText) {
|
|
471
|
+
const textLines = remainingGhostText.split('\n');
|
|
472
|
+
for (const textLine of textLines) {
|
|
473
|
+
const words = textLine.split(' ');
|
|
474
|
+
let currentLine = '';
|
|
475
|
+
for (const word of words) {
|
|
476
|
+
const prospectiveLine = currentLine ? `${currentLine} ${word}` : word;
|
|
477
|
+
const prospectiveWidth = stringWidth(prospectiveLine);
|
|
478
|
+
if (prospectiveWidth > inputWidth) {
|
|
479
|
+
if (currentLine) {
|
|
480
|
+
additionalLines.push(currentLine);
|
|
481
|
+
}
|
|
482
|
+
let wordToProcess = word;
|
|
483
|
+
while (stringWidth(wordToProcess) > inputWidth) {
|
|
484
|
+
let part = '';
|
|
485
|
+
const wordCP = toCodePoints(wordToProcess);
|
|
486
|
+
let partWidth = 0;
|
|
487
|
+
let splitIndex = 0;
|
|
488
|
+
for (let i = 0; i < wordCP.length; i++) {
|
|
489
|
+
const char = wordCP[i];
|
|
490
|
+
const charWidth = stringWidth(char);
|
|
491
|
+
if (partWidth + charWidth > inputWidth) {
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
part += char;
|
|
495
|
+
partWidth += charWidth;
|
|
496
|
+
splitIndex = i + 1;
|
|
497
|
+
}
|
|
498
|
+
additionalLines.push(part);
|
|
499
|
+
wordToProcess = cpSlice(wordToProcess, splitIndex);
|
|
500
|
+
}
|
|
501
|
+
currentLine = wordToProcess;
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
currentLine = prospectiveLine;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
if (currentLine) {
|
|
508
|
+
additionalLines.push(currentLine);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return { inlineGhost, additionalLines };
|
|
513
|
+
}, [
|
|
514
|
+
completion.promptCompletion.text,
|
|
515
|
+
buffer.text,
|
|
516
|
+
buffer.lines,
|
|
517
|
+
buffer.cursor,
|
|
518
|
+
inputWidth,
|
|
519
|
+
]);
|
|
520
|
+
const { inlineGhost, additionalLines } = getGhostTextLines();
|
|
521
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { borderStyle: "round", borderColor: shellModeActive ? theme.status.warning : theme.border.focused, paddingX: 1, children: [_jsx(Text, { color: shellModeActive ? theme.status.warning : theme.text.accent, children: shellModeActive ? (reverseSearchActive ? (_jsxs(Text, { color: theme.text.link, "aria-label": SCREEN_READER_USER_PREFIX, children: ["(r:)", ' '] })) : ('! ')) : ('> ') }), _jsx(Box, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? (focus ? (_jsxs(Text, { children: [chalk.inverse(placeholder.slice(0, 1)), _jsx(Text, { color: theme.text.secondary, children: placeholder.slice(1) })] })) : (_jsx(Text, { color: theme.text.secondary, children: placeholder }))) : (linesToRender
|
|
522
|
+
.map((lineText, visualIdxInRenderedSet) => {
|
|
352
523
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
353
524
|
let display = cpSlice(lineText, 0, inputWidth);
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
525
|
+
const isOnCursorLine = focus && visualIdxInRenderedSet === cursorVisualRow;
|
|
526
|
+
const currentLineGhost = isOnCursorLine ? inlineGhost : '';
|
|
527
|
+
const ghostWidth = stringWidth(currentLineGhost);
|
|
358
528
|
if (focus && visualIdxInRenderedSet === cursorVisualRow) {
|
|
359
529
|
const relativeVisualColForHighlight = cursorVisualColAbsolute;
|
|
360
530
|
if (relativeVisualColForHighlight >= 0) {
|
|
@@ -366,13 +536,28 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
366
536
|
highlighted +
|
|
367
537
|
cpSlice(display, relativeVisualColForHighlight + 1);
|
|
368
538
|
}
|
|
369
|
-
else if (relativeVisualColForHighlight === cpLen(display)
|
|
370
|
-
|
|
371
|
-
|
|
539
|
+
else if (relativeVisualColForHighlight === cpLen(display)) {
|
|
540
|
+
if (!currentLineGhost) {
|
|
541
|
+
display = display + chalk.inverse(' ');
|
|
542
|
+
}
|
|
372
543
|
}
|
|
373
544
|
}
|
|
374
545
|
}
|
|
375
|
-
|
|
376
|
-
|
|
546
|
+
const showCursorBeforeGhost = focus &&
|
|
547
|
+
visualIdxInRenderedSet === cursorVisualRow &&
|
|
548
|
+
cursorVisualColAbsolute ===
|
|
549
|
+
// eslint-disable-next-line no-control-regex
|
|
550
|
+
cpLen(display.replace(/\x1b\[[0-9;]*m/g, '')) &&
|
|
551
|
+
currentLineGhost;
|
|
552
|
+
const actualDisplayWidth = stringWidth(display);
|
|
553
|
+
const cursorWidth = showCursorBeforeGhost ? 1 : 0;
|
|
554
|
+
const totalContentWidth = actualDisplayWidth + cursorWidth + ghostWidth;
|
|
555
|
+
const trailingPadding = Math.max(0, inputWidth - totalContentWidth);
|
|
556
|
+
return (_jsxs(Text, { children: [display, showCursorBeforeGhost && chalk.inverse(' '), currentLineGhost && (_jsx(Text, { color: theme.text.secondary, children: currentLineGhost })), trailingPadding > 0 && ' '.repeat(trailingPadding)] }, `line-${visualIdxInRenderedSet}`));
|
|
557
|
+
})
|
|
558
|
+
.concat(additionalLines.map((ghostLine, index) => {
|
|
559
|
+
const padding = Math.max(0, inputWidth - stringWidth(ghostLine));
|
|
560
|
+
return (_jsxs(Text, { color: theme.text.secondary, children: [ghostLine, ' '.repeat(padding)] }, `ghost-line-${index}`));
|
|
561
|
+
}))) })] }), completion.showSuggestions && (_jsx(Box, { paddingRight: 2, children: _jsx(SuggestionsDisplay, { suggestions: completion.suggestions, activeIndex: completion.activeSuggestionIndex, isLoading: completion.isLoadingSuggestions, width: suggestionsWidth, scrollOffset: completion.visibleStartIndex, userInput: buffer.text }) })), reverseSearchActive && (_jsx(Box, { paddingRight: 2, children: _jsx(SuggestionsDisplay, { suggestions: reverseSearchCompletion.suggestions, activeIndex: reverseSearchCompletion.activeSuggestionIndex, isLoading: reverseSearchCompletion.isLoadingSuggestions, width: suggestionsWidth, scrollOffset: reverseSearchCompletion.visibleStartIndex, userInput: buffer.text }) }))] }));
|
|
377
562
|
};
|
|
378
563
|
//# sourceMappingURL=InputPrompt.js.map
|