@umsai/ums-code 0.0.14-v1 → 0.1.4-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 +19 -11
- package/dist/src/commands/extensions/disable.d.ts +13 -0
- package/dist/src/commands/extensions/disable.js +56 -0
- package/dist/src/commands/extensions/disable.js.map +1 -0
- package/dist/src/commands/extensions/enable.d.ts +13 -0
- package/dist/src/commands/extensions/enable.js +59 -0
- package/dist/src/commands/extensions/enable.js.map +1 -0
- 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 +14 -0
- package/dist/src/commands/extensions/install.js +78 -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 +102 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -0
- 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.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/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.d.ts +6 -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.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 +13 -0
- package/dist/src/commands/extensions/update.js +104 -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 +33 -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 +172 -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 +111 -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.d.ts +2 -4
- package/dist/src/config/auth.js +15 -40
- 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 +37 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/config.d.ts +17 -10
- package/dist/src/config/config.js +379 -196
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +64 -3
- package/dist/src/config/extension.js +477 -61
- 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/config/extensions/extensionEnablement.test.d.ts +6 -0
- 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 +36 -0
- package/dist/src/config/extensions/variableSchema.js +22 -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 +70 -0
- package/dist/src/config/keyBindings.js +130 -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 +22 -72
- package/dist/src/config/settings.js +425 -151
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +1102 -0
- package/dist/src/config/settingsSchema.js +1068 -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 +201 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +56 -0
- package/dist/src/config/trustedFolders.js +168 -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 +340 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- 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 +4 -1
- package/dist/src/gemini.js +202 -154
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +390 -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 +3 -2
- package/dist/src/nonInteractiveCli.js +101 -88
- 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.d.ts +3 -4
- package/dist/src/services/BuiltinCommandLoader.js +18 -7
- 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 +164 -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 +5 -3
- package/dist/src/services/FileCommandLoader.js +38 -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 +89 -28
- 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 +341 -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 +92 -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/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/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 +92 -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 +12 -0
- package/dist/src/test-utils/render.js +14 -0
- package/dist/src/test-utils/render.js.map +1 -0
- package/dist/src/ui/App.d.ts +1 -10
- package/dist/src/ui/App.js +27 -562
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +17 -0
- package/dist/src/ui/AppContainer.js +1069 -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 +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +50 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthDialog.d.ts +7 -3
- package/dist/src/ui/{components → auth}/AuthDialog.js +42 -44
- 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/auth/AuthDialog.test.js +362 -0
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +1 -1
- package/dist/src/ui/auth/AuthInProgress.js +23 -0
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +24 -0
- package/dist/src/ui/auth/useAuth.js +108 -0
- package/dist/src/ui/auth/useAuth.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 +16 -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 +27 -5
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +3 -1
- package/dist/src/ui/commands/chatCommand.js +120 -12
- 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 +1 -2
- 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/corgiCommand.js +1 -0
- package/dist/src/ui/commands/corgiCommand.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/extensionsCommand.js +92 -15
- package/dist/src/ui/commands/extensionsCommand.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 -3
- package/dist/src/ui/commands/ideCommand.js +107 -28
- 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 +98 -269
- 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 +53 -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 +137 -0
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/{privacyCommand.js → permissionsCommand.js} +5 -5
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
- package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
- 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 +11 -25
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +31 -11
- 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 +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/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/AutoAcceptIndicator.d.ts +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.js +12 -7
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +24 -26
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +12 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +36 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.js +7 -6
- 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 +8 -8
- 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 +130 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +4 -3
- package/dist/src/ui/components/EditorSettingsDialog.js +30 -23
- 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.d.ts +17 -0
- package/dist/src/ui/components/FolderTrustDialog.js +58 -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 +88 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +2 -17
- package/dist/src/ui/components/Footer.js +38 -6
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +6 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.js +10 -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 +14 -6
- 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 +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 +7 -6
- package/dist/src/ui/components/HistoryItemDisplay.js +14 -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 +174 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- 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 +15 -5
- package/dist/src/ui/components/InputPrompt.js +407 -76
- 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 +11 -6
- 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 +194 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- 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.d.ts +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.js +6 -9
- 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.d.ts +1 -1
- 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.d.ts +17 -0
- package/dist/src/ui/components/ModelSwitchDialog.js +41 -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 +129 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -0
- 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.d.ts +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.js +63 -44
- 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 +51 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -0
- 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/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 +4 -4
- 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.d.ts +17 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js +48 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -0
- 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.d.ts +2 -2
- package/dist/src/ui/components/QwenOAuthProgress.js +7 -11
- 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 +363 -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 +16 -0
- package/dist/src/ui/components/SettingsDialog.js +624 -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 +1036 -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 +12 -7
- 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/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.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.js +10 -9
- 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 +16 -8
- 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 +25 -55
- 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.d.ts +1 -1
- package/dist/src/ui/components/Tips.js +3 -2
- 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/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.d.ts +13 -0
- package/dist/src/ui/components/WelcomeBackDialog.js +34 -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 +45 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +2 -3
- package/dist/src/ui/components/messages/CompressionMessage.js +38 -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 +3 -2
- package/dist/src/ui/components/messages/DiffRenderer.js +22 -17
- 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/ErrorMessage.js +2 -2
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +3 -2
- 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 +7 -2
- 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 +149 -38
- 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 +165 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +5 -4
- package/dist/src/ui/components/messages/ToolGroupMessage.js +18 -15
- 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 +261 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +5 -1
- package/dist/src/ui/components/messages/ToolMessage.js +135 -16
- 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 +182 -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 +6 -5
- 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/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 +3 -3
- 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 +3 -4
- package/dist/src/ui/components/shared/RadioButtonSelect.js +11 -109
- 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 +134 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- 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/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 +42 -6
- package/dist/src/ui/components/shared/text-buffer.js +530 -283
- 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 +173 -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 +43 -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 +164 -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 +104 -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 +34 -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 +34 -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 +144 -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 +64 -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 +224 -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 +211 -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 +193 -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.d.ts +2 -2
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +67 -65
- 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/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 +9 -0
- package/dist/src/ui/constants.js +10 -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 +35 -0
- package/dist/src/ui/contexts/KeypressContext.js +636 -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 +1180 -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 +11 -3
- package/dist/src/ui/contexts/SessionContext.js +110 -21
- 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/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/StreamingContext.d.ts +1 -1
- 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/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 +29 -29
- 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 +834 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- 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 +5 -4
- package/dist/src/ui/hooks/shellCommandProcessor.js +76 -30
- 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 +508 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +32 -7
- package/dist/src/ui/hooks/slashCommandProcessor.js +232 -96
- 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 +7 -5
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +5 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +26 -23
- 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 +306 -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 +32 -0
- package/dist/src/ui/hooks/useDialogClose.js +48 -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 +1 -1
- 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/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.d.ts +4 -0
- package/dist/src/ui/hooks/useFocus.js +14 -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 +60 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +21 -5
- package/dist/src/ui/hooks/useGeminiStream.js +276 -128
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +16 -19
- 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 +171 -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/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/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/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/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.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.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/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 +23 -0
- package/dist/src/ui/hooks/useMessageQueue.js +51 -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 +167 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- 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 +13 -10
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/usePromptCompletion.js +177 -0
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -0
- package/dist/src/ui/hooks/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/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/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 +4 -3
- package/dist/src/ui/hooks/useReactToolScheduler.js +40 -35
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +3 -3
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
- 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/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/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.js +281 -67
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +597 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- 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/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 +2 -2
- package/dist/src/ui/hooks/useThemeCommand.js +10 -21
- 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 +623 -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 +292 -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 +54 -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 +293 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- 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 +35 -0
- package/dist/src/ui/models/availableModels.js +126 -0
- package/dist/src/ui/models/availableModels.js.map +1 -0
- 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/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/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/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/ayu.js +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/dracula.js +2 -2
- package/dist/src/ui/themes/github-dark.js +1 -1
- 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 +122 -109
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +110 -6
- package/dist/src/ui/types.js +16 -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 +8 -6
- 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 +13 -6
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +15 -13
- 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 +169 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- 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 +7 -8
- 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.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.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +61 -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/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/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 +98 -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 +75 -0
- package/dist/src/ui/utils/platformConstants.js +78 -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 +28 -0
- package/dist/src/ui/utils/textUtils.js +152 -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/ui/utils/updateCheck.d.ts +3 -2
- package/dist/src/ui/utils/updateCheck.js +55 -4
- 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/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/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/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 +27 -0
- package/dist/src/utils/errors.js +105 -0
- package/dist/src/utils/errors.js.map +1 -0
- 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 +3 -2
- package/dist/src/utils/events.js +2 -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 +10 -6
- 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/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/package.js +2 -2
- package/dist/src/utils/package.js.map +1 -1
- 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/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/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/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 +484 -443
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +144 -0
- package/dist/src/utils/settingsUtils.js +340 -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 +808 -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 +3 -3
- 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.d.ts +7 -1
- package/dist/src/utils/userStartupWarnings.js +24 -9
- 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 +88 -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/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 +35 -23
- 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 +20 -0
- package/dist/src/zed-integration/fileSystemService.js +46 -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 +17 -0
- package/dist/src/zed-integration/zedIntegration.js +791 -0
- package/dist/src/zed-integration/zedIntegration.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -12
- 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/commands/privacyCommand.d.ts +0 -7
- package/dist/src/ui/commands/privacyCommand.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.js +0 -27
- package/dist/src/ui/components/AuthInProgress.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/hooks/useAuthCommand.d.ts +0 -14
- package/dist/src/ui/hooks/useAuthCommand.js +0 -65
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
- package/dist/src/ui/hooks/usePrivacySettings.js +0 -115
- package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -40
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -17
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -17
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
- package/dist/src/ui/privacy/PrivacyNotice.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
|
@@ -3,15 +3,13 @@
|
|
|
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
|
-
import stringWidth from 'string-width';
|
|
13
11
|
import { unescapePath } from '@umsai/ums-code-core';
|
|
14
|
-
import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
|
|
12
|
+
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, getCachedStringWidth, } from '../../utils/textUtils.js';
|
|
15
13
|
import { handleVimAction } from './vim-buffer-actions.js';
|
|
16
14
|
// Simple helper for word‑wise ops.
|
|
17
15
|
function isWordChar(ch) {
|
|
@@ -20,112 +18,266 @@ function isWordChar(ch) {
|
|
|
20
18
|
}
|
|
21
19
|
return !/[\s,.;!?]/.test(ch);
|
|
22
20
|
}
|
|
23
|
-
//
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
// Helper functions for line-based word navigation
|
|
22
|
+
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
|
|
23
|
+
export const isWhitespace = (char) => /\s/.test(char);
|
|
24
|
+
// Check if a character is a combining mark (only diacritics for now)
|
|
25
|
+
export const isCombiningMark = (char) => /\p{M}/u.test(char);
|
|
26
|
+
// Check if a character should be considered part of a word (including combining marks)
|
|
27
|
+
export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
|
|
28
|
+
// Get the script of a character (simplified for common scripts)
|
|
29
|
+
export const getCharScript = (char) => {
|
|
30
|
+
if (/[\p{Script=Latin}]/u.test(char))
|
|
31
|
+
return 'latin'; // All Latin script chars including diacritics
|
|
32
|
+
if (/[\p{Script=Han}]/u.test(char))
|
|
33
|
+
return 'han'; // Chinese
|
|
34
|
+
if (/[\p{Script=Arabic}]/u.test(char))
|
|
35
|
+
return 'arabic';
|
|
36
|
+
if (/[\p{Script=Hiragana}]/u.test(char))
|
|
37
|
+
return 'hiragana';
|
|
38
|
+
if (/[\p{Script=Katakana}]/u.test(char))
|
|
39
|
+
return 'katakana';
|
|
40
|
+
if (/[\p{Script=Cyrillic}]/u.test(char))
|
|
41
|
+
return 'cyrillic';
|
|
42
|
+
return 'other';
|
|
43
|
+
};
|
|
44
|
+
// Check if two characters are from different scripts (indicating word boundary)
|
|
45
|
+
export const isDifferentScript = (char1, char2) => {
|
|
46
|
+
if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
|
|
47
|
+
return false;
|
|
48
|
+
return getCharScript(char1) !== getCharScript(char2);
|
|
49
|
+
};
|
|
50
|
+
// Find next word start within a line, starting from col
|
|
51
|
+
export const findNextWordStartInLine = (line, col) => {
|
|
52
|
+
const chars = toCodePoints(line);
|
|
53
|
+
let i = col;
|
|
54
|
+
if (i >= chars.length)
|
|
55
|
+
return null;
|
|
56
|
+
const currentChar = chars[i];
|
|
29
57
|
// Skip current word/sequence based on character type
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
58
|
+
if (isWordCharStrict(currentChar)) {
|
|
59
|
+
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
60
|
+
// Check for script boundary - if next character is from different script, stop here
|
|
61
|
+
if (i + 1 < chars.length &&
|
|
62
|
+
isWordCharStrict(chars[i + 1]) &&
|
|
63
|
+
isDifferentScript(chars[i], chars[i + 1])) {
|
|
64
|
+
i++; // Include current character
|
|
65
|
+
break; // Stop at script boundary
|
|
66
|
+
}
|
|
33
67
|
i++;
|
|
34
68
|
}
|
|
35
69
|
}
|
|
36
|
-
else if (
|
|
37
|
-
|
|
38
|
-
|
|
70
|
+
else if (!isWhitespace(currentChar)) {
|
|
71
|
+
while (i < chars.length &&
|
|
72
|
+
!isWordCharStrict(chars[i]) &&
|
|
73
|
+
!isWhitespace(chars[i])) {
|
|
39
74
|
i++;
|
|
40
75
|
}
|
|
41
76
|
}
|
|
42
77
|
// Skip whitespace
|
|
43
|
-
while (i <
|
|
78
|
+
while (i < chars.length && isWhitespace(chars[i])) {
|
|
44
79
|
i++;
|
|
45
80
|
}
|
|
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;
|
|
81
|
+
return i < chars.length ? i : null;
|
|
58
82
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// Move back one character to start searching
|
|
83
|
+
// Find previous word start within a line
|
|
84
|
+
export const findPrevWordStartInLine = (line, col) => {
|
|
85
|
+
const chars = toCodePoints(line);
|
|
86
|
+
let i = col;
|
|
87
|
+
if (i <= 0)
|
|
88
|
+
return null;
|
|
66
89
|
i--;
|
|
67
90
|
// Skip whitespace moving backwards
|
|
68
|
-
while (i >= 0 && (
|
|
91
|
+
while (i >= 0 && isWhitespace(chars[i])) {
|
|
69
92
|
i--;
|
|
70
93
|
}
|
|
71
|
-
if (i < 0)
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
const charAtI = text[i];
|
|
75
|
-
if (/\w/.test(charAtI)) {
|
|
94
|
+
if (i < 0)
|
|
95
|
+
return null;
|
|
96
|
+
if (isWordCharStrict(chars[i])) {
|
|
76
97
|
// We're in a word, move to its beginning
|
|
77
|
-
while (i >= 0 &&
|
|
98
|
+
while (i >= 0 && isWordCharStrict(chars[i])) {
|
|
99
|
+
// Check for script boundary - if previous character is from different script, stop here
|
|
100
|
+
if (i - 1 >= 0 &&
|
|
101
|
+
isWordCharStrict(chars[i - 1]) &&
|
|
102
|
+
isDifferentScript(chars[i], chars[i - 1])) {
|
|
103
|
+
return i; // Return current position at script boundary
|
|
104
|
+
}
|
|
78
105
|
i--;
|
|
79
106
|
}
|
|
80
|
-
return i + 1;
|
|
107
|
+
return i + 1;
|
|
81
108
|
}
|
|
82
109
|
else {
|
|
83
110
|
// 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') {
|
|
111
|
+
while (i >= 0 && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
|
|
89
112
|
i--;
|
|
90
113
|
}
|
|
91
|
-
return i + 1;
|
|
114
|
+
return i + 1;
|
|
92
115
|
}
|
|
93
116
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
117
|
+
// Find word end within a line
|
|
118
|
+
export const findWordEndInLine = (line, col) => {
|
|
119
|
+
const chars = toCodePoints(line);
|
|
120
|
+
let i = col;
|
|
121
|
+
// If we're already at the end of a word (including punctuation sequences), advance to next word
|
|
122
|
+
// This includes both regular word endings and script boundaries
|
|
123
|
+
const atEndOfWordChar = i < chars.length &&
|
|
124
|
+
isWordCharWithCombining(chars[i]) &&
|
|
125
|
+
(i + 1 >= chars.length ||
|
|
126
|
+
!isWordCharWithCombining(chars[i + 1]) ||
|
|
127
|
+
(isWordCharStrict(chars[i]) &&
|
|
128
|
+
i + 1 < chars.length &&
|
|
129
|
+
isWordCharStrict(chars[i + 1]) &&
|
|
130
|
+
isDifferentScript(chars[i], chars[i + 1])));
|
|
131
|
+
const atEndOfPunctuation = i < chars.length &&
|
|
132
|
+
!isWordCharWithCombining(chars[i]) &&
|
|
133
|
+
!isWhitespace(chars[i]) &&
|
|
134
|
+
(i + 1 >= chars.length ||
|
|
135
|
+
isWhitespace(chars[i + 1]) ||
|
|
136
|
+
isWordCharWithCombining(chars[i + 1]));
|
|
137
|
+
if (atEndOfWordChar || atEndOfPunctuation) {
|
|
138
|
+
// We're at the end of a word or punctuation sequence, move forward to find next word
|
|
101
139
|
i++;
|
|
102
|
-
// Skip whitespace
|
|
103
|
-
while (i <
|
|
140
|
+
// Skip whitespace to find next word or punctuation
|
|
141
|
+
while (i < chars.length && isWhitespace(chars[i])) {
|
|
104
142
|
i++;
|
|
105
143
|
}
|
|
106
144
|
}
|
|
107
|
-
// If we're not on a word character, find the next word
|
|
108
|
-
if (i <
|
|
109
|
-
|
|
145
|
+
// If we're not on a word character, find the next word or punctuation sequence
|
|
146
|
+
if (i < chars.length && !isWordCharWithCombining(chars[i])) {
|
|
147
|
+
// Skip whitespace to find next word or punctuation
|
|
148
|
+
while (i < chars.length && isWhitespace(chars[i])) {
|
|
110
149
|
i++;
|
|
111
150
|
}
|
|
112
151
|
}
|
|
113
|
-
// Move to end of current word
|
|
114
|
-
|
|
115
|
-
|
|
152
|
+
// Move to end of current word (including combining marks, but stop at script boundaries)
|
|
153
|
+
let foundWord = false;
|
|
154
|
+
let lastBaseCharPos = -1;
|
|
155
|
+
if (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
156
|
+
// Handle word characters
|
|
157
|
+
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
158
|
+
foundWord = true;
|
|
159
|
+
// Track the position of the last base character (not combining mark)
|
|
160
|
+
if (isWordCharStrict(chars[i])) {
|
|
161
|
+
lastBaseCharPos = i;
|
|
162
|
+
}
|
|
163
|
+
// Check if next character is from a different script (word boundary)
|
|
164
|
+
if (i + 1 < chars.length &&
|
|
165
|
+
isWordCharStrict(chars[i + 1]) &&
|
|
166
|
+
isDifferentScript(chars[i], chars[i + 1])) {
|
|
167
|
+
i++; // Include current character
|
|
168
|
+
if (isWordCharStrict(chars[i - 1])) {
|
|
169
|
+
lastBaseCharPos = i - 1;
|
|
170
|
+
}
|
|
171
|
+
break; // Stop at script boundary
|
|
172
|
+
}
|
|
173
|
+
i++;
|
|
174
|
+
}
|
|
116
175
|
}
|
|
117
|
-
|
|
118
|
-
|
|
176
|
+
else if (i < chars.length && !isWhitespace(chars[i])) {
|
|
177
|
+
// Handle punctuation sequences (like ████)
|
|
178
|
+
while (i < chars.length &&
|
|
179
|
+
!isWordCharStrict(chars[i]) &&
|
|
180
|
+
!isWhitespace(chars[i])) {
|
|
181
|
+
foundWord = true;
|
|
182
|
+
lastBaseCharPos = i;
|
|
183
|
+
i++;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Only return a position if we actually found a word
|
|
187
|
+
// Return the position of the last base character, not combining marks
|
|
188
|
+
if (foundWord && lastBaseCharPos >= col) {
|
|
189
|
+
return lastBaseCharPos;
|
|
190
|
+
}
|
|
191
|
+
return null;
|
|
119
192
|
};
|
|
120
|
-
//
|
|
121
|
-
export const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
193
|
+
// Find next word across lines
|
|
194
|
+
export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
|
|
195
|
+
// First try current line
|
|
196
|
+
const currentLine = lines[cursorRow] || '';
|
|
197
|
+
const colInCurrentLine = searchForWordStart
|
|
198
|
+
? findNextWordStartInLine(currentLine, cursorCol)
|
|
199
|
+
: findWordEndInLine(currentLine, cursorCol);
|
|
200
|
+
if (colInCurrentLine !== null) {
|
|
201
|
+
return { row: cursorRow, col: colInCurrentLine };
|
|
125
202
|
}
|
|
126
|
-
|
|
127
|
-
|
|
203
|
+
// Search subsequent lines
|
|
204
|
+
for (let row = cursorRow + 1; row < lines.length; row++) {
|
|
205
|
+
const line = lines[row] || '';
|
|
206
|
+
const chars = toCodePoints(line);
|
|
207
|
+
// For empty lines, if we haven't found any words yet, return the empty line
|
|
208
|
+
if (chars.length === 0) {
|
|
209
|
+
// Check if there are any words in remaining lines
|
|
210
|
+
let hasWordsInLaterLines = false;
|
|
211
|
+
for (let laterRow = row + 1; laterRow < lines.length; laterRow++) {
|
|
212
|
+
const laterLine = lines[laterRow] || '';
|
|
213
|
+
const laterChars = toCodePoints(laterLine);
|
|
214
|
+
let firstNonWhitespace = 0;
|
|
215
|
+
while (firstNonWhitespace < laterChars.length &&
|
|
216
|
+
isWhitespace(laterChars[firstNonWhitespace])) {
|
|
217
|
+
firstNonWhitespace++;
|
|
218
|
+
}
|
|
219
|
+
if (firstNonWhitespace < laterChars.length) {
|
|
220
|
+
hasWordsInLaterLines = true;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// If no words in later lines, return the empty line
|
|
225
|
+
if (!hasWordsInLaterLines) {
|
|
226
|
+
return { row, col: 0 };
|
|
227
|
+
}
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
// Find first non-whitespace
|
|
231
|
+
let firstNonWhitespace = 0;
|
|
232
|
+
while (firstNonWhitespace < chars.length &&
|
|
233
|
+
isWhitespace(chars[firstNonWhitespace])) {
|
|
234
|
+
firstNonWhitespace++;
|
|
235
|
+
}
|
|
236
|
+
if (firstNonWhitespace < chars.length) {
|
|
237
|
+
if (searchForWordStart) {
|
|
238
|
+
return { row, col: firstNonWhitespace };
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// For word end, find the end of the first word
|
|
242
|
+
const endCol = findWordEndInLine(line, firstNonWhitespace);
|
|
243
|
+
if (endCol !== null) {
|
|
244
|
+
return { row, col: endCol };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
128
250
|
};
|
|
251
|
+
// Find previous word across lines
|
|
252
|
+
export const findPrevWordAcrossLines = (lines, cursorRow, cursorCol) => {
|
|
253
|
+
// First try current line
|
|
254
|
+
const currentLine = lines[cursorRow] || '';
|
|
255
|
+
const colInCurrentLine = findPrevWordStartInLine(currentLine, cursorCol);
|
|
256
|
+
if (colInCurrentLine !== null) {
|
|
257
|
+
return { row: cursorRow, col: colInCurrentLine };
|
|
258
|
+
}
|
|
259
|
+
// Search previous lines
|
|
260
|
+
for (let row = cursorRow - 1; row >= 0; row--) {
|
|
261
|
+
const line = lines[row] || '';
|
|
262
|
+
const chars = toCodePoints(line);
|
|
263
|
+
if (chars.length === 0)
|
|
264
|
+
continue;
|
|
265
|
+
// Find last word start
|
|
266
|
+
let lastWordStart = chars.length;
|
|
267
|
+
while (lastWordStart > 0 && isWhitespace(chars[lastWordStart - 1])) {
|
|
268
|
+
lastWordStart--;
|
|
269
|
+
}
|
|
270
|
+
if (lastWordStart > 0) {
|
|
271
|
+
// Find start of this word
|
|
272
|
+
const wordStart = findPrevWordStartInLine(line, lastWordStart);
|
|
273
|
+
if (wordStart !== null) {
|
|
274
|
+
return { row, col: wordStart };
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
};
|
|
280
|
+
// Helper functions for vim line operations
|
|
129
281
|
export const getPositionFromOffsets = (startOffset, endOffset, lines) => {
|
|
130
282
|
let offset = 0;
|
|
131
283
|
let startRow = 0;
|
|
@@ -218,27 +370,6 @@ export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol,
|
|
|
218
370
|
preferredCol: null,
|
|
219
371
|
};
|
|
220
372
|
};
|
|
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
373
|
function clamp(v, min, max) {
|
|
243
374
|
return v < min ? min : v > max ? max : v;
|
|
244
375
|
}
|
|
@@ -323,12 +454,12 @@ export function logicalPosToOffset(lines, row, col) {
|
|
|
323
454
|
}
|
|
324
455
|
return offset;
|
|
325
456
|
}
|
|
326
|
-
//
|
|
327
|
-
|
|
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) {
|
|
328
460
|
const visualLines = [];
|
|
329
461
|
const logicalToVisualMap = [];
|
|
330
462
|
const visualToLogicalMap = [];
|
|
331
|
-
let currentVisualCursor = [0, 0];
|
|
332
463
|
logicalLines.forEach((logLine, logIndex) => {
|
|
333
464
|
logicalToVisualMap[logIndex] = [];
|
|
334
465
|
if (logLine.length === 0) {
|
|
@@ -336,9 +467,6 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
336
467
|
logicalToVisualMap[logIndex].push([visualLines.length, 0]);
|
|
337
468
|
visualToLogicalMap.push([logIndex, 0]);
|
|
338
469
|
visualLines.push('');
|
|
339
|
-
if (logIndex === logicalCursor[0] && logicalCursor[1] === 0) {
|
|
340
|
-
currentVisualCursor = [visualLines.length - 1, 0];
|
|
341
|
-
}
|
|
342
470
|
}
|
|
343
471
|
else {
|
|
344
472
|
// Non-empty logical line
|
|
@@ -353,7 +481,7 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
353
481
|
// Iterate through code points to build the current visual line (chunk)
|
|
354
482
|
for (let i = currentPosInLogLine; i < codePointsInLogLine.length; i++) {
|
|
355
483
|
const char = codePointsInLogLine[i];
|
|
356
|
-
const charVisualWidth =
|
|
484
|
+
const charVisualWidth = getCachedStringWidth(char);
|
|
357
485
|
if (currentChunkVisualWidth + charVisualWidth > viewportWidth) {
|
|
358
486
|
// Character would exceed viewport width
|
|
359
487
|
if (lastWordBreakPoint !== -1 &&
|
|
@@ -419,27 +547,6 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
419
547
|
]);
|
|
420
548
|
visualToLogicalMap.push([logIndex, currentPosInLogLine]);
|
|
421
549
|
visualLines.push(currentChunk);
|
|
422
|
-
// Cursor mapping logic
|
|
423
|
-
// Note: currentPosInLogLine here is the start of the currentChunk within the logical line.
|
|
424
|
-
if (logIndex === logicalCursor[0]) {
|
|
425
|
-
const cursorLogCol = logicalCursor[1]; // This is a code point index
|
|
426
|
-
if (cursorLogCol >= currentPosInLogLine &&
|
|
427
|
-
cursorLogCol < currentPosInLogLine + numCodePointsInChunk // Cursor is within this chunk
|
|
428
|
-
) {
|
|
429
|
-
currentVisualCursor = [
|
|
430
|
-
visualLines.length - 1,
|
|
431
|
-
cursorLogCol - currentPosInLogLine, // Visual col is also code point index within visual line
|
|
432
|
-
];
|
|
433
|
-
}
|
|
434
|
-
else if (cursorLogCol === currentPosInLogLine + numCodePointsInChunk &&
|
|
435
|
-
numCodePointsInChunk > 0) {
|
|
436
|
-
// Cursor is exactly at the end of this non-empty chunk
|
|
437
|
-
currentVisualCursor = [
|
|
438
|
-
visualLines.length - 1,
|
|
439
|
-
numCodePointsInChunk,
|
|
440
|
-
];
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
550
|
const logicalStartOfThisChunk = currentPosInLogLine;
|
|
444
551
|
currentPosInLogLine += numCodePointsInChunk;
|
|
445
552
|
// If the chunk processed did not consume the entire logical line,
|
|
@@ -452,20 +559,6 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
452
559
|
currentPosInLogLine++;
|
|
453
560
|
}
|
|
454
561
|
}
|
|
455
|
-
// After all chunks of a non-empty logical line are processed,
|
|
456
|
-
// if the cursor is at the very end of this logical line, update visual cursor.
|
|
457
|
-
if (logIndex === logicalCursor[0] &&
|
|
458
|
-
logicalCursor[1] === codePointsInLogLine.length // Cursor at end of logical line
|
|
459
|
-
) {
|
|
460
|
-
const lastVisualLineIdx = visualLines.length - 1;
|
|
461
|
-
if (lastVisualLineIdx >= 0 &&
|
|
462
|
-
visualLines[lastVisualLineIdx] !== undefined) {
|
|
463
|
-
currentVisualCursor = [
|
|
464
|
-
lastVisualLineIdx,
|
|
465
|
-
cpLen(visualLines[lastVisualLineIdx]), // Cursor at end of last visual line for this logical line
|
|
466
|
-
];
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
562
|
}
|
|
470
563
|
});
|
|
471
564
|
// If the entire logical text was empty, ensure there's one empty visual line.
|
|
@@ -478,23 +571,46 @@ function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
|
|
|
478
571
|
logicalToVisualMap[0].push([0, 0]);
|
|
479
572
|
visualToLogicalMap.push([0, 0]);
|
|
480
573
|
}
|
|
481
|
-
currentVisualCursor = [0, 0];
|
|
482
|
-
}
|
|
483
|
-
// Handle cursor at the very end of the text (after all processing)
|
|
484
|
-
// This case might be covered by the loop end condition now, but kept for safety.
|
|
485
|
-
else if (logicalCursor[0] === logicalLines.length - 1 &&
|
|
486
|
-
logicalCursor[1] === cpLen(logicalLines[logicalLines.length - 1]) &&
|
|
487
|
-
visualLines.length > 0) {
|
|
488
|
-
const lastVisLineIdx = visualLines.length - 1;
|
|
489
|
-
currentVisualCursor = [lastVisLineIdx, cpLen(visualLines[lastVisLineIdx])];
|
|
490
574
|
}
|
|
491
575
|
return {
|
|
492
576
|
visualLines,
|
|
493
|
-
visualCursor: currentVisualCursor,
|
|
494
577
|
logicalToVisualMap,
|
|
495
578
|
visualToLogicalMap,
|
|
496
579
|
};
|
|
497
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
|
+
}
|
|
498
614
|
const historyLimit = 100;
|
|
499
615
|
export const pushUndo = (currentState) => {
|
|
500
616
|
const snapshot = {
|
|
@@ -508,7 +624,7 @@ export const pushUndo = (currentState) => {
|
|
|
508
624
|
}
|
|
509
625
|
return { ...currentState, undoStack: newStack, redoStack: [] };
|
|
510
626
|
};
|
|
511
|
-
|
|
627
|
+
function textBufferReducerLogic(state, action) {
|
|
512
628
|
const pushUndoLocal = pushUndo;
|
|
513
629
|
const currentLine = (r) => state.lines[r] ?? '';
|
|
514
630
|
const currentLineLen = (r) => cpLen(currentLine(r));
|
|
@@ -595,68 +711,101 @@ export function textBufferReducer(state, action) {
|
|
|
595
711
|
preferredCol: null,
|
|
596
712
|
};
|
|
597
713
|
}
|
|
598
|
-
case '
|
|
599
|
-
|
|
714
|
+
case 'set_viewport': {
|
|
715
|
+
const { width, height } = action.payload;
|
|
716
|
+
if (width === state.viewportWidth && height === state.viewportHeight) {
|
|
600
717
|
return state;
|
|
601
718
|
}
|
|
602
|
-
return {
|
|
719
|
+
return {
|
|
720
|
+
...state,
|
|
721
|
+
viewportWidth: width,
|
|
722
|
+
viewportHeight: height,
|
|
723
|
+
};
|
|
603
724
|
}
|
|
604
725
|
case 'move': {
|
|
605
726
|
const { dir } = action.payload;
|
|
606
|
-
const {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
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;
|
|
631
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;
|
|
632
793
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
|
|
648
|
-
}
|
|
649
|
-
break;
|
|
650
|
-
case 'home':
|
|
651
|
-
newPreferredCol = null;
|
|
652
|
-
newVisualCol = 0;
|
|
653
|
-
break;
|
|
654
|
-
case 'end':
|
|
655
|
-
newPreferredCol = null;
|
|
656
|
-
newVisualCol = currentVisLineLen;
|
|
657
|
-
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) {
|
|
658
808
|
case 'wordLeft': {
|
|
659
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
660
809
|
if (cursorCol === 0 && cursorRow === 0)
|
|
661
810
|
return state;
|
|
662
811
|
let newCursorRow = cursorRow;
|
|
@@ -695,7 +844,6 @@ export function textBufferReducer(state, action) {
|
|
|
695
844
|
};
|
|
696
845
|
}
|
|
697
846
|
case 'wordRight': {
|
|
698
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
699
847
|
if (cursorRow === lines.length - 1 &&
|
|
700
848
|
cursorCol === cpLen(lines[cursorRow] ?? '')) {
|
|
701
849
|
return state;
|
|
@@ -724,18 +872,14 @@ export function textBufferReducer(state, action) {
|
|
|
724
872
|
};
|
|
725
873
|
}
|
|
726
874
|
default:
|
|
727
|
-
|
|
728
|
-
}
|
|
729
|
-
if (visualToLogicalMap[newVisualRow]) {
|
|
730
|
-
const [logRow, logStartCol] = visualToLogicalMap[newVisualRow];
|
|
731
|
-
return {
|
|
732
|
-
...state,
|
|
733
|
-
cursorRow: logRow,
|
|
734
|
-
cursorCol: clamp(logStartCol + newVisualCol, 0, cpLen(state.lines[logRow] ?? '')),
|
|
735
|
-
preferredCol: newPreferredCol,
|
|
736
|
-
};
|
|
875
|
+
return state;
|
|
737
876
|
}
|
|
738
|
-
|
|
877
|
+
}
|
|
878
|
+
case 'set_cursor': {
|
|
879
|
+
return {
|
|
880
|
+
...state,
|
|
881
|
+
...action.payload,
|
|
882
|
+
};
|
|
739
883
|
}
|
|
740
884
|
case 'delete': {
|
|
741
885
|
const { cursorRow, cursorCol, lines } = state;
|
|
@@ -746,7 +890,11 @@ export function textBufferReducer(state, action) {
|
|
|
746
890
|
newLines[cursorRow] =
|
|
747
891
|
cpSlice(lineContent, 0, cursorCol) +
|
|
748
892
|
cpSlice(lineContent, cursorCol + 1);
|
|
749
|
-
return {
|
|
893
|
+
return {
|
|
894
|
+
...nextState,
|
|
895
|
+
lines: newLines,
|
|
896
|
+
preferredCol: null,
|
|
897
|
+
};
|
|
750
898
|
}
|
|
751
899
|
else if (cursorRow < lines.length - 1) {
|
|
752
900
|
const nextState = pushUndoLocal(state);
|
|
@@ -754,7 +902,11 @@ export function textBufferReducer(state, action) {
|
|
|
754
902
|
const newLines = [...nextState.lines];
|
|
755
903
|
newLines[cursorRow] = lineContent + nextLineContent;
|
|
756
904
|
newLines.splice(cursorRow + 1, 1);
|
|
757
|
-
return {
|
|
905
|
+
return {
|
|
906
|
+
...nextState,
|
|
907
|
+
lines: newLines,
|
|
908
|
+
preferredCol: null,
|
|
909
|
+
};
|
|
758
910
|
}
|
|
759
911
|
return state;
|
|
760
912
|
}
|
|
@@ -762,78 +914,62 @@ export function textBufferReducer(state, action) {
|
|
|
762
914
|
const { cursorRow, cursorCol } = state;
|
|
763
915
|
if (cursorCol === 0 && cursorRow === 0)
|
|
764
916
|
return state;
|
|
765
|
-
|
|
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 {
|
|
766
930
|
// Act as a backspace
|
|
767
|
-
const nextState = pushUndoLocal(state);
|
|
768
931
|
const prevLineContent = currentLine(cursorRow - 1);
|
|
769
932
|
const currentLineContentVal = currentLine(cursorRow);
|
|
770
933
|
const newCol = cpLen(prevLineContent);
|
|
771
|
-
const newLines = [...nextState.lines];
|
|
772
934
|
newLines[cursorRow - 1] = prevLineContent + currentLineContentVal;
|
|
773
935
|
newLines.splice(cursorRow, 1);
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
lines: newLines,
|
|
777
|
-
cursorRow: cursorRow - 1,
|
|
778
|
-
cursorCol: newCol,
|
|
779
|
-
preferredCol: null,
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
const nextState = pushUndoLocal(state);
|
|
783
|
-
const lineContent = currentLine(cursorRow);
|
|
784
|
-
const arr = toCodePoints(lineContent);
|
|
785
|
-
let start = cursorCol;
|
|
786
|
-
let onlySpaces = true;
|
|
787
|
-
for (let i = 0; i < start; i++) {
|
|
788
|
-
if (isWordChar(arr[i])) {
|
|
789
|
-
onlySpaces = false;
|
|
790
|
-
break;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
if (onlySpaces && start > 0) {
|
|
794
|
-
start--;
|
|
795
|
-
}
|
|
796
|
-
else {
|
|
797
|
-
while (start > 0 && !isWordChar(arr[start - 1]))
|
|
798
|
-
start--;
|
|
799
|
-
while (start > 0 && isWordChar(arr[start - 1]))
|
|
800
|
-
start--;
|
|
936
|
+
newCursorRow--;
|
|
937
|
+
newCursorCol = newCol;
|
|
801
938
|
}
|
|
802
|
-
const newLines = [...nextState.lines];
|
|
803
|
-
newLines[cursorRow] =
|
|
804
|
-
cpSlice(lineContent, 0, start) + cpSlice(lineContent, cursorCol);
|
|
805
939
|
return {
|
|
806
940
|
...nextState,
|
|
807
941
|
lines: newLines,
|
|
808
|
-
|
|
942
|
+
cursorRow: newCursorRow,
|
|
943
|
+
cursorCol: newCursorCol,
|
|
809
944
|
preferredCol: null,
|
|
810
945
|
};
|
|
811
946
|
}
|
|
812
947
|
case 'delete_word_right': {
|
|
813
948
|
const { cursorRow, cursorCol, lines } = state;
|
|
814
949
|
const lineContent = currentLine(cursorRow);
|
|
815
|
-
const
|
|
816
|
-
if (cursorCol >=
|
|
950
|
+
const lineLen = cpLen(lineContent);
|
|
951
|
+
if (cursorCol >= lineLen && cursorRow === lines.length - 1) {
|
|
817
952
|
return state;
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
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
|
|
821
958
|
const nextLineContent = currentLine(cursorRow + 1);
|
|
822
|
-
const newLines = [...nextState.lines];
|
|
823
959
|
newLines[cursorRow] = lineContent + nextLineContent;
|
|
824
960
|
newLines.splice(cursorRow + 1, 1);
|
|
825
|
-
return { ...nextState, lines: newLines, preferredCol: null };
|
|
826
961
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
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
|
+
};
|
|
837
973
|
}
|
|
838
974
|
case 'kill_line_right': {
|
|
839
975
|
const { cursorRow, cursorCol, lines } = state;
|
|
@@ -842,7 +978,10 @@ export function textBufferReducer(state, action) {
|
|
|
842
978
|
const nextState = pushUndoLocal(state);
|
|
843
979
|
const newLines = [...nextState.lines];
|
|
844
980
|
newLines[cursorRow] = cpSlice(lineContent, 0, cursorCol);
|
|
845
|
-
return {
|
|
981
|
+
return {
|
|
982
|
+
...nextState,
|
|
983
|
+
lines: newLines,
|
|
984
|
+
};
|
|
846
985
|
}
|
|
847
986
|
else if (cursorRow < lines.length - 1) {
|
|
848
987
|
// Act as a delete
|
|
@@ -851,7 +990,11 @@ export function textBufferReducer(state, action) {
|
|
|
851
990
|
const newLines = [...nextState.lines];
|
|
852
991
|
newLines[cursorRow] = lineContent + nextLineContent;
|
|
853
992
|
newLines.splice(cursorRow + 1, 1);
|
|
854
|
-
return {
|
|
993
|
+
return {
|
|
994
|
+
...nextState,
|
|
995
|
+
lines: newLines,
|
|
996
|
+
preferredCol: null,
|
|
997
|
+
};
|
|
855
998
|
}
|
|
856
999
|
return state;
|
|
857
1000
|
}
|
|
@@ -962,11 +1105,23 @@ export function textBufferReducer(state, action) {
|
|
|
962
1105
|
}
|
|
963
1106
|
}
|
|
964
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
|
+
}
|
|
965
1119
|
// --- End of reducer logic ---
|
|
966
1120
|
export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, }) {
|
|
967
1121
|
const initialState = useMemo(() => {
|
|
968
1122
|
const lines = initialText.split('\n');
|
|
969
1123
|
const [initialCursorRow, initialCursorCol] = calculateInitialCursorPosition(lines.length === 0 ? [''] : lines, initialCursorOffset);
|
|
1124
|
+
const visualLayout = calculateLayout(lines.length === 0 ? [''] : lines, viewport.width);
|
|
970
1125
|
return {
|
|
971
1126
|
lines: lines.length === 0 ? [''] : lines,
|
|
972
1127
|
cursorRow: initialCursorRow,
|
|
@@ -977,13 +1132,15 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
977
1132
|
clipboard: null,
|
|
978
1133
|
selectionAnchor: null,
|
|
979
1134
|
viewportWidth: viewport.width,
|
|
1135
|
+
viewportHeight: viewport.height,
|
|
1136
|
+
visualLayout,
|
|
980
1137
|
};
|
|
981
|
-
}, [initialText, initialCursorOffset, viewport.width]);
|
|
1138
|
+
}, [initialText, initialCursorOffset, viewport.width, viewport.height]);
|
|
982
1139
|
const [state, dispatch] = useReducer(textBufferReducer, initialState);
|
|
983
|
-
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor } = state;
|
|
1140
|
+
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, } = state;
|
|
984
1141
|
const text = useMemo(() => lines.join('\n'), [lines]);
|
|
985
|
-
const
|
|
986
|
-
const { visualLines,
|
|
1142
|
+
const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
|
|
1143
|
+
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
987
1144
|
const [visualScrollRow, setVisualScrollRow] = useState(0);
|
|
988
1145
|
useEffect(() => {
|
|
989
1146
|
if (onChange) {
|
|
@@ -991,11 +1148,16 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
991
1148
|
}
|
|
992
1149
|
}, [text, onChange]);
|
|
993
1150
|
useEffect(() => {
|
|
994
|
-
dispatch({
|
|
995
|
-
|
|
1151
|
+
dispatch({
|
|
1152
|
+
type: 'set_viewport',
|
|
1153
|
+
payload: { width: viewport.width, height: viewport.height },
|
|
1154
|
+
});
|
|
1155
|
+
}, [viewport.width, viewport.height]);
|
|
996
1156
|
// Update visual scroll (vertical)
|
|
997
1157
|
useEffect(() => {
|
|
998
1158
|
const { height } = viewport;
|
|
1159
|
+
const totalVisualLines = visualLines.length;
|
|
1160
|
+
const maxScrollStart = Math.max(0, totalVisualLines - height);
|
|
999
1161
|
let newVisualScrollRow = visualScrollRow;
|
|
1000
1162
|
if (visualCursor[0] < visualScrollRow) {
|
|
1001
1163
|
newVisualScrollRow = visualCursor[0];
|
|
@@ -1003,10 +1165,13 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1003
1165
|
else if (visualCursor[0] >= visualScrollRow + height) {
|
|
1004
1166
|
newVisualScrollRow = visualCursor[0] - height + 1;
|
|
1005
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);
|
|
1006
1171
|
if (newVisualScrollRow !== visualScrollRow) {
|
|
1007
1172
|
setVisualScrollRow(newVisualScrollRow);
|
|
1008
1173
|
}
|
|
1009
|
-
}, [visualCursor, visualScrollRow, viewport]);
|
|
1174
|
+
}, [visualCursor, visualScrollRow, viewport, visualLines.length]);
|
|
1010
1175
|
const insert = useCallback((ch, { paste = false } = {}) => {
|
|
1011
1176
|
if (/[\n\r]/.test(ch)) {
|
|
1012
1177
|
dispatch({ type: 'insert', payload: ch });
|
|
@@ -1054,7 +1219,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1054
1219
|
}, []);
|
|
1055
1220
|
const move = useCallback((dir) => {
|
|
1056
1221
|
dispatch({ type: 'move', payload: { dir } });
|
|
1057
|
-
}, []);
|
|
1222
|
+
}, [dispatch]);
|
|
1058
1223
|
const undo = useCallback(() => {
|
|
1059
1224
|
dispatch({ type: 'undo' });
|
|
1060
1225
|
}, []);
|
|
@@ -1219,6 +1384,12 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1219
1384
|
}, [text, stdin, setRawMode]);
|
|
1220
1385
|
const handleInput = useCallback((key) => {
|
|
1221
1386
|
const { sequence: input } = key;
|
|
1387
|
+
if (key.paste) {
|
|
1388
|
+
// Do not do any other processing on pastes so ensure we handle them
|
|
1389
|
+
// before all other cases.
|
|
1390
|
+
insert(input, { paste: key.paste });
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1222
1393
|
if (key.name === 'return' ||
|
|
1223
1394
|
input === '\r' ||
|
|
1224
1395
|
input === '\n' ||
|
|
@@ -1266,10 +1437,24 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1266
1437
|
backspace();
|
|
1267
1438
|
else if (key.name === 'delete' || (key.ctrl && key.name === 'd'))
|
|
1268
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();
|
|
1269
1444
|
else if (input && !key.ctrl && !key.meta) {
|
|
1270
1445
|
insert(input, { paste: key.paste });
|
|
1271
1446
|
}
|
|
1272
|
-
}, [
|
|
1447
|
+
}, [
|
|
1448
|
+
newline,
|
|
1449
|
+
move,
|
|
1450
|
+
deleteWordLeft,
|
|
1451
|
+
deleteWordRight,
|
|
1452
|
+
backspace,
|
|
1453
|
+
del,
|
|
1454
|
+
insert,
|
|
1455
|
+
undo,
|
|
1456
|
+
redo,
|
|
1457
|
+
]);
|
|
1273
1458
|
const renderedVisualLines = useMemo(() => visualLines.slice(visualScrollRow, visualScrollRow + viewport.height), [visualLines, visualScrollRow, viewport.height]);
|
|
1274
1459
|
const replaceRange = useCallback((startRow, startCol, endRow, endCol, text) => {
|
|
1275
1460
|
dispatch({
|
|
@@ -1285,7 +1470,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1285
1470
|
const moveToOffset = useCallback((offset) => {
|
|
1286
1471
|
dispatch({ type: 'move_to_offset', payload: { offset } });
|
|
1287
1472
|
}, []);
|
|
1288
|
-
const returnValue = {
|
|
1473
|
+
const returnValue = useMemo(() => ({
|
|
1289
1474
|
lines,
|
|
1290
1475
|
text,
|
|
1291
1476
|
cursor: [cursorRow, cursorCol],
|
|
@@ -1295,6 +1480,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1295
1480
|
viewportVisualLines: renderedVisualLines,
|
|
1296
1481
|
visualCursor,
|
|
1297
1482
|
visualScrollRow,
|
|
1483
|
+
visualToLogicalMap,
|
|
1298
1484
|
setText,
|
|
1299
1485
|
insert,
|
|
1300
1486
|
newline,
|
|
@@ -1345,7 +1531,68 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1345
1531
|
vimMoveToLastLine,
|
|
1346
1532
|
vimMoveToLine,
|
|
1347
1533
|
vimEscapeInsertMode,
|
|
1348
|
-
}
|
|
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
|
+
]);
|
|
1349
1596
|
return returnValue;
|
|
1350
1597
|
}
|
|
1351
1598
|
//# sourceMappingURL=text-buffer.js.map
|