@rdmind/rdmind 0.0.15-alpha.1 → 0.0.15-alpha.2
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/package.json +15 -10
- package/dist/src/commands/extensions/disable.d.ts +2 -3
- package/dist/src/commands/extensions/disable.js +20 -6
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/enable.d.ts +2 -3
- package/dist/src/commands/extensions/enable.js +21 -10
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
- package/dist/src/commands/extensions/examples/context/qwen-extension.json +4 -0
- package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
- package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +4 -0
- package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
- package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
- package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +11 -0
- package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
- package/dist/src/commands/extensions/install.d.ts +3 -2
- package/dist/src/commands/extensions/install.js +47 -17
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +86 -9
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.d.ts +12 -0
- package/dist/src/commands/extensions/link.js +37 -0
- package/dist/src/commands/extensions/link.js.map +1 -0
- package/dist/src/commands/extensions/list.js +1 -1
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/new.d.ts +7 -0
- package/dist/src/commands/extensions/new.js +90 -0
- package/dist/src/commands/extensions/new.js.map +1 -0
- package/dist/src/commands/extensions/new.test.js +59 -0
- package/dist/src/commands/extensions/new.test.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.js +1 -1
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.test.js +2 -2
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
- package/dist/src/commands/extensions/update.d.ts +2 -1
- package/dist/src/commands/extensions/update.js +80 -14
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions.js +4 -0
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/mcp/add.js +6 -1
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/list.js +4 -3
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/remove.js +1 -1
- package/dist/src/commands/mcp/remove.js.map +1 -1
- package/dist/src/config/auth.d.ts +1 -1
- package/dist/src/config/auth.js +4 -4
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.js +15 -7
- package/dist/src/config/auth.test.js.map +1 -1
- package/dist/src/config/config.d.ts +7 -2
- package/dist/src/config/config.js +178 -122
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +39 -16
- package/dist/src/config/extension.js +349 -192
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
- package/dist/src/config/extensions/extensionEnablement.js +189 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
- package/dist/src/{ui/components/ModelSelectionDialog.test.d.ts → config/extensions/extensionEnablement.test.d.ts} +1 -1
- package/dist/src/config/extensions/extensionEnablement.test.js +333 -0
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +30 -0
- package/dist/src/config/extensions/github.js +322 -0
- package/dist/src/config/extensions/github.js.map +1 -0
- package/dist/src/config/extensions/github.test.d.ts +6 -0
- package/dist/src/config/extensions/github.test.js +334 -0
- package/dist/src/config/extensions/github.test.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +19 -0
- package/dist/src/config/extensions/update.js +113 -0
- package/dist/src/config/extensions/update.js.map +1 -0
- package/dist/src/config/extensions/update.test.d.ts +6 -0
- package/dist/src/config/extensions/update.test.js +342 -0
- package/dist/src/config/extensions/update.test.js.map +1 -0
- package/dist/src/config/extensions/variableSchema.d.ts +8 -0
- package/dist/src/config/extensions/variableSchema.js +4 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +5 -1
- package/dist/src/config/keyBindings.js +14 -25
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/settings.d.ts +8 -5
- package/dist/src/config/settings.js +178 -275
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +332 -141
- package/dist/src/config/settingsSchema.js +321 -153
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +64 -57
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/trustedFolders.d.ts +23 -4
- package/dist/src/config/trustedFolders.js +97 -47
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +196 -20
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/core/auth.d.ts +13 -0
- package/dist/src/core/auth.js +27 -0
- package/dist/src/core/auth.js.map +1 -0
- package/dist/src/core/initializer.d.ts +21 -0
- package/dist/src/core/initializer.js +33 -0
- package/dist/src/core/initializer.js.map +1 -0
- package/dist/src/core/theme.d.ts +12 -0
- package/dist/src/core/theme.js +20 -0
- package/dist/src/core/theme.js.map +1 -0
- package/dist/src/gemini.d.ts +3 -2
- package/dist/src/gemini.js +156 -128
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +190 -47
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/nonInteractiveCli.d.ts +2 -1
- package/dist/src/nonInteractiveCli.js +101 -72
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
- package/dist/src/nonInteractiveCliCommands.js +79 -0
- package/dist/src/nonInteractiveCliCommands.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +1 -1
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +30 -18
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +2 -0
- package/dist/src/services/FileCommandLoader.js +7 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +43 -8
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +228 -1
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.js +8 -1
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/test-utils/createExtension.d.ts +15 -0
- package/dist/src/test-utils/createExtension.js +25 -0
- package/dist/src/test-utils/createExtension.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.js +2 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/render.d.ts +5 -1
- package/dist/src/test-utils/render.js +5 -1
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/App.d.ts +1 -10
- package/dist/src/ui/App.js +26 -834
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +17 -0
- package/dist/src/ui/AppContainer.js +1062 -0
- package/dist/src/ui/AppContainer.js.map +1 -0
- package/dist/src/ui/AppContainer.test.d.ts +6 -0
- package/dist/src/ui/AppContainer.test.js +831 -0
- package/dist/src/ui/AppContainer.test.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.d.ts +2 -2
- package/dist/src/ui/IdeIntegrationNudge.js +6 -8
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/{components → auth}/AuthDialog.js +8 -4
- package/dist/src/ui/auth/AuthDialog.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/{components → auth}/AuthDialog.test.js +92 -10
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthInProgress.js +2 -2
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/{hooks/useAuthCommand.d.ts → auth/useAuth.d.ts} +9 -3
- package/dist/src/ui/{hooks/useAuthCommand.js → auth/useAuth.js} +49 -14
- package/dist/src/ui/auth/useAuth.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.js +9 -3
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +2 -0
- package/dist/src/ui/commands/chatCommand.js +93 -3
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +1 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.js +1 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +2 -2
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +92 -15
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +1 -2
- package/dist/src/ui/commands/ideCommand.js +19 -10
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +88 -261
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +1 -1
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.js +1 -16
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.test.js +10 -11
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.js +1 -1
- package/dist/src/ui/commands/summaryCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +10 -24
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +7 -2
- package/dist/src/ui/commands/types.js +0 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AboutBox.js +2 -2
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
- package/dist/src/ui/components/AnsiOutput.js +12 -0
- package/dist/src/ui/components/AnsiOutput.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
- package/dist/src/ui/components/AnsiOutput.test.js +97 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
- package/dist/src/ui/components/AppHeader.d.ts +10 -0
- package/dist/src/ui/components/AppHeader.js +19 -0
- package/dist/src/ui/components/AppHeader.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js +5 -5
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/components/Composer.d.ts +6 -0
- package/dist/src/ui/components/Composer.js +54 -0
- package/dist/src/ui/components/Composer.js.map +1 -0
- package/dist/src/ui/components/Composer.test.d.ts +6 -0
- package/dist/src/ui/components/Composer.test.js +337 -0
- package/dist/src/ui/components/Composer.test.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
- package/dist/src/ui/components/ConsentPrompt.js +19 -0
- package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ConsentPrompt.test.js +67 -0
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +3 -3
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +2 -1
- package/dist/src/ui/components/ContextUsageDisplay.js +5 -3
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.js +2 -2
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js +7 -7
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.d.ts +12 -0
- package/dist/src/ui/components/DialogManager.js +129 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +16 -7
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/ExitWarning.d.ts +7 -0
- package/dist/src/ui/components/ExitWarning.js +9 -0
- package/dist/src/ui/components/ExitWarning.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.js +22 -9
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +37 -12
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -17
- package/dist/src/ui/components/Footer.js +33 -11
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +5 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +7 -2
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/Header.js +2 -2
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/Help.js +9 -6
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/Help.test.d.ts +6 -0
- package/dist/src/ui/components/Help.test.js +57 -0
- package/dist/src/ui/components/Help.test.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -4
- package/dist/src/ui/components/HistoryItemDisplay.js +13 -4
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +90 -9
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js +32 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +9 -0
- package/dist/src/ui/components/InputPrompt.js +192 -45
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +2 -2
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +4 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.d.ts +6 -0
- package/dist/src/ui/components/MainContent.js +28 -0
- package/dist/src/ui/components/MainContent.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.d.ts +11 -0
- package/dist/src/ui/components/ModelDialog.js +42 -0
- package/dist/src/ui/components/ModelDialog.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelDialog.test.js +158 -0
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.js +3 -0
- package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.test.js +3 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.d.ts +6 -0
- package/dist/src/ui/components/Notifications.js +23 -0
- package/dist/src/ui/components/Notifications.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js +63 -39
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +8 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +13 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +48 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +154 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +5 -5
- package/dist/src/ui/components/PrepareLabel.js +67 -11
- package/dist/src/ui/components/PrepareLabel.js.map +1 -1
- package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
- package/dist/src/ui/components/PrepareLabel.test.js +71 -0
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.d.ts +13 -0
- package/dist/src/ui/components/ProQuotaDialog.js +23 -0
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js +58 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +56 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js +4 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.js +20 -0
- package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/QwenOAuthProgress.js +5 -4
- package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
- package/dist/src/ui/components/QwenOAuthProgress.test.js +82 -11
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
- package/dist/src/ui/components/SettingsDialog.js +97 -23
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +474 -84
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +5 -2
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
- package/dist/src/ui/components/ShellInputPrompt.js +36 -0
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.js +2 -2
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.js +2 -2
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.js +6 -6
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
- package/dist/src/ui/components/SuggestionsDisplay.js +17 -17
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +14 -29
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ThemeDialog.test.js +75 -0
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
- package/dist/src/ui/components/Tips.js +2 -2
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/UpdateNotification.js +2 -2
- package/dist/src/ui/components/UpdateNotification.js.map +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.js +2 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +14 -11
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +1 -2
- package/dist/src/ui/components/messages/CompressionMessage.js +37 -8
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +2 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +14 -22
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +2 -2
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +2 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +53 -21
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -8
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -2
- package/dist/src/ui/components/messages/ToolGroupMessage.js +18 -10
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +17 -15
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +3 -1
- package/dist/src/ui/components/messages/ToolMessage.js +53 -11
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +34 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +3 -4
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/WarningMessage.js +10 -0
- package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
- package/dist/src/ui/components/shared/EnumSelector.js +44 -0
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +2 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +2 -3
- package/dist/src/ui/components/shared/RadioButtonSelect.js +10 -105
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +115 -92
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -1
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
- package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
- package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +25 -2
- package/dist/src/ui/components/shared/text-buffer.js +296 -187
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +2 -3
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -1
- package/dist/src/ui/components/subagents/create/ColorSelector.js +3 -2
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/CreationSummary.js +6 -5
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -1
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +2 -3
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -1
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +1 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/LocationSelector.js +1 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +2 -2
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -1
- package/dist/src/ui/components/subagents/create/ToolSelector.js +4 -3
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +4 -4
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +1 -2
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +1 -2
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -1
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +9 -10
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.js +47 -0
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
- package/dist/src/ui/components/views/McpStatus.js +77 -0
- package/dist/src/ui/components/views/McpStatus.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
- package/dist/src/ui/components/views/McpStatus.test.js +117 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
- package/dist/src/ui/components/views/ToolsList.js +7 -0
- package/dist/src/ui/components/views/ToolsList.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ToolsList.test.js +45 -0
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/AppContext.d.ts +11 -0
- package/dist/src/ui/contexts/AppContext.js +15 -0
- package/dist/src/ui/contexts/AppContext.js.map +1 -0
- package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
- package/dist/src/ui/contexts/ConfigContext.js +16 -0
- package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +3 -0
- package/dist/src/ui/contexts/KeypressContext.js +309 -44
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +288 -2
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +6 -0
- package/dist/src/ui/contexts/SessionContext.js +107 -5
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
- package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
- package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +45 -0
- package/dist/src/ui/contexts/UIActionsContext.js +21 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/UIStateContext.d.ts +117 -0
- package/dist/src/ui/contexts/UIStateContext.js +17 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +12 -12
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +21 -19
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
- package/dist/src/ui/hooks/keyToAnsi.js +67 -0
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +65 -15
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +196 -17
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +20 -2
- package/dist/src/ui/hooks/slashCommandProcessor.js +41 -82
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +3 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +20 -18
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +43 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +21 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +116 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +243 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.js +10 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +6 -10
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +14 -3
- package/dist/src/ui/hooks/useGeminiStream.js +173 -79
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +15 -18
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +49 -53
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js +81 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +234 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +57 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
- package/dist/src/ui/hooks/useMessageQueue.js +5 -3
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +9 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
- package/dist/src/ui/hooks/useModelCommand.js +21 -0
- package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +78 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +182 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +11 -8
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +269 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
- package/dist/src/ui/hooks/useReactToolScheduler.js +23 -17
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
- package/dist/src/ui/hooks/useSelectionList.js +245 -0
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSelectionList.test.js +701 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +281 -67
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +4 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +390 -65
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useStateAndRef.d.ts +1 -1
- package/dist/src/ui/hooks/useStateAndRef.js +2 -2
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +3 -14
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +64 -291
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useWelcomeBack.js +2 -2
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.js +2 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +17 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.d.ts +9 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js +13 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js +14 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
- package/dist/src/ui/models/availableModels.d.ts +3 -0
- package/dist/src/ui/models/availableModels.js +27 -3
- package/dist/src/ui/models/availableModels.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +28 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
- package/dist/src/ui/state/extensions.d.ts +42 -0
- package/dist/src/ui/state/extensions.js +62 -0
- package/dist/src/ui/state/extensions.js.map +1 -0
- package/dist/src/ui/themes/ayu.js +1 -1
- package/dist/src/ui/themes/dracula.js +2 -2
- package/dist/src/ui/themes/github-dark.js +1 -1
- package/dist/src/ui/themes/theme.js +19 -19
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +79 -3
- package/dist/src/ui/types.js +14 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +3 -2
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -7
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +11 -11
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +95 -87
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +4 -4
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +5 -6
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.d.ts +1 -0
- package/dist/src/ui/utils/displayUtils.js +7 -4
- package/dist/src/ui/utils/displayUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.test.js +37 -18
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -1
- package/dist/src/ui/utils/highlight.d.ts +11 -0
- package/dist/src/ui/utils/highlight.js +78 -0
- package/dist/src/ui/utils/highlight.js.map +1 -0
- package/dist/src/ui/utils/highlight.test.d.ts +6 -0
- package/dist/src/ui/utils/highlight.test.js +120 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +39 -29
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
- package/dist/src/ui/utils/platformConstants.d.ts +24 -1
- package/dist/src/ui/utils/platformConstants.js +26 -1
- package/dist/src/ui/utils/platformConstants.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +10 -0
- package/dist/src/ui/utils/textUtils.js +108 -3
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/textUtils.test.js +132 -0
- package/dist/src/ui/utils/textUtils.test.js.map +1 -0
- package/dist/src/utils/commands.d.ts +20 -0
- package/dist/src/utils/commands.js +53 -0
- package/dist/src/utils/commands.js.map +1 -0
- package/dist/src/utils/commands.test.d.ts +6 -0
- package/dist/src/utils/commands.test.js +115 -0
- package/dist/src/utils/commands.test.js.map +1 -0
- package/dist/src/utils/commentJson.d.ts +9 -0
- package/dist/src/utils/commentJson.js +48 -0
- package/dist/src/utils/commentJson.js.map +1 -0
- package/dist/src/utils/commentJson.test.d.ts +6 -0
- package/dist/src/utils/commentJson.test.js +146 -0
- package/dist/src/utils/commentJson.test.js.map +1 -0
- package/dist/src/utils/deepMerge.d.ts +9 -0
- package/dist/src/utils/deepMerge.js +58 -0
- package/dist/src/utils/deepMerge.js.map +1 -0
- package/dist/src/utils/deepMerge.test.d.ts +6 -0
- package/dist/src/utils/deepMerge.test.js +143 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -0
- package/dist/src/utils/envVarResolver.d.ts +39 -0
- package/dist/src/utils/envVarResolver.js +97 -0
- package/dist/src/utils/envVarResolver.js.map +1 -0
- package/dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/dist/src/utils/envVarResolver.test.js +221 -0
- package/dist/src/utils/envVarResolver.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +21 -0
- package/dist/src/utils/errors.js +93 -0
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +303 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/events.d.ts +2 -1
- package/dist/src/utils/events.js +1 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/math.d.ts +13 -0
- package/dist/src/utils/math.js +14 -0
- package/dist/src/utils/math.js.map +1 -0
- package/dist/src/utils/processUtils.d.ts +13 -0
- package/dist/src/utils/processUtils.js +18 -0
- package/dist/src/utils/processUtils.js.map +1 -0
- package/dist/src/utils/processUtils.test.d.ts +6 -0
- package/dist/src/utils/processUtils.test.js +20 -0
- package/dist/src/utils/processUtils.test.js.map +1 -0
- package/dist/src/utils/relaunch.d.ts +7 -0
- package/dist/src/utils/relaunch.js +57 -0
- package/dist/src/utils/relaunch.js.map +1 -0
- package/dist/src/utils/relaunch.test.d.ts +6 -0
- package/dist/src/utils/relaunch.test.js +273 -0
- package/dist/src/utils/relaunch.test.js.map +1 -0
- package/dist/src/utils/sandbox.d.ts +1 -1
- package/dist/src/utils/sandbox.js +42 -17
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +16 -6
- package/dist/src/utils/settingsUtils.js +35 -25
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/settingsUtils.test.js +455 -158
- package/dist/src/utils/settingsUtils.test.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.d.ts +1 -1
- package/dist/src/utils/userStartupWarnings.js +1 -1
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/windowTitle.d.ts +12 -0
- package/dist/src/utils/windowTitle.js +19 -0
- package/dist/src/utils/windowTitle.js.map +1 -0
- package/dist/src/utils/windowTitle.test.d.ts +6 -0
- package/dist/src/utils/windowTitle.test.js +49 -0
- package/dist/src/utils/windowTitle.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +4 -2
- package/dist/src/validateNonInterActiveAuth.js +33 -12
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +1 -0
- package/dist/src/zed-integration/fileSystemService.js +3 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -1
- package/dist/src/zed-integration/schema.d.ts +310 -310
- package/dist/src/zed-integration/zedIntegration.d.ts +8 -1
- package/dist/src/zed-integration/zedIntegration.js +32 -15
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -10
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.js.map +0 -1
- package/dist/src/ui/components/ModelSelectionDialog.d.ts +0 -14
- package/dist/src/ui/components/ModelSelectionDialog.js +0 -26
- package/dist/src/ui/components/ModelSelectionDialog.js.map +0 -1
- package/dist/src/ui/components/ModelSelectionDialog.test.js +0 -124
- package/dist/src/ui/components/ModelSelectionDialog.test.js.map +0 -1
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- /package/dist/src/{ui/components/AuthDialog.test.d.ts → commands/extensions/new.test.d.ts} +0 -0
- /package/dist/src/ui/{components → auth}/AuthDialog.d.ts +0 -0
- /package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +0 -0
|
@@ -8,9 +8,8 @@ import fs from 'node:fs';
|
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
import pathMod from 'node:path';
|
|
10
10
|
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
|
11
|
-
import stringWidth from 'string-width';
|
|
12
11
|
import { unescapePath } from '@rdmind/rdmind-core';
|
|
13
|
-
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, } from '../../utils/textUtils.js';
|
|
12
|
+
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, getCachedStringWidth, } from '../../utils/textUtils.js';
|
|
14
13
|
import { handleVimAction } from './vim-buffer-actions.js';
|
|
15
14
|
// Simple helper for word‑wise ops.
|
|
16
15
|
function isWordChar(ch) {
|
|
@@ -455,12 +454,12 @@ export function logicalPosToOffset(lines, row, col) {
|
|
|
455
454
|
}
|
|
456
455
|
return offset;
|
|
457
456
|
}
|
|
458
|
-
//
|
|
459
|
-
|
|
457
|
+
// Calculates the visual wrapping of lines and the mapping between logical and visual coordinates.
|
|
458
|
+
// This is an expensive operation and should be memoized.
|
|
459
|
+
function calculateLayout(logicalLines, viewportWidth) {
|
|
460
460
|
const visualLines = [];
|
|
461
461
|
const logicalToVisualMap = [];
|
|
462
462
|
const visualToLogicalMap = [];
|
|
463
|
-
let currentVisualCursor = [0, 0];
|
|
464
463
|
logicalLines.forEach((logLine, logIndex) => {
|
|
465
464
|
logicalToVisualMap[logIndex] = [];
|
|
466
465
|
if (logLine.length === 0) {
|
|
@@ -468,9 +467,6 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
468
467
|
logicalToVisualMap[logIndex].push([visualLines.length, 0]);
|
|
469
468
|
visualToLogicalMap.push([logIndex, 0]);
|
|
470
469
|
visualLines.push('');
|
|
471
|
-
if (logIndex === logicalCursor[0] && logicalCursor[1] === 0) {
|
|
472
|
-
currentVisualCursor = [visualLines.length - 1, 0];
|
|
473
|
-
}
|
|
474
470
|
}
|
|
475
471
|
else {
|
|
476
472
|
// Non-empty logical line
|
|
@@ -485,7 +481,7 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
485
481
|
// Iterate through code points to build the current visual line (chunk)
|
|
486
482
|
for (let i = currentPosInLogLine; i < codePointsInLogLine.length; i++) {
|
|
487
483
|
const char = codePointsInLogLine[i];
|
|
488
|
-
const charVisualWidth =
|
|
484
|
+
const charVisualWidth = getCachedStringWidth(char);
|
|
489
485
|
if (currentChunkVisualWidth + charVisualWidth > viewportWidth) {
|
|
490
486
|
// Character would exceed viewport width
|
|
491
487
|
if (lastWordBreakPoint !== -1 &&
|
|
@@ -551,27 +547,6 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
551
547
|
]);
|
|
552
548
|
visualToLogicalMap.push([logIndex, currentPosInLogLine]);
|
|
553
549
|
visualLines.push(currentChunk);
|
|
554
|
-
// Cursor mapping logic
|
|
555
|
-
// Note: currentPosInLogLine here is the start of the currentChunk within the logical line.
|
|
556
|
-
if (logIndex === logicalCursor[0]) {
|
|
557
|
-
const cursorLogCol = logicalCursor[1]; // This is a code point index
|
|
558
|
-
if (cursorLogCol >= currentPosInLogLine &&
|
|
559
|
-
cursorLogCol < currentPosInLogLine + numCodePointsInChunk // Cursor is within this chunk
|
|
560
|
-
) {
|
|
561
|
-
currentVisualCursor = [
|
|
562
|
-
visualLines.length - 1,
|
|
563
|
-
cursorLogCol - currentPosInLogLine, // Visual col is also code point index within visual line
|
|
564
|
-
];
|
|
565
|
-
}
|
|
566
|
-
else if (cursorLogCol === currentPosInLogLine + numCodePointsInChunk &&
|
|
567
|
-
numCodePointsInChunk > 0) {
|
|
568
|
-
// Cursor is exactly at the end of this non-empty chunk
|
|
569
|
-
currentVisualCursor = [
|
|
570
|
-
visualLines.length - 1,
|
|
571
|
-
numCodePointsInChunk,
|
|
572
|
-
];
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
550
|
const logicalStartOfThisChunk = currentPosInLogLine;
|
|
576
551
|
currentPosInLogLine += numCodePointsInChunk;
|
|
577
552
|
// If the chunk processed did not consume the entire logical line,
|
|
@@ -584,20 +559,6 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
584
559
|
currentPosInLogLine++;
|
|
585
560
|
}
|
|
586
561
|
}
|
|
587
|
-
// After all chunks of a non-empty logical line are processed,
|
|
588
|
-
// if the cursor is at the very end of this logical line, update visual cursor.
|
|
589
|
-
if (logIndex === logicalCursor[0] &&
|
|
590
|
-
logicalCursor[1] === codePointsInLogLine.length // Cursor at end of logical line
|
|
591
|
-
) {
|
|
592
|
-
const lastVisualLineIdx = visualLines.length - 1;
|
|
593
|
-
if (lastVisualLineIdx >= 0 &&
|
|
594
|
-
visualLines[lastVisualLineIdx] !== undefined) {
|
|
595
|
-
currentVisualCursor = [
|
|
596
|
-
lastVisualLineIdx,
|
|
597
|
-
cpLen(visualLines[lastVisualLineIdx]), // Cursor at end of last visual line for this logical line
|
|
598
|
-
];
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
562
|
}
|
|
602
563
|
});
|
|
603
564
|
// If the entire logical text was empty, ensure there's one empty visual line.
|
|
@@ -610,23 +571,46 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
610
571
|
logicalToVisualMap[0].push([0, 0]);
|
|
611
572
|
visualToLogicalMap.push([0, 0]);
|
|
612
573
|
}
|
|
613
|
-
currentVisualCursor = [0, 0];
|
|
614
|
-
}
|
|
615
|
-
// Handle cursor at the very end of the text (after all processing)
|
|
616
|
-
// This case might be covered by the loop end condition now, but kept for safety.
|
|
617
|
-
else if (logicalCursor[0] === logicalLines.length - 1 &&
|
|
618
|
-
logicalCursor[1] === cpLen(logicalLines[logicalLines.length - 1]) &&
|
|
619
|
-
visualLines.length > 0) {
|
|
620
|
-
const lastVisLineIdx = visualLines.length - 1;
|
|
621
|
-
currentVisualCursor = [lastVisLineIdx, cpLen(visualLines[lastVisLineIdx])];
|
|
622
574
|
}
|
|
623
575
|
return {
|
|
624
576
|
visualLines,
|
|
625
|
-
visualCursor: currentVisualCursor,
|
|
626
577
|
logicalToVisualMap,
|
|
627
578
|
visualToLogicalMap,
|
|
628
579
|
};
|
|
629
580
|
}
|
|
581
|
+
// Calculates the visual cursor position based on a pre-calculated layout.
|
|
582
|
+
// This is a lightweight operation.
|
|
583
|
+
function calculateVisualCursorFromLayout(layout, logicalCursor) {
|
|
584
|
+
const { logicalToVisualMap, visualLines } = layout;
|
|
585
|
+
const [logicalRow, logicalCol] = logicalCursor;
|
|
586
|
+
const segmentsForLogicalLine = logicalToVisualMap[logicalRow];
|
|
587
|
+
if (!segmentsForLogicalLine || segmentsForLogicalLine.length === 0) {
|
|
588
|
+
// This can happen for an empty document.
|
|
589
|
+
return [0, 0];
|
|
590
|
+
}
|
|
591
|
+
// Find the segment where the logical column fits.
|
|
592
|
+
// The segments are sorted by startColInLogical.
|
|
593
|
+
let targetSegmentIndex = segmentsForLogicalLine.findIndex(([, startColInLogical], index) => {
|
|
594
|
+
const nextStartColInLogical = index + 1 < segmentsForLogicalLine.length
|
|
595
|
+
? segmentsForLogicalLine[index + 1][1]
|
|
596
|
+
: Infinity;
|
|
597
|
+
return (logicalCol >= startColInLogical && logicalCol < nextStartColInLogical);
|
|
598
|
+
});
|
|
599
|
+
// If not found, it means the cursor is at the end of the logical line.
|
|
600
|
+
if (targetSegmentIndex === -1) {
|
|
601
|
+
if (logicalCol === 0) {
|
|
602
|
+
targetSegmentIndex = 0;
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
targetSegmentIndex = segmentsForLogicalLine.length - 1;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
const [visualRow, startColInLogical] = segmentsForLogicalLine[targetSegmentIndex];
|
|
609
|
+
const visualCol = logicalCol - startColInLogical;
|
|
610
|
+
// The visual column should not exceed the length of the visual line.
|
|
611
|
+
const clampedVisualCol = Math.min(visualCol, cpLen(visualLines[visualRow] ?? ''));
|
|
612
|
+
return [visualRow, clampedVisualCol];
|
|
613
|
+
}
|
|
630
614
|
const historyLimit = 100;
|
|
631
615
|
export const pushUndo = (currentState) => {
|
|
632
616
|
const snapshot = {
|
|
@@ -640,7 +624,7 @@ export const pushUndo = (currentState) => {
|
|
|
640
624
|
}
|
|
641
625
|
return { ...currentState, undoStack: newStack, redoStack: [] };
|
|
642
626
|
};
|
|
643
|
-
|
|
627
|
+
function textBufferReducerLogic(state, action) {
|
|
644
628
|
const pushUndoLocal = pushUndo;
|
|
645
629
|
const currentLine = (r) => state.lines[r] ?? '';
|
|
646
630
|
const currentLineLen = (r) => cpLen(currentLine(r));
|
|
@@ -727,68 +711,101 @@ export function textBufferReducer(state, action) {
|
|
|
727
711
|
preferredCol: null,
|
|
728
712
|
};
|
|
729
713
|
}
|
|
730
|
-
case '
|
|
731
|
-
|
|
714
|
+
case 'set_viewport': {
|
|
715
|
+
const { width, height } = action.payload;
|
|
716
|
+
if (width === state.viewportWidth && height === state.viewportHeight) {
|
|
732
717
|
return state;
|
|
733
718
|
}
|
|
734
|
-
return {
|
|
719
|
+
return {
|
|
720
|
+
...state,
|
|
721
|
+
viewportWidth: width,
|
|
722
|
+
viewportHeight: height,
|
|
723
|
+
};
|
|
735
724
|
}
|
|
736
725
|
case 'move': {
|
|
737
726
|
const { dir } = action.payload;
|
|
738
|
-
const {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
727
|
+
const { cursorRow, cursorCol, lines, visualLayout, preferredCol } = state;
|
|
728
|
+
// Visual movements
|
|
729
|
+
if (dir === 'left' ||
|
|
730
|
+
dir === 'right' ||
|
|
731
|
+
dir === 'up' ||
|
|
732
|
+
dir === 'down' ||
|
|
733
|
+
dir === 'home' ||
|
|
734
|
+
dir === 'end') {
|
|
735
|
+
const visualCursor = calculateVisualCursorFromLayout(visualLayout, [
|
|
736
|
+
cursorRow,
|
|
737
|
+
cursorCol,
|
|
738
|
+
]);
|
|
739
|
+
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
740
|
+
let newVisualRow = visualCursor[0];
|
|
741
|
+
let newVisualCol = visualCursor[1];
|
|
742
|
+
let newPreferredCol = preferredCol;
|
|
743
|
+
const currentVisLineLen = cpLen(visualLines[newVisualRow] ?? '');
|
|
744
|
+
switch (dir) {
|
|
745
|
+
case 'left':
|
|
746
|
+
newPreferredCol = null;
|
|
747
|
+
if (newVisualCol > 0) {
|
|
748
|
+
newVisualCol--;
|
|
749
|
+
}
|
|
750
|
+
else if (newVisualRow > 0) {
|
|
751
|
+
newVisualRow--;
|
|
752
|
+
newVisualCol = cpLen(visualLines[newVisualRow] ?? '');
|
|
753
|
+
}
|
|
754
|
+
break;
|
|
755
|
+
case 'right':
|
|
756
|
+
newPreferredCol = null;
|
|
757
|
+
if (newVisualCol < currentVisLineLen) {
|
|
758
|
+
newVisualCol++;
|
|
759
|
+
}
|
|
760
|
+
else if (newVisualRow < visualLines.length - 1) {
|
|
761
|
+
newVisualRow++;
|
|
762
|
+
newVisualCol = 0;
|
|
763
|
+
}
|
|
764
|
+
break;
|
|
765
|
+
case 'up':
|
|
766
|
+
if (newVisualRow > 0) {
|
|
767
|
+
if (newPreferredCol === null)
|
|
768
|
+
newPreferredCol = newVisualCol;
|
|
769
|
+
newVisualRow--;
|
|
770
|
+
newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
|
|
771
|
+
}
|
|
772
|
+
break;
|
|
773
|
+
case 'down':
|
|
774
|
+
if (newVisualRow < visualLines.length - 1) {
|
|
775
|
+
if (newPreferredCol === null)
|
|
776
|
+
newPreferredCol = newVisualCol;
|
|
777
|
+
newVisualRow++;
|
|
778
|
+
newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
|
|
779
|
+
}
|
|
780
|
+
break;
|
|
781
|
+
case 'home':
|
|
782
|
+
newPreferredCol = null;
|
|
763
783
|
newVisualCol = 0;
|
|
784
|
+
break;
|
|
785
|
+
case 'end':
|
|
786
|
+
newPreferredCol = null;
|
|
787
|
+
newVisualCol = currentVisLineLen;
|
|
788
|
+
break;
|
|
789
|
+
default: {
|
|
790
|
+
const exhaustiveCheck = dir;
|
|
791
|
+
console.error(`Unknown visual movement direction: ${exhaustiveCheck}`);
|
|
792
|
+
return state;
|
|
764
793
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
|
|
780
|
-
}
|
|
781
|
-
break;
|
|
782
|
-
case 'home':
|
|
783
|
-
newPreferredCol = null;
|
|
784
|
-
newVisualCol = 0;
|
|
785
|
-
break;
|
|
786
|
-
case 'end':
|
|
787
|
-
newPreferredCol = null;
|
|
788
|
-
newVisualCol = currentVisLineLen;
|
|
789
|
-
break;
|
|
794
|
+
}
|
|
795
|
+
if (visualToLogicalMap[newVisualRow]) {
|
|
796
|
+
const [logRow, logStartCol] = visualToLogicalMap[newVisualRow];
|
|
797
|
+
return {
|
|
798
|
+
...state,
|
|
799
|
+
cursorRow: logRow,
|
|
800
|
+
cursorCol: clamp(logStartCol + newVisualCol, 0, cpLen(lines[logRow] ?? '')),
|
|
801
|
+
preferredCol: newPreferredCol,
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
return state;
|
|
805
|
+
}
|
|
806
|
+
// Logical movements
|
|
807
|
+
switch (dir) {
|
|
790
808
|
case 'wordLeft': {
|
|
791
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
792
809
|
if (cursorCol === 0 && cursorRow === 0)
|
|
793
810
|
return state;
|
|
794
811
|
let newCursorRow = cursorRow;
|
|
@@ -827,7 +844,6 @@ export function textBufferReducer(state, action) {
|
|
|
827
844
|
};
|
|
828
845
|
}
|
|
829
846
|
case 'wordRight': {
|
|
830
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
831
847
|
if (cursorRow === lines.length - 1 &&
|
|
832
848
|
cursorCol === cpLen(lines[cursorRow] ?? '')) {
|
|
833
849
|
return state;
|
|
@@ -856,18 +872,14 @@ export function textBufferReducer(state, action) {
|
|
|
856
872
|
};
|
|
857
873
|
}
|
|
858
874
|
default:
|
|
859
|
-
|
|
875
|
+
return state;
|
|
860
876
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
preferredCol: newPreferredCol,
|
|
868
|
-
};
|
|
869
|
-
}
|
|
870
|
-
return state;
|
|
877
|
+
}
|
|
878
|
+
case 'set_cursor': {
|
|
879
|
+
return {
|
|
880
|
+
...state,
|
|
881
|
+
...action.payload,
|
|
882
|
+
};
|
|
871
883
|
}
|
|
872
884
|
case 'delete': {
|
|
873
885
|
const { cursorRow, cursorCol, lines } = state;
|
|
@@ -878,7 +890,11 @@ export function textBufferReducer(state, action) {
|
|
|
878
890
|
newLines[cursorRow] =
|
|
879
891
|
cpSlice(lineContent, 0, cursorCol) +
|
|
880
892
|
cpSlice(lineContent, cursorCol + 1);
|
|
881
|
-
return {
|
|
893
|
+
return {
|
|
894
|
+
...nextState,
|
|
895
|
+
lines: newLines,
|
|
896
|
+
preferredCol: null,
|
|
897
|
+
};
|
|
882
898
|
}
|
|
883
899
|
else if (cursorRow < lines.length - 1) {
|
|
884
900
|
const nextState = pushUndoLocal(state);
|
|
@@ -886,7 +902,11 @@ export function textBufferReducer(state, action) {
|
|
|
886
902
|
const newLines = [...nextState.lines];
|
|
887
903
|
newLines[cursorRow] = lineContent + nextLineContent;
|
|
888
904
|
newLines.splice(cursorRow + 1, 1);
|
|
889
|
-
return {
|
|
905
|
+
return {
|
|
906
|
+
...nextState,
|
|
907
|
+
lines: newLines,
|
|
908
|
+
preferredCol: null,
|
|
909
|
+
};
|
|
890
910
|
}
|
|
891
911
|
return state;
|
|
892
912
|
}
|
|
@@ -894,78 +914,62 @@ export function textBufferReducer(state, action) {
|
|
|
894
914
|
const { cursorRow, cursorCol } = state;
|
|
895
915
|
if (cursorCol === 0 && cursorRow === 0)
|
|
896
916
|
return state;
|
|
897
|
-
|
|
917
|
+
const nextState = pushUndoLocal(state);
|
|
918
|
+
const newLines = [...nextState.lines];
|
|
919
|
+
let newCursorRow = cursorRow;
|
|
920
|
+
let newCursorCol = cursorCol;
|
|
921
|
+
if (newCursorCol > 0) {
|
|
922
|
+
const lineContent = currentLine(newCursorRow);
|
|
923
|
+
const prevWordStart = findPrevWordStartInLine(lineContent, newCursorCol);
|
|
924
|
+
const start = prevWordStart === null ? 0 : prevWordStart;
|
|
925
|
+
newLines[newCursorRow] =
|
|
926
|
+
cpSlice(lineContent, 0, start) + cpSlice(lineContent, newCursorCol);
|
|
927
|
+
newCursorCol = start;
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
898
930
|
// Act as a backspace
|
|
899
|
-
const nextState = pushUndoLocal(state);
|
|
900
931
|
const prevLineContent = currentLine(cursorRow - 1);
|
|
901
932
|
const currentLineContentVal = currentLine(cursorRow);
|
|
902
933
|
const newCol = cpLen(prevLineContent);
|
|
903
|
-
const newLines = [...nextState.lines];
|
|
904
934
|
newLines[cursorRow - 1] = prevLineContent + currentLineContentVal;
|
|
905
935
|
newLines.splice(cursorRow, 1);
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
lines: newLines,
|
|
909
|
-
cursorRow: cursorRow - 1,
|
|
910
|
-
cursorCol: newCol,
|
|
911
|
-
preferredCol: null,
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
const nextState = pushUndoLocal(state);
|
|
915
|
-
const lineContent = currentLine(cursorRow);
|
|
916
|
-
const arr = toCodePoints(lineContent);
|
|
917
|
-
let start = cursorCol;
|
|
918
|
-
let onlySpaces = true;
|
|
919
|
-
for (let i = 0; i < start; i++) {
|
|
920
|
-
if (isWordChar(arr[i])) {
|
|
921
|
-
onlySpaces = false;
|
|
922
|
-
break;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
if (onlySpaces && start > 0) {
|
|
926
|
-
start--;
|
|
927
|
-
}
|
|
928
|
-
else {
|
|
929
|
-
while (start > 0 && !isWordChar(arr[start - 1]))
|
|
930
|
-
start--;
|
|
931
|
-
while (start > 0 && isWordChar(arr[start - 1]))
|
|
932
|
-
start--;
|
|
936
|
+
newCursorRow--;
|
|
937
|
+
newCursorCol = newCol;
|
|
933
938
|
}
|
|
934
|
-
const newLines = [...nextState.lines];
|
|
935
|
-
newLines[cursorRow] =
|
|
936
|
-
cpSlice(lineContent, 0, start) + cpSlice(lineContent, cursorCol);
|
|
937
939
|
return {
|
|
938
940
|
...nextState,
|
|
939
941
|
lines: newLines,
|
|
940
|
-
|
|
942
|
+
cursorRow: newCursorRow,
|
|
943
|
+
cursorCol: newCursorCol,
|
|
941
944
|
preferredCol: null,
|
|
942
945
|
};
|
|
943
946
|
}
|
|
944
947
|
case 'delete_word_right': {
|
|
945
948
|
const { cursorRow, cursorCol, lines } = state;
|
|
946
949
|
const lineContent = currentLine(cursorRow);
|
|
947
|
-
const
|
|
948
|
-
if (cursorCol >=
|
|
950
|
+
const lineLen = cpLen(lineContent);
|
|
951
|
+
if (cursorCol >= lineLen && cursorRow === lines.length - 1) {
|
|
949
952
|
return state;
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
+
}
|
|
954
|
+
const nextState = pushUndoLocal(state);
|
|
955
|
+
const newLines = [...nextState.lines];
|
|
956
|
+
if (cursorCol >= lineLen) {
|
|
957
|
+
// Act as a delete, joining with the next line
|
|
953
958
|
const nextLineContent = currentLine(cursorRow + 1);
|
|
954
|
-
const newLines = [...nextState.lines];
|
|
955
959
|
newLines[cursorRow] = lineContent + nextLineContent;
|
|
956
960
|
newLines.splice(cursorRow + 1, 1);
|
|
957
|
-
return { ...nextState, lines: newLines, preferredCol: null };
|
|
958
961
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
962
|
+
else {
|
|
963
|
+
const nextWordStart = findNextWordStartInLine(lineContent, cursorCol);
|
|
964
|
+
const end = nextWordStart === null ? lineLen : nextWordStart;
|
|
965
|
+
newLines[cursorRow] =
|
|
966
|
+
cpSlice(lineContent, 0, cursorCol) + cpSlice(lineContent, end);
|
|
967
|
+
}
|
|
968
|
+
return {
|
|
969
|
+
...nextState,
|
|
970
|
+
lines: newLines,
|
|
971
|
+
preferredCol: null,
|
|
972
|
+
};
|
|
969
973
|
}
|
|
970
974
|
case 'kill_line_right': {
|
|
971
975
|
const { cursorRow, cursorCol, lines } = state;
|
|
@@ -974,7 +978,10 @@ export function textBufferReducer(state, action) {
|
|
|
974
978
|
const nextState = pushUndoLocal(state);
|
|
975
979
|
const newLines = [...nextState.lines];
|
|
976
980
|
newLines[cursorRow] = cpSlice(lineContent, 0, cursorCol);
|
|
977
|
-
return {
|
|
981
|
+
return {
|
|
982
|
+
...nextState,
|
|
983
|
+
lines: newLines,
|
|
984
|
+
};
|
|
978
985
|
}
|
|
979
986
|
else if (cursorRow < lines.length - 1) {
|
|
980
987
|
// Act as a delete
|
|
@@ -983,7 +990,11 @@ export function textBufferReducer(state, action) {
|
|
|
983
990
|
const newLines = [...nextState.lines];
|
|
984
991
|
newLines[cursorRow] = lineContent + nextLineContent;
|
|
985
992
|
newLines.splice(cursorRow + 1, 1);
|
|
986
|
-
return {
|
|
993
|
+
return {
|
|
994
|
+
...nextState,
|
|
995
|
+
lines: newLines,
|
|
996
|
+
preferredCol: null,
|
|
997
|
+
};
|
|
987
998
|
}
|
|
988
999
|
return state;
|
|
989
1000
|
}
|
|
@@ -1094,11 +1105,23 @@ export function textBufferReducer(state, action) {
|
|
|
1094
1105
|
}
|
|
1095
1106
|
}
|
|
1096
1107
|
}
|
|
1108
|
+
export function textBufferReducer(state, action) {
|
|
1109
|
+
const newState = textBufferReducerLogic(state, action);
|
|
1110
|
+
if (newState.lines !== state.lines ||
|
|
1111
|
+
newState.viewportWidth !== state.viewportWidth) {
|
|
1112
|
+
return {
|
|
1113
|
+
...newState,
|
|
1114
|
+
visualLayout: calculateLayout(newState.lines, newState.viewportWidth),
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
return newState;
|
|
1118
|
+
}
|
|
1097
1119
|
// --- End of reducer logic ---
|
|
1098
1120
|
export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, }) {
|
|
1099
1121
|
const initialState = useMemo(() => {
|
|
1100
1122
|
const lines = initialText.split('\n');
|
|
1101
1123
|
const [initialCursorRow, initialCursorCol] = calculateInitialCursorPosition(lines.length === 0 ? [''] : lines, initialCursorOffset);
|
|
1124
|
+
const visualLayout = calculateLayout(lines.length === 0 ? [''] : lines, viewport.width);
|
|
1102
1125
|
return {
|
|
1103
1126
|
lines: lines.length === 0 ? [''] : lines,
|
|
1104
1127
|
cursorRow: initialCursorRow,
|
|
@@ -1109,13 +1132,15 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1109
1132
|
clipboard: null,
|
|
1110
1133
|
selectionAnchor: null,
|
|
1111
1134
|
viewportWidth: viewport.width,
|
|
1135
|
+
viewportHeight: viewport.height,
|
|
1136
|
+
visualLayout,
|
|
1112
1137
|
};
|
|
1113
|
-
}, [initialText, initialCursorOffset, viewport.width]);
|
|
1138
|
+
}, [initialText, initialCursorOffset, viewport.width, viewport.height]);
|
|
1114
1139
|
const [state, dispatch] = useReducer(textBufferReducer, initialState);
|
|
1115
|
-
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor } = state;
|
|
1140
|
+
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, } = state;
|
|
1116
1141
|
const text = useMemo(() => lines.join('\n'), [lines]);
|
|
1117
|
-
const
|
|
1118
|
-
const { visualLines,
|
|
1142
|
+
const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
|
|
1143
|
+
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
1119
1144
|
const [visualScrollRow, setVisualScrollRow] = useState(0);
|
|
1120
1145
|
useEffect(() => {
|
|
1121
1146
|
if (onChange) {
|
|
@@ -1123,11 +1148,16 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1123
1148
|
}
|
|
1124
1149
|
}, [text, onChange]);
|
|
1125
1150
|
useEffect(() => {
|
|
1126
|
-
dispatch({
|
|
1127
|
-
|
|
1151
|
+
dispatch({
|
|
1152
|
+
type: 'set_viewport',
|
|
1153
|
+
payload: { width: viewport.width, height: viewport.height },
|
|
1154
|
+
});
|
|
1155
|
+
}, [viewport.width, viewport.height]);
|
|
1128
1156
|
// Update visual scroll (vertical)
|
|
1129
1157
|
useEffect(() => {
|
|
1130
1158
|
const { height } = viewport;
|
|
1159
|
+
const totalVisualLines = visualLines.length;
|
|
1160
|
+
const maxScrollStart = Math.max(0, totalVisualLines - height);
|
|
1131
1161
|
let newVisualScrollRow = visualScrollRow;
|
|
1132
1162
|
if (visualCursor[0] < visualScrollRow) {
|
|
1133
1163
|
newVisualScrollRow = visualCursor[0];
|
|
@@ -1135,10 +1165,13 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1135
1165
|
else if (visualCursor[0] >= visualScrollRow + height) {
|
|
1136
1166
|
newVisualScrollRow = visualCursor[0] - height + 1;
|
|
1137
1167
|
}
|
|
1168
|
+
// When the number of visual lines shrinks (e.g., after widening the viewport),
|
|
1169
|
+
// ensure scroll never starts beyond the last valid start so we can render a full window.
|
|
1170
|
+
newVisualScrollRow = clamp(newVisualScrollRow, 0, maxScrollStart);
|
|
1138
1171
|
if (newVisualScrollRow !== visualScrollRow) {
|
|
1139
1172
|
setVisualScrollRow(newVisualScrollRow);
|
|
1140
1173
|
}
|
|
1141
|
-
}, [visualCursor, visualScrollRow, viewport]);
|
|
1174
|
+
}, [visualCursor, visualScrollRow, viewport, visualLines.length]);
|
|
1142
1175
|
const insert = useCallback((ch, { paste = false } = {}) => {
|
|
1143
1176
|
if (/[\n\r]/.test(ch)) {
|
|
1144
1177
|
dispatch({ type: 'insert', payload: ch });
|
|
@@ -1186,7 +1219,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1186
1219
|
}, []);
|
|
1187
1220
|
const move = useCallback((dir) => {
|
|
1188
1221
|
dispatch({ type: 'move', payload: { dir } });
|
|
1189
|
-
}, []);
|
|
1222
|
+
}, [dispatch]);
|
|
1190
1223
|
const undo = useCallback(() => {
|
|
1191
1224
|
dispatch({ type: 'undo' });
|
|
1192
1225
|
}, []);
|
|
@@ -1404,10 +1437,24 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1404
1437
|
backspace();
|
|
1405
1438
|
else if (key.name === 'delete' || (key.ctrl && key.name === 'd'))
|
|
1406
1439
|
del();
|
|
1440
|
+
else if (key.ctrl && !key.shift && key.name === 'z')
|
|
1441
|
+
undo();
|
|
1442
|
+
else if (key.ctrl && key.shift && key.name === 'z')
|
|
1443
|
+
redo();
|
|
1407
1444
|
else if (input && !key.ctrl && !key.meta) {
|
|
1408
1445
|
insert(input, { paste: key.paste });
|
|
1409
1446
|
}
|
|
1410
|
-
}, [
|
|
1447
|
+
}, [
|
|
1448
|
+
newline,
|
|
1449
|
+
move,
|
|
1450
|
+
deleteWordLeft,
|
|
1451
|
+
deleteWordRight,
|
|
1452
|
+
backspace,
|
|
1453
|
+
del,
|
|
1454
|
+
insert,
|
|
1455
|
+
undo,
|
|
1456
|
+
redo,
|
|
1457
|
+
]);
|
|
1411
1458
|
const renderedVisualLines = useMemo(() => visualLines.slice(visualScrollRow, visualScrollRow + viewport.height), [visualLines, visualScrollRow, viewport.height]);
|
|
1412
1459
|
const replaceRange = useCallback((startRow, startCol, endRow, endCol, text) => {
|
|
1413
1460
|
dispatch({
|
|
@@ -1423,7 +1470,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1423
1470
|
const moveToOffset = useCallback((offset) => {
|
|
1424
1471
|
dispatch({ type: 'move_to_offset', payload: { offset } });
|
|
1425
1472
|
}, []);
|
|
1426
|
-
const returnValue = {
|
|
1473
|
+
const returnValue = useMemo(() => ({
|
|
1427
1474
|
lines,
|
|
1428
1475
|
text,
|
|
1429
1476
|
cursor: [cursorRow, cursorCol],
|
|
@@ -1433,6 +1480,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1433
1480
|
viewportVisualLines: renderedVisualLines,
|
|
1434
1481
|
visualCursor,
|
|
1435
1482
|
visualScrollRow,
|
|
1483
|
+
visualToLogicalMap,
|
|
1436
1484
|
setText,
|
|
1437
1485
|
insert,
|
|
1438
1486
|
newline,
|
|
@@ -1483,7 +1531,68 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1483
1531
|
vimMoveToLastLine,
|
|
1484
1532
|
vimMoveToLine,
|
|
1485
1533
|
vimEscapeInsertMode,
|
|
1486
|
-
}
|
|
1534
|
+
}), [
|
|
1535
|
+
lines,
|
|
1536
|
+
text,
|
|
1537
|
+
cursorRow,
|
|
1538
|
+
cursorCol,
|
|
1539
|
+
preferredCol,
|
|
1540
|
+
selectionAnchor,
|
|
1541
|
+
visualLines,
|
|
1542
|
+
renderedVisualLines,
|
|
1543
|
+
visualCursor,
|
|
1544
|
+
visualScrollRow,
|
|
1545
|
+
setText,
|
|
1546
|
+
insert,
|
|
1547
|
+
newline,
|
|
1548
|
+
backspace,
|
|
1549
|
+
del,
|
|
1550
|
+
move,
|
|
1551
|
+
undo,
|
|
1552
|
+
redo,
|
|
1553
|
+
replaceRange,
|
|
1554
|
+
replaceRangeByOffset,
|
|
1555
|
+
moveToOffset,
|
|
1556
|
+
deleteWordLeft,
|
|
1557
|
+
deleteWordRight,
|
|
1558
|
+
killLineRight,
|
|
1559
|
+
killLineLeft,
|
|
1560
|
+
handleInput,
|
|
1561
|
+
openInExternalEditor,
|
|
1562
|
+
vimDeleteWordForward,
|
|
1563
|
+
vimDeleteWordBackward,
|
|
1564
|
+
vimDeleteWordEnd,
|
|
1565
|
+
vimChangeWordForward,
|
|
1566
|
+
vimChangeWordBackward,
|
|
1567
|
+
vimChangeWordEnd,
|
|
1568
|
+
vimDeleteLine,
|
|
1569
|
+
vimChangeLine,
|
|
1570
|
+
vimDeleteToEndOfLine,
|
|
1571
|
+
vimChangeToEndOfLine,
|
|
1572
|
+
vimChangeMovement,
|
|
1573
|
+
vimMoveLeft,
|
|
1574
|
+
vimMoveRight,
|
|
1575
|
+
vimMoveUp,
|
|
1576
|
+
vimMoveDown,
|
|
1577
|
+
vimMoveWordForward,
|
|
1578
|
+
vimMoveWordBackward,
|
|
1579
|
+
vimMoveWordEnd,
|
|
1580
|
+
vimDeleteChar,
|
|
1581
|
+
vimInsertAtCursor,
|
|
1582
|
+
vimAppendAtCursor,
|
|
1583
|
+
vimOpenLineBelow,
|
|
1584
|
+
vimOpenLineAbove,
|
|
1585
|
+
vimAppendAtLineEnd,
|
|
1586
|
+
vimInsertAtLineStart,
|
|
1587
|
+
vimMoveToLineStart,
|
|
1588
|
+
vimMoveToLineEnd,
|
|
1589
|
+
vimMoveToFirstNonWhitespace,
|
|
1590
|
+
vimMoveToFirstLine,
|
|
1591
|
+
vimMoveToLastLine,
|
|
1592
|
+
vimMoveToLine,
|
|
1593
|
+
vimEscapeInsertMode,
|
|
1594
|
+
visualToLogicalMap,
|
|
1595
|
+
]);
|
|
1487
1596
|
return returnValue;
|
|
1488
1597
|
}
|
|
1489
1598
|
//# sourceMappingURL=text-buffer.js.map
|