@umsai/ums-code 0.0.11-post6 → 0.0.14-v1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +5 -5
- package/dist/src/acp/acp.d.ts +208 -0
- package/dist/src/{zed-integration → acp}/acp.js +44 -76
- package/dist/src/acp/acp.js.map +1 -0
- package/dist/src/acp/acpPeer.d.ts +8 -0
- package/dist/src/acp/acpPeer.js +537 -0
- package/dist/src/acp/acpPeer.js.map +1 -0
- package/dist/src/config/auth.js +11 -12
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +3 -3
- package/dist/src/config/config.js +86 -164
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +1 -2
- package/dist/src/config/extension.js +4 -9
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/sandboxConfig.js +3 -3
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +64 -3
- package/dist/src/config/settings.js +38 -58
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +41 -37
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -2
- package/dist/src/generated/git-commit.js +1 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +8 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +4 -11
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/FileCommandLoader.js +8 -10
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +3 -3
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +7 -2
- package/dist/src/services/prompt-processors/argumentProcessor.js +10 -2
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +13 -16
- package/dist/src/services/prompt-processors/shellProcessor.js +40 -125
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/types.d.ts +0 -2
- package/dist/src/services/prompt-processors/types.js +0 -2
- package/dist/src/services/prompt-processors/types.js.map +1 -1
- package/dist/src/ui/App.js +46 -224
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +5 -9
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +5 -13
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.js +6 -23
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +1 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +21 -18
- 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/ideCommand.js +18 -90
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.d.ts +1 -1
- package/dist/src/ui/commands/initCommand.js +7 -17
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +7 -11
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +6 -139
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.d.ts +0 -1
- package/dist/src/ui/commands/quitCommand.js +0 -25
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +0 -2
- package/dist/src/ui/commands/setupGithubCommand.js +26 -132
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +2 -2
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +3 -19
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.js +21 -55
- package/dist/src/ui/commands/ums/umsInitCommand.js.map +1 -1
- package/dist/src/ui/components/AboutBox.d.ts +0 -1
- package/dist/src/ui/components/AboutBox.js +1 -1
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +0 -1
- package/dist/src/ui/components/AsciiArt.js +0 -8
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.d.ts +1 -1
- package/dist/src/ui/components/AuthDialog.js +15 -17
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthInProgress.js +5 -6
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +25 -22
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.js +4 -5
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +5 -6
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +0 -1
- package/dist/src/ui/components/Footer.js +6 -16
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +1 -0
- package/dist/src/ui/components/Header.js +5 -13
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.js +1 -1
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +1 -2
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +12 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.js +12 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +0 -1
- package/dist/src/ui/components/InputPrompt.js +35 -98
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +5 -10
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +5 -7
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.js +7 -8
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +20 -10
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +1 -10
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +1 -6
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +14 -36
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +10 -75
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +9 -11
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +4 -17
- package/dist/src/ui/components/shared/text-buffer.js +80 -262
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.js +152 -139
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +3 -3
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +1 -3
- package/dist/src/ui/contexts/SessionContext.js +11 -3
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +16 -17
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +13 -8
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +2 -9
- package/dist/src/ui/hooks/slashCommandProcessor.js +62 -234
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +3 -4
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +6 -6
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.d.ts +0 -4
- package/dist/src/ui/hooks/useFocus.js +4 -4
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +3 -4
- package/dist/src/ui/hooks/useGeminiStream.js +33 -50
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.d.ts +16 -4
- package/dist/src/ui/hooks/useKeypress.js +140 -8
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +2 -6
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +15 -15
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +4 -5
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +4 -5
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +4 -5
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -2
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +1 -2
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +1 -2
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +1 -2
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +1 -2
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/default-light.js +1 -2
- package/dist/src/ui/themes/default-light.js.map +1 -1
- package/dist/src/ui/themes/default.js +1 -2
- package/dist/src/ui/themes/default.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +1 -2
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +1 -2
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +1 -2
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +1 -2
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +1 -30
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/qwen-dark.js +1 -2
- package/dist/src/ui/themes/qwen-dark.js.map +1 -1
- package/dist/src/ui/themes/qwen-light.js +1 -2
- package/dist/src/ui/themes/qwen-light.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +1 -2
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +0 -6
- package/dist/src/ui/themes/theme-manager.js +1 -8
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +2 -45
- package/dist/src/ui/themes/theme.js +107 -92
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +1 -2
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +4 -30
- package/dist/src/ui/types.js +0 -2
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +1 -2
- package/dist/src/ui/utils/CodeColorizer.js +4 -5
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +0 -1
- package/dist/src/ui/utils/ConsolePatcher.js +0 -3
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +1 -8
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +2 -4
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +0 -1
- package/dist/src/ui/utils/commandUtils.js +1 -22
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/computeStats.js +1 -3
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/errorParsing.d.ts +7 -0
- package/dist/src/ui/utils/errorParsing.js +90 -0
- package/dist/src/ui/utils/errorParsing.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +1 -1
- package/dist/src/ui/utils/updateCheck.js +10 -4
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +2 -2
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/gitUtils.d.ts +1 -21
- package/dist/src/utils/gitUtils.js +3 -68
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/installationInfo.js +5 -5
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/readStdin.js +0 -10
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/sandbox.js +434 -457
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/version.js +1 -1
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +7 -4
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/dist/src/commands/mcp/add.d.ts +0 -7
- package/dist/src/commands/mcp/add.js +0 -166
- package/dist/src/commands/mcp/add.js.map +0 -1
- package/dist/src/commands/mcp/list.d.ts +0 -8
- package/dist/src/commands/mcp/list.js +0 -110
- package/dist/src/commands/mcp/list.js.map +0 -1
- package/dist/src/commands/mcp/remove.d.ts +0 -7
- package/dist/src/commands/mcp/remove.js +0 -44
- package/dist/src/commands/mcp/remove.js.map +0 -1
- package/dist/src/commands/mcp.d.ts +0 -7
- package/dist/src/commands/mcp.js +0 -23
- package/dist/src/commands/mcp.js.map +0 -1
- package/dist/src/config/auth.test.d.ts +0 -6
- package/dist/src/config/auth.test.js +0 -57
- package/dist/src/config/auth.test.js.map +0 -1
- package/dist/src/config/keyBindings.d.ts +0 -66
- package/dist/src/config/keyBindings.js +0 -141
- package/dist/src/config/keyBindings.js.map +0 -1
- package/dist/src/config/keyBindings.test.d.ts +0 -6
- package/dist/src/config/keyBindings.test.js +0 -51
- package/dist/src/config/keyBindings.test.js.map +0 -1
- package/dist/src/config/settingsSchema.d.ts +0 -613
- package/dist/src/config/settingsSchema.js +0 -586
- package/dist/src/config/settingsSchema.js.map +0 -1
- package/dist/src/config/settingsSchema.test.d.ts +0 -6
- package/dist/src/config/settingsSchema.test.js +0 -196
- package/dist/src/config/settingsSchema.test.js.map +0 -1
- package/dist/src/config/trustedFolders.d.ts +0 -37
- package/dist/src/config/trustedFolders.js +0 -118
- package/dist/src/config/trustedFolders.js.map +0 -1
- package/dist/src/config/trustedFolders.test.d.ts +0 -6
- package/dist/src/config/trustedFolders.test.js +0 -160
- package/dist/src/config/trustedFolders.test.js.map +0 -1
- package/dist/src/gemini.test.d.ts +0 -6
- package/dist/src/gemini.test.js +0 -193
- package/dist/src/gemini.test.js.map +0 -1
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
- package/dist/src/services/BuiltinCommandLoader.test.js +0 -111
- package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
- package/dist/src/services/CommandService.test.d.ts +0 -6
- package/dist/src/services/CommandService.test.js +0 -232
- package/dist/src/services/CommandService.test.js.map +0 -1
- package/dist/src/test-utils/customMatchers.d.ts +0 -14
- package/dist/src/test-utils/customMatchers.js +0 -46
- package/dist/src/test-utils/customMatchers.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.d.ts +0 -18
- package/dist/src/test-utils/mockCommandContext.js +0 -87
- package/dist/src/test-utils/mockCommandContext.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
- package/dist/src/test-utils/mockCommandContext.test.js +0 -51
- package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
- package/dist/src/test-utils/render.d.ts +0 -8
- package/dist/src/test-utils/render.js +0 -10
- package/dist/src/test-utils/render.js.map +0 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +0 -16
- package/dist/src/ui/IdeIntegrationNudge.js +0 -52
- package/dist/src/ui/IdeIntegrationNudge.js.map +0 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +0 -7
- package/dist/src/ui/commands/agentsCommand.js +0 -32
- package/dist/src/ui/commands/agentsCommand.js.map +0 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +0 -7
- package/dist/src/ui/commands/settingsCommand.js +0 -16
- package/dist/src/ui/commands/settingsCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/setupGithubCommand.test.js +0 -167
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
- package/dist/src/ui/commands/summaryCommand.d.ts +0 -7
- package/dist/src/ui/commands/summaryCommand.js +0 -149
- package/dist/src/ui/commands/summaryCommand.js.map +0 -1
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +0 -13
- package/dist/src/ui/commands/terminalSetupCommand.js +0 -41
- package/dist/src/ui/commands/terminalSetupCommand.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
- package/dist/src/ui/components/AuthDialog.test.js +0 -220
- package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +0 -9
- package/dist/src/ui/components/ContextUsageDisplay.js +0 -14
- package/dist/src/ui/components/ContextUsageDisplay.js.map +0 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +0 -16
- package/dist/src/ui/components/FolderTrustDialog.js +0 -39
- package/dist/src/ui/components/FolderTrustDialog.js.map +0 -1
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
- package/dist/src/ui/components/FolderTrustDialog.test.js +0 -26
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
- package/dist/src/ui/components/Header.test.d.ts +0 -6
- package/dist/src/ui/components/Header.test.js +0 -37
- package/dist/src/ui/components/Header.test.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -91
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/components/LoadingIndicator.test.js +0 -190
- package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +0 -6
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +0 -44
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +0 -1
- package/dist/src/ui/components/QuitConfirmationDialog.d.ts +0 -17
- package/dist/src/ui/components/QuitConfirmationDialog.js +0 -44
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +0 -1
- package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +0 -6
- package/dist/src/ui/components/QwenOAuthProgress.test.js +0 -292
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +0 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +0 -14
- package/dist/src/ui/components/SettingsDialog.js +0 -519
- package/dist/src/ui/components/SettingsDialog.js.map +0 -1
- package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
- package/dist/src/ui/components/SettingsDialog.test.js +0 -568
- package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +0 -40
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +0 -1
- package/dist/src/ui/components/TodoDisplay.d.ts +0 -16
- package/dist/src/ui/components/TodoDisplay.js +0 -27
- package/dist/src/ui/components/TodoDisplay.js.map +0 -1
- package/dist/src/ui/components/TodoDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/TodoDisplay.test.js +0 -77
- package/dist/src/ui/components/TodoDisplay.test.js.map +0 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +0 -13
- package/dist/src/ui/components/WelcomeBackDialog.js +0 -31
- package/dist/src/ui/components/WelcomeBackDialog.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
- package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/SummaryMessage.js +0 -35
- package/dist/src/ui/components/messages/SummaryMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolMessage.test.js +0 -146
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -154
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -111
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
- package/dist/src/ui/components/shared/TextInput.d.ts +0 -16
- package/dist/src/ui/components/shared/TextInput.js +0 -127
- package/dist/src/ui/components/shared/TextInput.js.map +0 -1
- package/dist/src/ui/components/subagents/constants.d.ts +0 -23
- package/dist/src/ui/components/subagents/constants.js +0 -67
- package/dist/src/ui/components/subagents/constants.js.map +0 -1
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +0 -15
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +0 -171
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +0 -1
- package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +0 -15
- package/dist/src/ui/components/subagents/create/ColorSelector.js +0 -41
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/CreationSummary.js +0 -163
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +0 -1
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +0 -105
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +0 -1
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +0 -33
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/LocationSelector.js +0 -33
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +0 -26
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +0 -28
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +0 -1
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +0 -16
- package/dist/src/ui/components/subagents/create/ToolSelector.js +0 -143
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/index.d.ts +0 -8
- package/dist/src/ui/components/subagents/index.js +0 -12
- package/dist/src/ui/components/subagents/index.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +0 -13
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +0 -45
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +0 -13
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +0 -32
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +0 -15
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +0 -62
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +0 -12
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +0 -224
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +0 -11
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +0 -18
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +0 -15
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +0 -220
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +0 -1
- package/dist/src/ui/components/subagents/reducers.d.ts +0 -14
- package/dist/src/ui/components/subagents/reducers.js +0 -161
- package/dist/src/ui/components/subagents/reducers.js.map +0 -1
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +0 -19
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +0 -184
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +0 -1
- package/dist/src/ui/components/subagents/types.d.ts +0 -137
- package/dist/src/ui/components/subagents/types.js +0 -15
- package/dist/src/ui/components/subagents/types.js.map +0 -1
- package/dist/src/ui/components/subagents/utils.d.ts +0 -15
- package/dist/src/ui/components/subagents/utils.js +0 -79
- package/dist/src/ui/components/subagents/utils.js.map +0 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +0 -31
- package/dist/src/ui/contexts/KeypressContext.js +0 -388
- package/dist/src/ui/contexts/KeypressContext.js.map +0 -1
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
- package/dist/src/ui/contexts/KeypressContext.test.js +0 -754
- package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +0 -9
- package/dist/src/ui/contexts/SettingsContext.js +0 -15
- package/dist/src/ui/contexts/SettingsContext.js.map +0 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
- package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -824
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +0 -6
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +0 -328
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +0 -11
- package/dist/src/ui/hooks/useAgentsManagerDialog.js +0 -21
- package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +0 -6
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +0 -191
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +0 -34
- package/dist/src/ui/hooks/useDialogClose.js +0 -62
- package/dist/src/ui/hooks/useDialogClose.js.map +0 -1
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
- package/dist/src/ui/hooks/useEditorSettings.test.js +0 -164
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +0 -12
- package/dist/src/ui/hooks/useFolderTrust.js +0 -55
- package/dist/src/ui/hooks/useFolderTrust.js.map +0 -1
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
- package/dist/src/ui/hooks/useGitBranchName.test.js +0 -239
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
- package/dist/src/ui/hooks/useHistoryManager.test.js +0 -171
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
- package/dist/src/ui/hooks/useInputHistory.test.js +0 -207
- package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -15
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +0 -20
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +0 -1
- package/dist/src/ui/hooks/useLaunchEditor.d.ts +0 -10
- package/dist/src/ui/hooks/useLaunchEditor.js +0 -70
- package/dist/src/ui/hooks/useLaunchEditor.js.map +0 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -91
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +0 -22
- package/dist/src/ui/hooks/useMessageQueue.js +0 -49
- package/dist/src/ui/hooks/useMessageQueue.js.map +0 -1
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
- package/dist/src/ui/hooks/useMessageQueue.test.js +0 -158
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
- package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
- package/dist/src/ui/hooks/useQuitConfirmation.d.ts +0 -14
- package/dist/src/ui/hooks/useQuitConfirmation.js +0 -36
- package/dist/src/ui/hooks/useQuitConfirmation.js.map +0 -1
- package/dist/src/ui/hooks/useQwenAuth.test.d.ts +0 -6
- package/dist/src/ui/hooks/useQwenAuth.test.js +0 -288
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +0 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -163
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +0 -10
- package/dist/src/ui/hooks/useSettingsCommand.js +0 -21
- package/dist/src/ui/hooks/useSettingsCommand.js.map +0 -1
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
- package/dist/src/ui/hooks/useShellHistory.test.js +0 -162
- package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -6
- package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -272
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
- package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +0 -10
- package/dist/src/ui/hooks/useSubagentCreateDialog.js +0 -21
- package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +0 -1
- package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
- package/dist/src/ui/hooks/useTimer.test.js +0 -90
- package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
- package/dist/src/ui/hooks/useToolScheduler.test.js +0 -846
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +0 -23
- package/dist/src/ui/hooks/useWelcomeBack.js +0 -78
- package/dist/src/ui/hooks/useWelcomeBack.js.map +0 -1
- package/dist/src/ui/keyMatchers.d.ts +0 -26
- package/dist/src/ui/keyMatchers.js +0 -68
- package/dist/src/ui/keyMatchers.js.map +0 -1
- package/dist/src/ui/keyMatchers.test.d.ts +0 -6
- package/dist/src/ui/keyMatchers.test.js +0 -276
- package/dist/src/ui/keyMatchers.test.js.map +0 -1
- package/dist/src/ui/semantic-colors.d.ts +0 -7
- package/dist/src/ui/semantic-colors.js +0 -24
- package/dist/src/ui/semantic-colors.js.map +0 -1
- package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
- package/dist/src/ui/themes/color-utils.test.js +0 -197
- package/dist/src/ui/themes/color-utils.test.js.map +0 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +0 -37
- package/dist/src/ui/themes/semantic-tokens.js +0 -94
- package/dist/src/ui/themes/semantic-tokens.js.map +0 -1
- package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
- package/dist/src/ui/themes/theme-manager.test.js +0 -83
- package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
- package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -151
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/clipboardUtils.test.js +0 -65
- package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
- package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/commandUtils.test.js +0 -294
- package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
- package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/displayUtils.test.js +0 -42
- package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
- package/dist/src/ui/utils/formatters.test.d.ts +0 -6
- package/dist/src/ui/utils/formatters.test.js +0 -56
- package/dist/src/ui/utils/formatters.test.js.map +0 -1
- package/dist/src/ui/utils/isNarrowWidth.d.ts +0 -6
- package/dist/src/ui/utils/isNarrowWidth.js +0 -9
- package/dist/src/ui/utils/isNarrowWidth.js.map +0 -1
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +0 -13
- package/dist/src/ui/utils/kittyProtocolDetector.js +0 -88
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +0 -1
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
- package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
- package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
- package/dist/src/ui/utils/platformConstants.d.ts +0 -45
- package/dist/src/ui/utils/platformConstants.js +0 -46
- package/dist/src/ui/utils/platformConstants.js.map +0 -1
- package/dist/src/ui/utils/terminalSetup.d.ts +0 -30
- package/dist/src/ui/utils/terminalSetup.js +0 -281
- package/dist/src/ui/utils/terminalSetup.js.map +0 -1
- package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
- package/dist/src/ui/utils/updateCheck.test.js +0 -145
- package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
- package/dist/src/utils/checks.d.ts +0 -19
- package/dist/src/utils/checks.js +0 -24
- package/dist/src/utils/checks.js.map +0 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +0 -31
- package/dist/src/utils/dialogScopeUtils.js +0 -48
- package/dist/src/utils/dialogScopeUtils.js.map +0 -1
- package/dist/src/utils/gitUtils.test.d.ts +0 -6
- package/dist/src/utils/gitUtils.test.js +0 -113
- package/dist/src/utils/gitUtils.test.js.map +0 -1
- package/dist/src/utils/installationInfo.test.d.ts +0 -6
- package/dist/src/utils/installationInfo.test.js +0 -242
- package/dist/src/utils/installationInfo.test.js.map +0 -1
- package/dist/src/utils/settingsUtils.d.ts +0 -134
- package/dist/src/utils/settingsUtils.js +0 -336
- package/dist/src/utils/settingsUtils.js.map +0 -1
- package/dist/src/utils/settingsUtils.test.d.ts +0 -6
- package/dist/src/utils/settingsUtils.test.js +0 -514
- package/dist/src/utils/settingsUtils.test.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
- package/dist/src/utils/userStartupWarnings.test.js +0 -67
- package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
- package/dist/src/zed-integration/acp.d.ts +0 -63
- package/dist/src/zed-integration/acp.js.map +0 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +0 -19
- package/dist/src/zed-integration/fileSystemService.js +0 -43
- package/dist/src/zed-integration/fileSystemService.js.map +0 -1
- package/dist/src/zed-integration/schema.d.ts +0 -11782
- package/dist/src/zed-integration/schema.js +0 -311
- package/dist/src/zed-integration/schema.js.map +0 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +0 -10
- package/dist/src/zed-integration/zedIntegration.js +0 -765
- package/dist/src/zed-integration/zedIntegration.js.map +0 -1
|
@@ -5,16 +5,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
import { useEffect, useState, useRef } from 'react';
|
|
8
|
-
import { Text, Box } from 'ink';
|
|
8
|
+
import { Text, Box, useInput } from 'ink';
|
|
9
9
|
import { Colors } from '../../colors.js';
|
|
10
|
-
import { useKeypress } from '../../hooks/useKeypress.js';
|
|
11
10
|
/**
|
|
12
11
|
* A custom component that displays a list of items with radio buttons,
|
|
13
12
|
* supporting scrolling and keyboard navigation.
|
|
14
13
|
*
|
|
15
14
|
* @template T The type of the value associated with each radio item.
|
|
16
15
|
*/
|
|
17
|
-
export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlight, isFocused
|
|
16
|
+
export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlight, isFocused, showScrollArrows = false, maxItemsToShow = 10, showNumbers = true, }) {
|
|
18
17
|
const [activeIndex, setActiveIndex] = useState(initialIndex);
|
|
19
18
|
const [scrollOffset, setScrollOffset] = useState(0);
|
|
20
19
|
const [numberInput, setNumberInput] = useState('');
|
|
@@ -33,27 +32,26 @@ export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlig
|
|
|
33
32
|
clearTimeout(numberInputTimer.current);
|
|
34
33
|
}
|
|
35
34
|
}, []);
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
const isNumeric = showNumbers && /^[0-9]$/.test(sequence);
|
|
35
|
+
useInput((input, key) => {
|
|
36
|
+
const isNumeric = showNumbers && /^[0-9]$/.test(input);
|
|
39
37
|
// Any key press that is not a digit should clear the number input buffer.
|
|
40
38
|
if (!isNumeric && numberInputTimer.current) {
|
|
41
39
|
clearTimeout(numberInputTimer.current);
|
|
42
40
|
setNumberInput('');
|
|
43
41
|
}
|
|
44
|
-
if (
|
|
42
|
+
if (input === 'k' || key.upArrow) {
|
|
45
43
|
const newIndex = activeIndex > 0 ? activeIndex - 1 : items.length - 1;
|
|
46
44
|
setActiveIndex(newIndex);
|
|
47
45
|
onHighlight?.(items[newIndex].value);
|
|
48
46
|
return;
|
|
49
47
|
}
|
|
50
|
-
if (
|
|
48
|
+
if (input === 'j' || key.downArrow) {
|
|
51
49
|
const newIndex = activeIndex < items.length - 1 ? activeIndex + 1 : 0;
|
|
52
50
|
setActiveIndex(newIndex);
|
|
53
51
|
onHighlight?.(items[newIndex].value);
|
|
54
52
|
return;
|
|
55
53
|
}
|
|
56
|
-
if (
|
|
54
|
+
if (key.return) {
|
|
57
55
|
onSelect(items[activeIndex].value);
|
|
58
56
|
return;
|
|
59
57
|
}
|
|
@@ -62,7 +60,7 @@ export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlig
|
|
|
62
60
|
if (numberInputTimer.current) {
|
|
63
61
|
clearTimeout(numberInputTimer.current);
|
|
64
62
|
}
|
|
65
|
-
const newNumberInput = numberInput +
|
|
63
|
+
const newNumberInput = numberInput + input;
|
|
66
64
|
setNumberInput(newNumberInput);
|
|
67
65
|
const targetIndex = Number.parseInt(newNumberInput, 10) - 1;
|
|
68
66
|
// A single '0' is not a valid selection since items are 1-indexed.
|
|
@@ -93,7 +91,7 @@ export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlig
|
|
|
93
91
|
setNumberInput('');
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
|
-
}, { isActive:
|
|
94
|
+
}, { isActive: isFocused && items.length > 0 });
|
|
97
95
|
const visibleItems = items.slice(scrollOffset, scrollOffset + maxItemsToShow);
|
|
98
96
|
return (_jsxs(Box, { flexDirection: "column", children: [showScrollArrows && (_jsx(Text, { color: scrollOffset > 0 ? Colors.Foreground : Colors.Gray, children: "\u25B2" })), visibleItems.map((item, index) => {
|
|
99
97
|
const itemIndex = scrollOffset + index;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtonSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/RadioButtonSelect.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,GAAG,EA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CACnB,KAAC,IAAI,IACH,KAAK,EACH,YAAY,GAAG,cAAc,GAAG,KAAK,CAAC,MAAM;oBAC1C,CAAC,CAAC,MAAM,CAAC,UAAU;oBACnB,CAAC,CAAC,MAAM,CAAC,IAAI,uBAIZ,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -4,23 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export type Direction = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'home' | 'end';
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const getCharScript: (char: string) => string;
|
|
12
|
-
export declare const isDifferentScript: (char1: string, char2: string) => boolean;
|
|
13
|
-
export declare const findNextWordStartInLine: (line: string, col: number) => number | null;
|
|
14
|
-
export declare const findPrevWordStartInLine: (line: string, col: number) => number | null;
|
|
15
|
-
export declare const findWordEndInLine: (line: string, col: number) => number | null;
|
|
16
|
-
export declare const findNextWordAcrossLines: (lines: string[], cursorRow: number, cursorCol: number, searchForWordStart: boolean) => {
|
|
17
|
-
row: number;
|
|
18
|
-
col: number;
|
|
19
|
-
} | null;
|
|
20
|
-
export declare const findPrevWordAcrossLines: (lines: string[], cursorRow: number, cursorCol: number) => {
|
|
21
|
-
row: number;
|
|
22
|
-
col: number;
|
|
23
|
-
} | null;
|
|
7
|
+
export declare const findNextWordStart: (text: string, currentOffset: number) => number;
|
|
8
|
+
export declare const findPrevWordStart: (text: string, currentOffset: number) => number;
|
|
9
|
+
export declare const findWordEnd: (text: string, currentOffset: number) => number;
|
|
10
|
+
export declare const getOffsetFromPosition: (row: number, col: number, lines: string[]) => number;
|
|
24
11
|
export declare const getPositionFromOffsets: (startOffset: number, endOffset: number, lines: string[]) => {
|
|
25
12
|
startRow: number;
|
|
26
13
|
startCol: number;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import stripAnsi from 'strip-ansi';
|
|
7
|
-
import { stripVTControlCharacters } from 'util';
|
|
8
7
|
import { spawnSync } from 'child_process';
|
|
9
8
|
import fs from 'fs';
|
|
10
9
|
import os from 'os';
|
|
@@ -21,266 +20,112 @@ function isWordChar(ch) {
|
|
|
21
20
|
}
|
|
22
21
|
return !/[\s,.;!?]/.test(ch);
|
|
23
22
|
}
|
|
24
|
-
//
|
|
25
|
-
export const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
|
|
31
|
-
// Get the script of a character (simplified for common scripts)
|
|
32
|
-
export const getCharScript = (char) => {
|
|
33
|
-
if (/[\p{Script=Latin}]/u.test(char))
|
|
34
|
-
return 'latin'; // All Latin script chars including diacritics
|
|
35
|
-
if (/[\p{Script=Han}]/u.test(char))
|
|
36
|
-
return 'han'; // Chinese
|
|
37
|
-
if (/[\p{Script=Arabic}]/u.test(char))
|
|
38
|
-
return 'arabic';
|
|
39
|
-
if (/[\p{Script=Hiragana}]/u.test(char))
|
|
40
|
-
return 'hiragana';
|
|
41
|
-
if (/[\p{Script=Katakana}]/u.test(char))
|
|
42
|
-
return 'katakana';
|
|
43
|
-
if (/[\p{Script=Cyrillic}]/u.test(char))
|
|
44
|
-
return 'cyrillic';
|
|
45
|
-
return 'other';
|
|
46
|
-
};
|
|
47
|
-
// Check if two characters are from different scripts (indicating word boundary)
|
|
48
|
-
export const isDifferentScript = (char1, char2) => {
|
|
49
|
-
if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
|
|
50
|
-
return false;
|
|
51
|
-
return getCharScript(char1) !== getCharScript(char2);
|
|
52
|
-
};
|
|
53
|
-
// Find next word start within a line, starting from col
|
|
54
|
-
export const findNextWordStartInLine = (line, col) => {
|
|
55
|
-
const chars = toCodePoints(line);
|
|
56
|
-
let i = col;
|
|
57
|
-
if (i >= chars.length)
|
|
58
|
-
return null;
|
|
59
|
-
const currentChar = chars[i];
|
|
23
|
+
// Vim-specific word boundary functions
|
|
24
|
+
export const findNextWordStart = (text, currentOffset) => {
|
|
25
|
+
let i = currentOffset;
|
|
26
|
+
if (i >= text.length)
|
|
27
|
+
return i;
|
|
28
|
+
const currentChar = text[i];
|
|
60
29
|
// Skip current word/sequence based on character type
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (i + 1 < chars.length &&
|
|
65
|
-
isWordCharStrict(chars[i + 1]) &&
|
|
66
|
-
isDifferentScript(chars[i], chars[i + 1])) {
|
|
67
|
-
i++; // Include current character
|
|
68
|
-
break; // Stop at script boundary
|
|
69
|
-
}
|
|
30
|
+
if (/\w/.test(currentChar)) {
|
|
31
|
+
// Skip current word characters
|
|
32
|
+
while (i < text.length && /\w/.test(text[i])) {
|
|
70
33
|
i++;
|
|
71
34
|
}
|
|
72
35
|
}
|
|
73
|
-
else if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
!isWhitespace(chars[i])) {
|
|
36
|
+
else if (!/\s/.test(currentChar)) {
|
|
37
|
+
// Skip current non-word, non-whitespace characters (like "/", ".", etc.)
|
|
38
|
+
while (i < text.length && !/\w/.test(text[i]) && !/\s/.test(text[i])) {
|
|
77
39
|
i++;
|
|
78
40
|
}
|
|
79
41
|
}
|
|
80
42
|
// Skip whitespace
|
|
81
|
-
while (i <
|
|
43
|
+
while (i < text.length && /\s/.test(text[i])) {
|
|
82
44
|
i++;
|
|
83
45
|
}
|
|
84
|
-
|
|
46
|
+
// If we reached the end of text and there's no next word,
|
|
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;
|
|
85
58
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
59
|
+
export const findPrevWordStart = (text, currentOffset) => {
|
|
60
|
+
let i = currentOffset;
|
|
61
|
+
// If at beginning of text, return current position
|
|
62
|
+
if (i <= 0) {
|
|
63
|
+
return currentOffset;
|
|
64
|
+
}
|
|
65
|
+
// Move back one character to start searching
|
|
92
66
|
i--;
|
|
93
67
|
// Skip whitespace moving backwards
|
|
94
|
-
while (i >= 0 &&
|
|
68
|
+
while (i >= 0 && (text[i] === ' ' || text[i] === '\t' || text[i] === '\n')) {
|
|
95
69
|
i--;
|
|
96
70
|
}
|
|
97
|
-
if (i < 0)
|
|
98
|
-
return
|
|
99
|
-
|
|
71
|
+
if (i < 0) {
|
|
72
|
+
return 0; // Reached beginning of text
|
|
73
|
+
}
|
|
74
|
+
const charAtI = text[i];
|
|
75
|
+
if (/\w/.test(charAtI)) {
|
|
100
76
|
// We're in a word, move to its beginning
|
|
101
|
-
while (i >= 0 &&
|
|
102
|
-
// Check for script boundary - if previous character is from different script, stop here
|
|
103
|
-
if (i - 1 >= 0 &&
|
|
104
|
-
isWordCharStrict(chars[i - 1]) &&
|
|
105
|
-
isDifferentScript(chars[i], chars[i - 1])) {
|
|
106
|
-
return i; // Return current position at script boundary
|
|
107
|
-
}
|
|
77
|
+
while (i >= 0 && /\w/.test(text[i])) {
|
|
108
78
|
i--;
|
|
109
79
|
}
|
|
110
|
-
return i + 1;
|
|
80
|
+
return i + 1; // Return first character of word
|
|
111
81
|
}
|
|
112
82
|
else {
|
|
113
83
|
// We're in punctuation, move to its beginning
|
|
114
|
-
while (i >= 0 &&
|
|
84
|
+
while (i >= 0 &&
|
|
85
|
+
!/\w/.test(text[i]) &&
|
|
86
|
+
text[i] !== ' ' &&
|
|
87
|
+
text[i] !== '\t' &&
|
|
88
|
+
text[i] !== '\n') {
|
|
115
89
|
i--;
|
|
116
90
|
}
|
|
117
|
-
return i + 1;
|
|
91
|
+
return i + 1; // Return first character of punctuation sequence
|
|
118
92
|
}
|
|
119
93
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
isWordCharWithCombining(chars[i]) &&
|
|
128
|
-
(i + 1 >= chars.length ||
|
|
129
|
-
!isWordCharWithCombining(chars[i + 1]) ||
|
|
130
|
-
(isWordCharStrict(chars[i]) &&
|
|
131
|
-
i + 1 < chars.length &&
|
|
132
|
-
isWordCharStrict(chars[i + 1]) &&
|
|
133
|
-
isDifferentScript(chars[i], chars[i + 1])));
|
|
134
|
-
const atEndOfPunctuation = i < chars.length &&
|
|
135
|
-
!isWordCharWithCombining(chars[i]) &&
|
|
136
|
-
!isWhitespace(chars[i]) &&
|
|
137
|
-
(i + 1 >= chars.length ||
|
|
138
|
-
isWhitespace(chars[i + 1]) ||
|
|
139
|
-
isWordCharWithCombining(chars[i + 1]));
|
|
140
|
-
if (atEndOfWordChar || atEndOfPunctuation) {
|
|
141
|
-
// We're at the end of a word or punctuation sequence, move forward to find next word
|
|
94
|
+
export const findWordEnd = (text, currentOffset) => {
|
|
95
|
+
let i = currentOffset;
|
|
96
|
+
// If we're already at the end of a word, advance to next word
|
|
97
|
+
if (i < text.length &&
|
|
98
|
+
/\w/.test(text[i]) &&
|
|
99
|
+
(i + 1 >= text.length || !/\w/.test(text[i + 1]))) {
|
|
100
|
+
// We're at the end of a word, move forward to find next word
|
|
142
101
|
i++;
|
|
143
|
-
// Skip whitespace to find next word
|
|
144
|
-
while (i <
|
|
102
|
+
// Skip whitespace/punctuation to find next word
|
|
103
|
+
while (i < text.length && !/\w/.test(text[i])) {
|
|
145
104
|
i++;
|
|
146
105
|
}
|
|
147
106
|
}
|
|
148
|
-
// If we're not on a word character, find the next word
|
|
149
|
-
if (i <
|
|
150
|
-
|
|
151
|
-
while (i < chars.length && isWhitespace(chars[i])) {
|
|
107
|
+
// If we're not on a word character, find the next word
|
|
108
|
+
if (i < text.length && !/\w/.test(text[i])) {
|
|
109
|
+
while (i < text.length && !/\w/.test(text[i])) {
|
|
152
110
|
i++;
|
|
153
111
|
}
|
|
154
112
|
}
|
|
155
|
-
// Move to end of current word
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
159
|
-
// Handle word characters
|
|
160
|
-
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
161
|
-
foundWord = true;
|
|
162
|
-
// Track the position of the last base character (not combining mark)
|
|
163
|
-
if (isWordCharStrict(chars[i])) {
|
|
164
|
-
lastBaseCharPos = i;
|
|
165
|
-
}
|
|
166
|
-
// Check if next character is from a different script (word boundary)
|
|
167
|
-
if (i + 1 < chars.length &&
|
|
168
|
-
isWordCharStrict(chars[i + 1]) &&
|
|
169
|
-
isDifferentScript(chars[i], chars[i + 1])) {
|
|
170
|
-
i++; // Include current character
|
|
171
|
-
if (isWordCharStrict(chars[i - 1])) {
|
|
172
|
-
lastBaseCharPos = i - 1;
|
|
173
|
-
}
|
|
174
|
-
break; // Stop at script boundary
|
|
175
|
-
}
|
|
176
|
-
i++;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
else if (i < chars.length && !isWhitespace(chars[i])) {
|
|
180
|
-
// Handle punctuation sequences (like ████)
|
|
181
|
-
while (i < chars.length &&
|
|
182
|
-
!isWordCharStrict(chars[i]) &&
|
|
183
|
-
!isWhitespace(chars[i])) {
|
|
184
|
-
foundWord = true;
|
|
185
|
-
lastBaseCharPos = i;
|
|
186
|
-
i++;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// Only return a position if we actually found a word
|
|
190
|
-
// Return the position of the last base character, not combining marks
|
|
191
|
-
if (foundWord && lastBaseCharPos >= col) {
|
|
192
|
-
return lastBaseCharPos;
|
|
193
|
-
}
|
|
194
|
-
return null;
|
|
195
|
-
};
|
|
196
|
-
// Find next word across lines
|
|
197
|
-
export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
|
|
198
|
-
// First try current line
|
|
199
|
-
const currentLine = lines[cursorRow] || '';
|
|
200
|
-
const colInCurrentLine = searchForWordStart
|
|
201
|
-
? findNextWordStartInLine(currentLine, cursorCol)
|
|
202
|
-
: findWordEndInLine(currentLine, cursorCol);
|
|
203
|
-
if (colInCurrentLine !== null) {
|
|
204
|
-
return { row: cursorRow, col: colInCurrentLine };
|
|
205
|
-
}
|
|
206
|
-
// Search subsequent lines
|
|
207
|
-
for (let row = cursorRow + 1; row < lines.length; row++) {
|
|
208
|
-
const line = lines[row] || '';
|
|
209
|
-
const chars = toCodePoints(line);
|
|
210
|
-
// For empty lines, if we haven't found any words yet, return the empty line
|
|
211
|
-
if (chars.length === 0) {
|
|
212
|
-
// Check if there are any words in remaining lines
|
|
213
|
-
let hasWordsInLaterLines = false;
|
|
214
|
-
for (let laterRow = row + 1; laterRow < lines.length; laterRow++) {
|
|
215
|
-
const laterLine = lines[laterRow] || '';
|
|
216
|
-
const laterChars = toCodePoints(laterLine);
|
|
217
|
-
let firstNonWhitespace = 0;
|
|
218
|
-
while (firstNonWhitespace < laterChars.length &&
|
|
219
|
-
isWhitespace(laterChars[firstNonWhitespace])) {
|
|
220
|
-
firstNonWhitespace++;
|
|
221
|
-
}
|
|
222
|
-
if (firstNonWhitespace < laterChars.length) {
|
|
223
|
-
hasWordsInLaterLines = true;
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// If no words in later lines, return the empty line
|
|
228
|
-
if (!hasWordsInLaterLines) {
|
|
229
|
-
return { row, col: 0 };
|
|
230
|
-
}
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
// Find first non-whitespace
|
|
234
|
-
let firstNonWhitespace = 0;
|
|
235
|
-
while (firstNonWhitespace < chars.length &&
|
|
236
|
-
isWhitespace(chars[firstNonWhitespace])) {
|
|
237
|
-
firstNonWhitespace++;
|
|
238
|
-
}
|
|
239
|
-
if (firstNonWhitespace < chars.length) {
|
|
240
|
-
if (searchForWordStart) {
|
|
241
|
-
return { row, col: firstNonWhitespace };
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
// For word end, find the end of the first word
|
|
245
|
-
const endCol = findWordEndInLine(line, firstNonWhitespace);
|
|
246
|
-
if (endCol !== null) {
|
|
247
|
-
return { row, col: endCol };
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
113
|
+
// Move to end of current word
|
|
114
|
+
while (i < text.length && /\w/.test(text[i])) {
|
|
115
|
+
i++;
|
|
251
116
|
}
|
|
252
|
-
|
|
117
|
+
// Move back one to be on the last character of the word
|
|
118
|
+
return Math.max(currentOffset, i - 1);
|
|
253
119
|
};
|
|
254
|
-
//
|
|
255
|
-
export const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
if (colInCurrentLine !== null) {
|
|
260
|
-
return { row: cursorRow, col: colInCurrentLine };
|
|
261
|
-
}
|
|
262
|
-
// Search previous lines
|
|
263
|
-
for (let row = cursorRow - 1; row >= 0; row--) {
|
|
264
|
-
const line = lines[row] || '';
|
|
265
|
-
const chars = toCodePoints(line);
|
|
266
|
-
if (chars.length === 0)
|
|
267
|
-
continue;
|
|
268
|
-
// Find last word start
|
|
269
|
-
let lastWordStart = chars.length;
|
|
270
|
-
while (lastWordStart > 0 && isWhitespace(chars[lastWordStart - 1])) {
|
|
271
|
-
lastWordStart--;
|
|
272
|
-
}
|
|
273
|
-
if (lastWordStart > 0) {
|
|
274
|
-
// Find start of this word
|
|
275
|
-
const wordStart = findPrevWordStartInLine(line, lastWordStart);
|
|
276
|
-
if (wordStart !== null) {
|
|
277
|
-
return { row, col: wordStart };
|
|
278
|
-
}
|
|
279
|
-
}
|
|
120
|
+
// Helper functions for vim operations
|
|
121
|
+
export const getOffsetFromPosition = (row, col, lines) => {
|
|
122
|
+
let offset = 0;
|
|
123
|
+
for (let i = 0; i < row; i++) {
|
|
124
|
+
offset += lines[i].length + 1; // +1 for newline
|
|
280
125
|
}
|
|
281
|
-
|
|
126
|
+
offset += col;
|
|
127
|
+
return offset;
|
|
282
128
|
};
|
|
283
|
-
// Helper functions for vim line operations
|
|
284
129
|
export const getPositionFromOffsets = (startOffset, endOffset, lines) => {
|
|
285
130
|
let offset = 0;
|
|
286
131
|
let startRow = 0;
|
|
@@ -376,42 +221,21 @@ export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol,
|
|
|
376
221
|
/**
|
|
377
222
|
* Strip characters that can break terminal rendering.
|
|
378
223
|
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* Characters stripped:
|
|
383
|
-
* - ANSI escape sequences (via strip-ansi)
|
|
384
|
-
* - VT control sequences (via Node.js util.stripVTControlCharacters)
|
|
385
|
-
* - C0 control chars (0x00-0x1F) except CR/LF which are handled elsewhere
|
|
386
|
-
* - C1 control chars (0x80-0x9F) that can cause display issues
|
|
387
|
-
*
|
|
388
|
-
* Characters preserved:
|
|
389
|
-
* - All printable Unicode including emojis
|
|
390
|
-
* - DEL (0x7F) - handled functionally by applyOperations, not a display issue
|
|
391
|
-
* - CR/LF (0x0D/0x0A) - needed for line breaks
|
|
224
|
+
* Strip ANSI escape codes and control characters except for line breaks.
|
|
225
|
+
* Control characters such as delete break terminal UI rendering.
|
|
392
226
|
*/
|
|
393
227
|
function stripUnsafeCharacters(str) {
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
return toCodePoints(strippedVT)
|
|
228
|
+
const stripped = stripAnsi(str);
|
|
229
|
+
return toCodePoints(stripped)
|
|
397
230
|
.filter((char) => {
|
|
398
|
-
|
|
399
|
-
if (code === undefined)
|
|
231
|
+
if (char.length > 1)
|
|
400
232
|
return false;
|
|
401
|
-
|
|
402
|
-
if (code ===
|
|
403
|
-
return true;
|
|
404
|
-
// Remove C0 control chars (except CR/LF) that can break display
|
|
405
|
-
// Examples: BELL(0x07) makes noise, BS(0x08) moves cursor, VT(0x0B), FF(0x0C)
|
|
406
|
-
if (code >= 0x00 && code <= 0x1f)
|
|
407
|
-
return false;
|
|
408
|
-
// Remove C1 control chars (0x80-0x9F) - legacy 8-bit control codes
|
|
409
|
-
if (code >= 0x80 && code <= 0x9f)
|
|
233
|
+
const code = char.codePointAt(0);
|
|
234
|
+
if (code === undefined) {
|
|
410
235
|
return false;
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
return true;
|
|
236
|
+
}
|
|
237
|
+
const isUnsafe = code === 127 || (code <= 31 && code !== 13 && code !== 10);
|
|
238
|
+
return !isUnsafe;
|
|
415
239
|
})
|
|
416
240
|
.join('');
|
|
417
241
|
}
|
|
@@ -1395,12 +1219,6 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1395
1219
|
}, [text, stdin, setRawMode]);
|
|
1396
1220
|
const handleInput = useCallback((key) => {
|
|
1397
1221
|
const { sequence: input } = key;
|
|
1398
|
-
if (key.paste) {
|
|
1399
|
-
// Do not do any other processing on pastes so ensure we handle them
|
|
1400
|
-
// before all other cases.
|
|
1401
|
-
insert(input, { paste: key.paste });
|
|
1402
|
-
return;
|
|
1403
|
-
}
|
|
1404
1222
|
if (key.name === 'return' ||
|
|
1405
1223
|
input === '\r' ||
|
|
1406
1224
|
input === '\n' ||
|