@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,127 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Qwen
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
// no hooks needed beyond keypress handled inside
|
|
8
|
+
import { Box, Text } from 'ink';
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
import stringWidth from 'string-width';
|
|
11
|
+
import { useTextBuffer } from './text-buffer.js';
|
|
12
|
+
import { useKeypress } from '../../hooks/useKeypress.js';
|
|
13
|
+
import { keyMatchers, Command } from '../../keyMatchers.js';
|
|
14
|
+
import { cpSlice, cpLen } from '../../utils/textUtils.js';
|
|
15
|
+
import { theme } from '../../semantic-colors.js';
|
|
16
|
+
import { Colors } from '../../colors.js';
|
|
17
|
+
import { useCallback, useRef, useEffect } from 'react';
|
|
18
|
+
export function TextInput({ value, onChange, onSubmit, placeholder, height = 1, isActive = true, validationErrors = [], inputWidth = 80, }) {
|
|
19
|
+
const allowMultiline = height > 1;
|
|
20
|
+
// Stabilize onChange to avoid triggering useTextBuffer's onChange effect every render
|
|
21
|
+
const onChangeRef = useRef(onChange);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
onChangeRef.current = onChange;
|
|
24
|
+
}, [onChange]);
|
|
25
|
+
const stableOnChange = useCallback((text) => {
|
|
26
|
+
onChangeRef.current?.(text);
|
|
27
|
+
}, []);
|
|
28
|
+
const buffer = useTextBuffer({
|
|
29
|
+
initialText: value || '',
|
|
30
|
+
viewport: { height, width: inputWidth },
|
|
31
|
+
isValidPath: () => false,
|
|
32
|
+
onChange: stableOnChange,
|
|
33
|
+
});
|
|
34
|
+
const handleSubmit = () => {
|
|
35
|
+
if (!onSubmit)
|
|
36
|
+
return;
|
|
37
|
+
onSubmit();
|
|
38
|
+
};
|
|
39
|
+
useKeypress((key) => {
|
|
40
|
+
if (!buffer || !isActive)
|
|
41
|
+
return;
|
|
42
|
+
// Submit on Enter
|
|
43
|
+
if (keyMatchers[Command.SUBMIT](key) || key.name === 'return') {
|
|
44
|
+
if (allowMultiline) {
|
|
45
|
+
const [row, col] = buffer.cursor;
|
|
46
|
+
const line = buffer.lines[row];
|
|
47
|
+
const charBefore = col > 0 ? cpSlice(line, col - 1, col) : '';
|
|
48
|
+
if (charBefore === '\\') {
|
|
49
|
+
buffer.backspace();
|
|
50
|
+
buffer.newline();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
handleSubmit();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
handleSubmit();
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Multiline newline insertion (Shift+Enter etc.)
|
|
62
|
+
if (allowMultiline && keyMatchers[Command.NEWLINE](key)) {
|
|
63
|
+
buffer.newline();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Navigation helpers
|
|
67
|
+
if (keyMatchers[Command.HOME](key)) {
|
|
68
|
+
buffer.move('home');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (keyMatchers[Command.END](key)) {
|
|
72
|
+
buffer.move('end');
|
|
73
|
+
buffer.moveToOffset(cpLen(buffer.text));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (keyMatchers[Command.CLEAR_INPUT](key)) {
|
|
77
|
+
if (buffer.text.length > 0)
|
|
78
|
+
buffer.setText('');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (keyMatchers[Command.KILL_LINE_RIGHT](key)) {
|
|
82
|
+
buffer.killLineRight();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (keyMatchers[Command.KILL_LINE_LEFT](key)) {
|
|
86
|
+
buffer.killLineLeft();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (keyMatchers[Command.OPEN_EXTERNAL_EDITOR](key)) {
|
|
90
|
+
buffer.openInExternalEditor();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
buffer.handleInput(key);
|
|
94
|
+
}, { isActive });
|
|
95
|
+
if (!buffer)
|
|
96
|
+
return null;
|
|
97
|
+
const linesToRender = buffer.viewportVisualLines;
|
|
98
|
+
const [cursorVisualRowAbsolute, cursorVisualColAbsolute] = buffer.visualCursor;
|
|
99
|
+
const scrollVisualRow = buffer.visualScrollRow;
|
|
100
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.text.accent, children: '> ' }), _jsx(Box, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? (_jsxs(Text, { children: [chalk.inverse(placeholder.slice(0, 1)), _jsx(Text, { color: Colors.Gray, children: placeholder.slice(1) })] })) : (linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
|
101
|
+
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
102
|
+
let display = cpSlice(lineText, 0, inputWidth);
|
|
103
|
+
const currentVisualWidth = stringWidth(display);
|
|
104
|
+
if (currentVisualWidth < inputWidth) {
|
|
105
|
+
display = display + ' '.repeat(inputWidth - currentVisualWidth);
|
|
106
|
+
}
|
|
107
|
+
if (visualIdxInRenderedSet === cursorVisualRow) {
|
|
108
|
+
const relativeVisualColForHighlight = cursorVisualColAbsolute;
|
|
109
|
+
if (relativeVisualColForHighlight >= 0) {
|
|
110
|
+
if (relativeVisualColForHighlight < cpLen(display)) {
|
|
111
|
+
const charToHighlight = cpSlice(display, relativeVisualColForHighlight, relativeVisualColForHighlight + 1) || ' ';
|
|
112
|
+
const highlighted = chalk.inverse(charToHighlight);
|
|
113
|
+
display =
|
|
114
|
+
cpSlice(display, 0, relativeVisualColForHighlight) +
|
|
115
|
+
highlighted +
|
|
116
|
+
cpSlice(display, relativeVisualColForHighlight + 1);
|
|
117
|
+
}
|
|
118
|
+
else if (relativeVisualColForHighlight === cpLen(display) &&
|
|
119
|
+
cpLen(display) === inputWidth) {
|
|
120
|
+
display = display + chalk.inverse(' ');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return (_jsx(Text, { children: display }, `line-${visualIdxInRenderedSet}`));
|
|
125
|
+
})) })] }), validationErrors.length > 0 && (_jsx(Box, { flexDirection: "column", children: validationErrors.map((error, index) => (_jsxs(Text, { color: theme.status.error, children: ["\u26A0 ", error] }, index))) }))] }));
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
7
|
+
export declare const isWordCharStrict: (char: string) => boolean;
|
|
8
|
+
export declare const isWhitespace: (char: string) => boolean;
|
|
9
|
+
export declare const isCombiningMark: (char: string) => boolean;
|
|
10
|
+
export declare const isWordCharWithCombining: (char: string) => boolean;
|
|
11
|
+
export declare const getCharScript: (char: string) => string;
|
|
12
|
+
export declare const isDifferentScript: (char1: string, char2: string) => boolean;
|
|
13
|
+
export declare const findNextWordStartInLine: (line: string, col: number) => number | null;
|
|
14
|
+
export declare const findPrevWordStartInLine: (line: string, col: number) => number | null;
|
|
15
|
+
export declare const findWordEndInLine: (line: string, col: number) => number | null;
|
|
16
|
+
export declare const findNextWordAcrossLines: (lines: string[], cursorRow: number, cursorCol: number, searchForWordStart: boolean) => {
|
|
17
|
+
row: number;
|
|
18
|
+
col: number;
|
|
19
|
+
} | null;
|
|
20
|
+
export declare const findPrevWordAcrossLines: (lines: string[], cursorRow: number, cursorCol: number) => {
|
|
21
|
+
row: number;
|
|
22
|
+
col: number;
|
|
23
|
+
} | null;
|
|
11
24
|
export declare const getPositionFromOffsets: (startOffset: number, endOffset: number, lines: string[]) => {
|
|
12
25
|
startRow: number;
|
|
13
26
|
startCol: number;
|
|
@@ -3,15 +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 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';
|
|
11
10
|
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
|
12
11
|
import stringWidth from 'string-width';
|
|
13
12
|
import { unescapePath } from '@umsai/ums-code-core';
|
|
14
|
-
import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
|
|
13
|
+
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, } from '../../utils/textUtils.js';
|
|
15
14
|
import { handleVimAction } from './vim-buffer-actions.js';
|
|
16
15
|
// Simple helper for word‑wise ops.
|
|
17
16
|
function isWordChar(ch) {
|
|
@@ -20,112 +19,266 @@ function isWordChar(ch) {
|
|
|
20
19
|
}
|
|
21
20
|
return !/[\s,.;!?]/.test(ch);
|
|
22
21
|
}
|
|
23
|
-
//
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
// Helper functions for line-based word navigation
|
|
23
|
+
export const isWordCharStrict = (char) => /[\w\p{L}\p{N}]/u.test(char); // Matches a single character that is any Unicode letter, any Unicode number, or an underscore
|
|
24
|
+
export const isWhitespace = (char) => /\s/.test(char);
|
|
25
|
+
// Check if a character is a combining mark (only diacritics for now)
|
|
26
|
+
export const isCombiningMark = (char) => /\p{M}/u.test(char);
|
|
27
|
+
// Check if a character should be considered part of a word (including combining marks)
|
|
28
|
+
export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
|
|
29
|
+
// Get the script of a character (simplified for common scripts)
|
|
30
|
+
export const getCharScript = (char) => {
|
|
31
|
+
if (/[\p{Script=Latin}]/u.test(char))
|
|
32
|
+
return 'latin'; // All Latin script chars including diacritics
|
|
33
|
+
if (/[\p{Script=Han}]/u.test(char))
|
|
34
|
+
return 'han'; // Chinese
|
|
35
|
+
if (/[\p{Script=Arabic}]/u.test(char))
|
|
36
|
+
return 'arabic';
|
|
37
|
+
if (/[\p{Script=Hiragana}]/u.test(char))
|
|
38
|
+
return 'hiragana';
|
|
39
|
+
if (/[\p{Script=Katakana}]/u.test(char))
|
|
40
|
+
return 'katakana';
|
|
41
|
+
if (/[\p{Script=Cyrillic}]/u.test(char))
|
|
42
|
+
return 'cyrillic';
|
|
43
|
+
return 'other';
|
|
44
|
+
};
|
|
45
|
+
// Check if two characters are from different scripts (indicating word boundary)
|
|
46
|
+
export const isDifferentScript = (char1, char2) => {
|
|
47
|
+
if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
|
|
48
|
+
return false;
|
|
49
|
+
return getCharScript(char1) !== getCharScript(char2);
|
|
50
|
+
};
|
|
51
|
+
// Find next word start within a line, starting from col
|
|
52
|
+
export const findNextWordStartInLine = (line, col) => {
|
|
53
|
+
const chars = toCodePoints(line);
|
|
54
|
+
let i = col;
|
|
55
|
+
if (i >= chars.length)
|
|
56
|
+
return null;
|
|
57
|
+
const currentChar = chars[i];
|
|
29
58
|
// Skip current word/sequence based on character type
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
59
|
+
if (isWordCharStrict(currentChar)) {
|
|
60
|
+
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
61
|
+
// Check for script boundary - if next character is from different script, stop here
|
|
62
|
+
if (i + 1 < chars.length &&
|
|
63
|
+
isWordCharStrict(chars[i + 1]) &&
|
|
64
|
+
isDifferentScript(chars[i], chars[i + 1])) {
|
|
65
|
+
i++; // Include current character
|
|
66
|
+
break; // Stop at script boundary
|
|
67
|
+
}
|
|
33
68
|
i++;
|
|
34
69
|
}
|
|
35
70
|
}
|
|
36
|
-
else if (
|
|
37
|
-
|
|
38
|
-
|
|
71
|
+
else if (!isWhitespace(currentChar)) {
|
|
72
|
+
while (i < chars.length &&
|
|
73
|
+
!isWordCharStrict(chars[i]) &&
|
|
74
|
+
!isWhitespace(chars[i])) {
|
|
39
75
|
i++;
|
|
40
76
|
}
|
|
41
77
|
}
|
|
42
78
|
// Skip whitespace
|
|
43
|
-
while (i <
|
|
79
|
+
while (i < chars.length && isWhitespace(chars[i])) {
|
|
44
80
|
i++;
|
|
45
81
|
}
|
|
46
|
-
|
|
47
|
-
// vim behavior for dw is to delete to the end of the current word
|
|
48
|
-
if (i >= text.length) {
|
|
49
|
-
// Go back to find the end of the last word
|
|
50
|
-
let endOfLastWord = text.length - 1;
|
|
51
|
-
while (endOfLastWord >= 0 && /\s/.test(text[endOfLastWord])) {
|
|
52
|
-
endOfLastWord--;
|
|
53
|
-
}
|
|
54
|
-
// For dw on last word, return position AFTER the last character to delete entire word
|
|
55
|
-
return Math.max(currentOffset + 1, endOfLastWord + 1);
|
|
56
|
-
}
|
|
57
|
-
return i;
|
|
82
|
+
return i < chars.length ? i : null;
|
|
58
83
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// Move back one character to start searching
|
|
84
|
+
// Find previous word start within a line
|
|
85
|
+
export const findPrevWordStartInLine = (line, col) => {
|
|
86
|
+
const chars = toCodePoints(line);
|
|
87
|
+
let i = col;
|
|
88
|
+
if (i <= 0)
|
|
89
|
+
return null;
|
|
66
90
|
i--;
|
|
67
91
|
// Skip whitespace moving backwards
|
|
68
|
-
while (i >= 0 && (
|
|
92
|
+
while (i >= 0 && isWhitespace(chars[i])) {
|
|
69
93
|
i--;
|
|
70
94
|
}
|
|
71
|
-
if (i < 0)
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
const charAtI = text[i];
|
|
75
|
-
if (/\w/.test(charAtI)) {
|
|
95
|
+
if (i < 0)
|
|
96
|
+
return null;
|
|
97
|
+
if (isWordCharStrict(chars[i])) {
|
|
76
98
|
// We're in a word, move to its beginning
|
|
77
|
-
while (i >= 0 &&
|
|
99
|
+
while (i >= 0 && isWordCharStrict(chars[i])) {
|
|
100
|
+
// Check for script boundary - if previous character is from different script, stop here
|
|
101
|
+
if (i - 1 >= 0 &&
|
|
102
|
+
isWordCharStrict(chars[i - 1]) &&
|
|
103
|
+
isDifferentScript(chars[i], chars[i - 1])) {
|
|
104
|
+
return i; // Return current position at script boundary
|
|
105
|
+
}
|
|
78
106
|
i--;
|
|
79
107
|
}
|
|
80
|
-
return i + 1;
|
|
108
|
+
return i + 1;
|
|
81
109
|
}
|
|
82
110
|
else {
|
|
83
111
|
// We're in punctuation, move to its beginning
|
|
84
|
-
while (i >= 0 &&
|
|
85
|
-
!/\w/.test(text[i]) &&
|
|
86
|
-
text[i] !== ' ' &&
|
|
87
|
-
text[i] !== '\t' &&
|
|
88
|
-
text[i] !== '\n') {
|
|
112
|
+
while (i >= 0 && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
|
|
89
113
|
i--;
|
|
90
114
|
}
|
|
91
|
-
return i + 1;
|
|
115
|
+
return i + 1;
|
|
92
116
|
}
|
|
93
117
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
118
|
+
// Find word end within a line
|
|
119
|
+
export const findWordEndInLine = (line, col) => {
|
|
120
|
+
const chars = toCodePoints(line);
|
|
121
|
+
let i = col;
|
|
122
|
+
// If we're already at the end of a word (including punctuation sequences), advance to next word
|
|
123
|
+
// This includes both regular word endings and script boundaries
|
|
124
|
+
const atEndOfWordChar = i < chars.length &&
|
|
125
|
+
isWordCharWithCombining(chars[i]) &&
|
|
126
|
+
(i + 1 >= chars.length ||
|
|
127
|
+
!isWordCharWithCombining(chars[i + 1]) ||
|
|
128
|
+
(isWordCharStrict(chars[i]) &&
|
|
129
|
+
i + 1 < chars.length &&
|
|
130
|
+
isWordCharStrict(chars[i + 1]) &&
|
|
131
|
+
isDifferentScript(chars[i], chars[i + 1])));
|
|
132
|
+
const atEndOfPunctuation = i < chars.length &&
|
|
133
|
+
!isWordCharWithCombining(chars[i]) &&
|
|
134
|
+
!isWhitespace(chars[i]) &&
|
|
135
|
+
(i + 1 >= chars.length ||
|
|
136
|
+
isWhitespace(chars[i + 1]) ||
|
|
137
|
+
isWordCharWithCombining(chars[i + 1]));
|
|
138
|
+
if (atEndOfWordChar || atEndOfPunctuation) {
|
|
139
|
+
// We're at the end of a word or punctuation sequence, move forward to find next word
|
|
101
140
|
i++;
|
|
102
|
-
// Skip whitespace
|
|
103
|
-
while (i <
|
|
141
|
+
// Skip whitespace to find next word or punctuation
|
|
142
|
+
while (i < chars.length && isWhitespace(chars[i])) {
|
|
104
143
|
i++;
|
|
105
144
|
}
|
|
106
145
|
}
|
|
107
|
-
// If we're not on a word character, find the next word
|
|
108
|
-
if (i <
|
|
109
|
-
|
|
146
|
+
// If we're not on a word character, find the next word or punctuation sequence
|
|
147
|
+
if (i < chars.length && !isWordCharWithCombining(chars[i])) {
|
|
148
|
+
// Skip whitespace to find next word or punctuation
|
|
149
|
+
while (i < chars.length && isWhitespace(chars[i])) {
|
|
110
150
|
i++;
|
|
111
151
|
}
|
|
112
152
|
}
|
|
113
|
-
// Move to end of current word
|
|
114
|
-
|
|
115
|
-
|
|
153
|
+
// Move to end of current word (including combining marks, but stop at script boundaries)
|
|
154
|
+
let foundWord = false;
|
|
155
|
+
let lastBaseCharPos = -1;
|
|
156
|
+
if (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
157
|
+
// Handle word characters
|
|
158
|
+
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
159
|
+
foundWord = true;
|
|
160
|
+
// Track the position of the last base character (not combining mark)
|
|
161
|
+
if (isWordCharStrict(chars[i])) {
|
|
162
|
+
lastBaseCharPos = i;
|
|
163
|
+
}
|
|
164
|
+
// Check if next character is from a different script (word boundary)
|
|
165
|
+
if (i + 1 < chars.length &&
|
|
166
|
+
isWordCharStrict(chars[i + 1]) &&
|
|
167
|
+
isDifferentScript(chars[i], chars[i + 1])) {
|
|
168
|
+
i++; // Include current character
|
|
169
|
+
if (isWordCharStrict(chars[i - 1])) {
|
|
170
|
+
lastBaseCharPos = i - 1;
|
|
171
|
+
}
|
|
172
|
+
break; // Stop at script boundary
|
|
173
|
+
}
|
|
174
|
+
i++;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (i < chars.length && !isWhitespace(chars[i])) {
|
|
178
|
+
// Handle punctuation sequences (like ████)
|
|
179
|
+
while (i < chars.length &&
|
|
180
|
+
!isWordCharStrict(chars[i]) &&
|
|
181
|
+
!isWhitespace(chars[i])) {
|
|
182
|
+
foundWord = true;
|
|
183
|
+
lastBaseCharPos = i;
|
|
184
|
+
i++;
|
|
185
|
+
}
|
|
116
186
|
}
|
|
117
|
-
//
|
|
118
|
-
|
|
187
|
+
// Only return a position if we actually found a word
|
|
188
|
+
// Return the position of the last base character, not combining marks
|
|
189
|
+
if (foundWord && lastBaseCharPos >= col) {
|
|
190
|
+
return lastBaseCharPos;
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
119
193
|
};
|
|
120
|
-
//
|
|
121
|
-
export const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
194
|
+
// Find next word across lines
|
|
195
|
+
export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
|
|
196
|
+
// First try current line
|
|
197
|
+
const currentLine = lines[cursorRow] || '';
|
|
198
|
+
const colInCurrentLine = searchForWordStart
|
|
199
|
+
? findNextWordStartInLine(currentLine, cursorCol)
|
|
200
|
+
: findWordEndInLine(currentLine, cursorCol);
|
|
201
|
+
if (colInCurrentLine !== null) {
|
|
202
|
+
return { row: cursorRow, col: colInCurrentLine };
|
|
125
203
|
}
|
|
126
|
-
|
|
127
|
-
|
|
204
|
+
// Search subsequent lines
|
|
205
|
+
for (let row = cursorRow + 1; row < lines.length; row++) {
|
|
206
|
+
const line = lines[row] || '';
|
|
207
|
+
const chars = toCodePoints(line);
|
|
208
|
+
// For empty lines, if we haven't found any words yet, return the empty line
|
|
209
|
+
if (chars.length === 0) {
|
|
210
|
+
// Check if there are any words in remaining lines
|
|
211
|
+
let hasWordsInLaterLines = false;
|
|
212
|
+
for (let laterRow = row + 1; laterRow < lines.length; laterRow++) {
|
|
213
|
+
const laterLine = lines[laterRow] || '';
|
|
214
|
+
const laterChars = toCodePoints(laterLine);
|
|
215
|
+
let firstNonWhitespace = 0;
|
|
216
|
+
while (firstNonWhitespace < laterChars.length &&
|
|
217
|
+
isWhitespace(laterChars[firstNonWhitespace])) {
|
|
218
|
+
firstNonWhitespace++;
|
|
219
|
+
}
|
|
220
|
+
if (firstNonWhitespace < laterChars.length) {
|
|
221
|
+
hasWordsInLaterLines = true;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// If no words in later lines, return the empty line
|
|
226
|
+
if (!hasWordsInLaterLines) {
|
|
227
|
+
return { row, col: 0 };
|
|
228
|
+
}
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
// Find first non-whitespace
|
|
232
|
+
let firstNonWhitespace = 0;
|
|
233
|
+
while (firstNonWhitespace < chars.length &&
|
|
234
|
+
isWhitespace(chars[firstNonWhitespace])) {
|
|
235
|
+
firstNonWhitespace++;
|
|
236
|
+
}
|
|
237
|
+
if (firstNonWhitespace < chars.length) {
|
|
238
|
+
if (searchForWordStart) {
|
|
239
|
+
return { row, col: firstNonWhitespace };
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
// For word end, find the end of the first word
|
|
243
|
+
const endCol = findWordEndInLine(line, firstNonWhitespace);
|
|
244
|
+
if (endCol !== null) {
|
|
245
|
+
return { row, col: endCol };
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return null;
|
|
128
251
|
};
|
|
252
|
+
// Find previous word across lines
|
|
253
|
+
export const findPrevWordAcrossLines = (lines, cursorRow, cursorCol) => {
|
|
254
|
+
// First try current line
|
|
255
|
+
const currentLine = lines[cursorRow] || '';
|
|
256
|
+
const colInCurrentLine = findPrevWordStartInLine(currentLine, cursorCol);
|
|
257
|
+
if (colInCurrentLine !== null) {
|
|
258
|
+
return { row: cursorRow, col: colInCurrentLine };
|
|
259
|
+
}
|
|
260
|
+
// Search previous lines
|
|
261
|
+
for (let row = cursorRow - 1; row >= 0; row--) {
|
|
262
|
+
const line = lines[row] || '';
|
|
263
|
+
const chars = toCodePoints(line);
|
|
264
|
+
if (chars.length === 0)
|
|
265
|
+
continue;
|
|
266
|
+
// Find last word start
|
|
267
|
+
let lastWordStart = chars.length;
|
|
268
|
+
while (lastWordStart > 0 && isWhitespace(chars[lastWordStart - 1])) {
|
|
269
|
+
lastWordStart--;
|
|
270
|
+
}
|
|
271
|
+
if (lastWordStart > 0) {
|
|
272
|
+
// Find start of this word
|
|
273
|
+
const wordStart = findPrevWordStartInLine(line, lastWordStart);
|
|
274
|
+
if (wordStart !== null) {
|
|
275
|
+
return { row, col: wordStart };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return null;
|
|
280
|
+
};
|
|
281
|
+
// Helper functions for vim line operations
|
|
129
282
|
export const getPositionFromOffsets = (startOffset, endOffset, lines) => {
|
|
130
283
|
let offset = 0;
|
|
131
284
|
let startRow = 0;
|
|
@@ -218,27 +371,6 @@ export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol,
|
|
|
218
371
|
preferredCol: null,
|
|
219
372
|
};
|
|
220
373
|
};
|
|
221
|
-
/**
|
|
222
|
-
* Strip characters that can break terminal rendering.
|
|
223
|
-
*
|
|
224
|
-
* Strip ANSI escape codes and control characters except for line breaks.
|
|
225
|
-
* Control characters such as delete break terminal UI rendering.
|
|
226
|
-
*/
|
|
227
|
-
function stripUnsafeCharacters(str) {
|
|
228
|
-
const stripped = stripAnsi(str);
|
|
229
|
-
return toCodePoints(stripped)
|
|
230
|
-
.filter((char) => {
|
|
231
|
-
if (char.length > 1)
|
|
232
|
-
return false;
|
|
233
|
-
const code = char.codePointAt(0);
|
|
234
|
-
if (code === undefined) {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
const isUnsafe = code === 127 || (code <= 31 && code !== 13 && code !== 10);
|
|
238
|
-
return !isUnsafe;
|
|
239
|
-
})
|
|
240
|
-
.join('');
|
|
241
|
-
}
|
|
242
374
|
function clamp(v, min, max) {
|
|
243
375
|
return v < min ? min : v > max ? max : v;
|
|
244
376
|
}
|
|
@@ -1219,6 +1351,12 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1219
1351
|
}, [text, stdin, setRawMode]);
|
|
1220
1352
|
const handleInput = useCallback((key) => {
|
|
1221
1353
|
const { sequence: input } = key;
|
|
1354
|
+
if (key.paste) {
|
|
1355
|
+
// Do not do any other processing on pastes so ensure we handle them
|
|
1356
|
+
// before all other cases.
|
|
1357
|
+
insert(input, { paste: key.paste });
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1222
1360
|
if (key.name === 'return' ||
|
|
1223
1361
|
input === '\r' ||
|
|
1224
1362
|
input === '\n' ||
|