@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
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { renderHook, act, waitFor } from '@testing-library/react';
|
|
3
|
-
import { vi } from 'vitest';
|
|
4
|
-
import { KeypressProvider, useKeypressContext, } from './KeypressContext.js';
|
|
5
|
-
import { useStdin } from 'ink';
|
|
6
|
-
import { EventEmitter } from 'events';
|
|
7
|
-
import { KITTY_KEYCODE_ENTER, KITTY_KEYCODE_NUMPAD_ENTER, KITTY_KEYCODE_TAB, KITTY_KEYCODE_BACKSPACE, } from '../utils/platformConstants.js';
|
|
8
|
-
// Mock the 'ink' module to control stdin
|
|
9
|
-
vi.mock('ink', async (importOriginal) => {
|
|
10
|
-
const original = await importOriginal();
|
|
11
|
-
return {
|
|
12
|
-
...original,
|
|
13
|
-
useStdin: vi.fn(),
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
class MockStdin extends EventEmitter {
|
|
17
|
-
isTTY = true;
|
|
18
|
-
setRawMode = vi.fn();
|
|
19
|
-
on = this.addListener;
|
|
20
|
-
removeListener = super.removeListener;
|
|
21
|
-
write = vi.fn();
|
|
22
|
-
resume = vi.fn();
|
|
23
|
-
pause = vi.fn();
|
|
24
|
-
// Helper to simulate a keypress event
|
|
25
|
-
pressKey(key) {
|
|
26
|
-
this.emit('keypress', null, key);
|
|
27
|
-
}
|
|
28
|
-
// Helper to simulate a kitty protocol sequence
|
|
29
|
-
sendKittySequence(sequence) {
|
|
30
|
-
this.emit('data', Buffer.from(sequence));
|
|
31
|
-
}
|
|
32
|
-
// Helper to simulate a paste event
|
|
33
|
-
sendPaste(text) {
|
|
34
|
-
const PASTE_MODE_PREFIX = `\x1b[200~`;
|
|
35
|
-
const PASTE_MODE_SUFFIX = `\x1b[201~`;
|
|
36
|
-
this.emit('data', Buffer.from(PASTE_MODE_PREFIX));
|
|
37
|
-
this.emit('data', Buffer.from(text));
|
|
38
|
-
this.emit('data', Buffer.from(PASTE_MODE_SUFFIX));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
describe('KeypressContext - Kitty Protocol', () => {
|
|
42
|
-
let stdin;
|
|
43
|
-
const mockSetRawMode = vi.fn();
|
|
44
|
-
const wrapper = ({ children, kittyProtocolEnabled = true, pasteWorkaround = false, }) => (_jsx(KeypressProvider, { kittyProtocolEnabled: kittyProtocolEnabled, pasteWorkaround: pasteWorkaround, children: children }));
|
|
45
|
-
beforeEach(() => {
|
|
46
|
-
vi.clearAllMocks();
|
|
47
|
-
stdin = new MockStdin();
|
|
48
|
-
useStdin.mockReturnValue({
|
|
49
|
-
stdin,
|
|
50
|
-
setRawMode: mockSetRawMode,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('Enter key handling', () => {
|
|
54
|
-
it('should recognize regular enter key (keycode 13) in kitty protocol', async () => {
|
|
55
|
-
const keyHandler = vi.fn();
|
|
56
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
57
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: true }),
|
|
58
|
-
});
|
|
59
|
-
act(() => {
|
|
60
|
-
result.current.subscribe(keyHandler);
|
|
61
|
-
});
|
|
62
|
-
// Send kitty protocol sequence for regular enter: ESC[13u
|
|
63
|
-
act(() => {
|
|
64
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_ENTER}u`);
|
|
65
|
-
});
|
|
66
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
67
|
-
name: 'return',
|
|
68
|
-
kittyProtocol: true,
|
|
69
|
-
ctrl: false,
|
|
70
|
-
meta: false,
|
|
71
|
-
shift: false,
|
|
72
|
-
}));
|
|
73
|
-
});
|
|
74
|
-
it('should recognize numpad enter key (keycode 57414) in kitty protocol', async () => {
|
|
75
|
-
const keyHandler = vi.fn();
|
|
76
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
77
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: true }),
|
|
78
|
-
});
|
|
79
|
-
act(() => {
|
|
80
|
-
result.current.subscribe(keyHandler);
|
|
81
|
-
});
|
|
82
|
-
// Send kitty protocol sequence for numpad enter: ESC[57414u
|
|
83
|
-
act(() => {
|
|
84
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_NUMPAD_ENTER}u`);
|
|
85
|
-
});
|
|
86
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
87
|
-
name: 'return',
|
|
88
|
-
kittyProtocol: true,
|
|
89
|
-
ctrl: false,
|
|
90
|
-
meta: false,
|
|
91
|
-
shift: false,
|
|
92
|
-
}));
|
|
93
|
-
});
|
|
94
|
-
it('should handle numpad enter with modifiers', async () => {
|
|
95
|
-
const keyHandler = vi.fn();
|
|
96
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
97
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: true }),
|
|
98
|
-
});
|
|
99
|
-
act(() => {
|
|
100
|
-
result.current.subscribe(keyHandler);
|
|
101
|
-
});
|
|
102
|
-
// Send kitty protocol sequence for numpad enter with Shift (modifier 2): ESC[57414;2u
|
|
103
|
-
act(() => {
|
|
104
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_NUMPAD_ENTER};2u`);
|
|
105
|
-
});
|
|
106
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
107
|
-
name: 'return',
|
|
108
|
-
kittyProtocol: true,
|
|
109
|
-
ctrl: false,
|
|
110
|
-
meta: false,
|
|
111
|
-
shift: true,
|
|
112
|
-
}));
|
|
113
|
-
});
|
|
114
|
-
it('should handle numpad enter with Ctrl modifier', async () => {
|
|
115
|
-
const keyHandler = vi.fn();
|
|
116
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
117
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: true }),
|
|
118
|
-
});
|
|
119
|
-
act(() => {
|
|
120
|
-
result.current.subscribe(keyHandler);
|
|
121
|
-
});
|
|
122
|
-
// Send kitty protocol sequence for numpad enter with Ctrl (modifier 5): ESC[57414;5u
|
|
123
|
-
act(() => {
|
|
124
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_NUMPAD_ENTER};5u`);
|
|
125
|
-
});
|
|
126
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
127
|
-
name: 'return',
|
|
128
|
-
kittyProtocol: true,
|
|
129
|
-
ctrl: true,
|
|
130
|
-
meta: false,
|
|
131
|
-
shift: false,
|
|
132
|
-
}));
|
|
133
|
-
});
|
|
134
|
-
it('should handle numpad enter with Alt modifier', async () => {
|
|
135
|
-
const keyHandler = vi.fn();
|
|
136
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
137
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: true }),
|
|
138
|
-
});
|
|
139
|
-
act(() => {
|
|
140
|
-
result.current.subscribe(keyHandler);
|
|
141
|
-
});
|
|
142
|
-
// Send kitty protocol sequence for numpad enter with Alt (modifier 3): ESC[57414;3u
|
|
143
|
-
act(() => {
|
|
144
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_NUMPAD_ENTER};3u`);
|
|
145
|
-
});
|
|
146
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
147
|
-
name: 'return',
|
|
148
|
-
kittyProtocol: true,
|
|
149
|
-
ctrl: false,
|
|
150
|
-
meta: true,
|
|
151
|
-
shift: false,
|
|
152
|
-
}));
|
|
153
|
-
});
|
|
154
|
-
it('should not process kitty sequences when kitty protocol is disabled', async () => {
|
|
155
|
-
const keyHandler = vi.fn();
|
|
156
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
157
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: false }),
|
|
158
|
-
});
|
|
159
|
-
act(() => {
|
|
160
|
-
result.current.subscribe(keyHandler);
|
|
161
|
-
});
|
|
162
|
-
// Send kitty protocol sequence for numpad enter
|
|
163
|
-
act(() => {
|
|
164
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_NUMPAD_ENTER}u`);
|
|
165
|
-
});
|
|
166
|
-
// When kitty protocol is disabled, the sequence should be passed through
|
|
167
|
-
// as individual keypresses, not recognized as a single enter key
|
|
168
|
-
expect(keyHandler).not.toHaveBeenCalledWith(expect.objectContaining({
|
|
169
|
-
name: 'return',
|
|
170
|
-
kittyProtocol: true,
|
|
171
|
-
}));
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
describe('Escape key handling', () => {
|
|
175
|
-
it('should recognize escape key (keycode 27) in kitty protocol', async () => {
|
|
176
|
-
const keyHandler = vi.fn();
|
|
177
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
178
|
-
wrapper: ({ children }) => wrapper({ children, kittyProtocolEnabled: true }),
|
|
179
|
-
});
|
|
180
|
-
act(() => {
|
|
181
|
-
result.current.subscribe(keyHandler);
|
|
182
|
-
});
|
|
183
|
-
// Send kitty protocol sequence for escape: ESC[27u
|
|
184
|
-
act(() => {
|
|
185
|
-
stdin.sendKittySequence('\x1b[27u');
|
|
186
|
-
});
|
|
187
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
188
|
-
name: 'escape',
|
|
189
|
-
kittyProtocol: true,
|
|
190
|
-
}));
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
describe('Tab and Backspace handling', () => {
|
|
194
|
-
it('should recognize Tab key in kitty protocol', async () => {
|
|
195
|
-
const keyHandler = vi.fn();
|
|
196
|
-
const { result } = renderHook(() => useKeypressContext(), { wrapper });
|
|
197
|
-
act(() => result.current.subscribe(keyHandler));
|
|
198
|
-
act(() => {
|
|
199
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_TAB}u`);
|
|
200
|
-
});
|
|
201
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
202
|
-
name: 'tab',
|
|
203
|
-
kittyProtocol: true,
|
|
204
|
-
shift: false,
|
|
205
|
-
}));
|
|
206
|
-
});
|
|
207
|
-
it('should recognize Shift+Tab in kitty protocol', async () => {
|
|
208
|
-
const keyHandler = vi.fn();
|
|
209
|
-
const { result } = renderHook(() => useKeypressContext(), { wrapper });
|
|
210
|
-
act(() => result.current.subscribe(keyHandler));
|
|
211
|
-
// Modifier 2 is Shift
|
|
212
|
-
act(() => {
|
|
213
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_TAB};2u`);
|
|
214
|
-
});
|
|
215
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
216
|
-
name: 'tab',
|
|
217
|
-
kittyProtocol: true,
|
|
218
|
-
shift: true,
|
|
219
|
-
}));
|
|
220
|
-
});
|
|
221
|
-
it('should recognize Backspace key in kitty protocol', async () => {
|
|
222
|
-
const keyHandler = vi.fn();
|
|
223
|
-
const { result } = renderHook(() => useKeypressContext(), { wrapper });
|
|
224
|
-
act(() => result.current.subscribe(keyHandler));
|
|
225
|
-
act(() => {
|
|
226
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_BACKSPACE}u`);
|
|
227
|
-
});
|
|
228
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
229
|
-
name: 'backspace',
|
|
230
|
-
kittyProtocol: true,
|
|
231
|
-
meta: false,
|
|
232
|
-
}));
|
|
233
|
-
});
|
|
234
|
-
it('should recognize Option+Backspace in kitty protocol', async () => {
|
|
235
|
-
const keyHandler = vi.fn();
|
|
236
|
-
const { result } = renderHook(() => useKeypressContext(), { wrapper });
|
|
237
|
-
act(() => result.current.subscribe(keyHandler));
|
|
238
|
-
// Modifier 3 is Alt/Option
|
|
239
|
-
act(() => {
|
|
240
|
-
stdin.sendKittySequence(`\x1b[${KITTY_KEYCODE_BACKSPACE};3u`);
|
|
241
|
-
});
|
|
242
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
243
|
-
name: 'backspace',
|
|
244
|
-
kittyProtocol: true,
|
|
245
|
-
meta: true,
|
|
246
|
-
}));
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
describe('paste mode', () => {
|
|
250
|
-
it('should handle multiline paste as a single event', async () => {
|
|
251
|
-
const keyHandler = vi.fn();
|
|
252
|
-
const pastedText = 'This \n is \n a \n multiline \n paste.';
|
|
253
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
254
|
-
wrapper,
|
|
255
|
-
});
|
|
256
|
-
act(() => {
|
|
257
|
-
result.current.subscribe(keyHandler);
|
|
258
|
-
});
|
|
259
|
-
// Simulate a bracketed paste event
|
|
260
|
-
act(() => {
|
|
261
|
-
stdin.sendPaste(pastedText);
|
|
262
|
-
});
|
|
263
|
-
await waitFor(() => {
|
|
264
|
-
// Expect the handler to be called exactly once for the entire paste
|
|
265
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
266
|
-
});
|
|
267
|
-
// Verify the single event contains the full pasted text
|
|
268
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
269
|
-
paste: true,
|
|
270
|
-
sequence: pastedText,
|
|
271
|
-
}));
|
|
272
|
-
});
|
|
273
|
-
describe('paste mode markers', () => {
|
|
274
|
-
// These tests use pasteWorkaround=true to force passthrough mode for raw keypress testing
|
|
275
|
-
it('should handle complete paste sequence with markers', async () => {
|
|
276
|
-
const keyHandler = vi.fn();
|
|
277
|
-
const pastedText = 'pasted content';
|
|
278
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
279
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
280
|
-
});
|
|
281
|
-
act(() => {
|
|
282
|
-
result.current.subscribe(keyHandler);
|
|
283
|
-
});
|
|
284
|
-
// Send complete paste sequence: prefix + content + suffix
|
|
285
|
-
act(() => {
|
|
286
|
-
stdin.emit('data', Buffer.from(`\x1b[200~${pastedText}\x1b[201~`));
|
|
287
|
-
});
|
|
288
|
-
await waitFor(() => {
|
|
289
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
290
|
-
});
|
|
291
|
-
// Should emit a single paste event with the content
|
|
292
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
293
|
-
paste: true,
|
|
294
|
-
sequence: pastedText,
|
|
295
|
-
name: '',
|
|
296
|
-
}));
|
|
297
|
-
});
|
|
298
|
-
it('should handle empty paste sequence', async () => {
|
|
299
|
-
const keyHandler = vi.fn();
|
|
300
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
301
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
302
|
-
});
|
|
303
|
-
act(() => {
|
|
304
|
-
result.current.subscribe(keyHandler);
|
|
305
|
-
});
|
|
306
|
-
// Send empty paste sequence: prefix immediately followed by suffix
|
|
307
|
-
act(() => {
|
|
308
|
-
stdin.emit('data', Buffer.from('\x1b[200~\x1b[201~'));
|
|
309
|
-
});
|
|
310
|
-
await waitFor(() => {
|
|
311
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
312
|
-
});
|
|
313
|
-
// Should emit a paste event with empty content
|
|
314
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
315
|
-
paste: true,
|
|
316
|
-
sequence: '',
|
|
317
|
-
name: '',
|
|
318
|
-
}));
|
|
319
|
-
});
|
|
320
|
-
it('should handle data before paste markers', async () => {
|
|
321
|
-
const keyHandler = vi.fn();
|
|
322
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
323
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
324
|
-
});
|
|
325
|
-
act(() => {
|
|
326
|
-
result.current.subscribe(keyHandler);
|
|
327
|
-
});
|
|
328
|
-
// Send data before paste sequence
|
|
329
|
-
act(() => {
|
|
330
|
-
stdin.emit('data', Buffer.from('before\x1b[200~pasted\x1b[201~'));
|
|
331
|
-
});
|
|
332
|
-
await waitFor(() => {
|
|
333
|
-
expect(keyHandler).toHaveBeenCalledTimes(7); // 6 chars + 1 paste event
|
|
334
|
-
});
|
|
335
|
-
// Should process 'before' as individual characters
|
|
336
|
-
expect(keyHandler).toHaveBeenNthCalledWith(1, expect.objectContaining({ name: 'b' }));
|
|
337
|
-
expect(keyHandler).toHaveBeenNthCalledWith(2, expect.objectContaining({ name: 'e' }));
|
|
338
|
-
expect(keyHandler).toHaveBeenNthCalledWith(3, expect.objectContaining({ name: 'f' }));
|
|
339
|
-
expect(keyHandler).toHaveBeenNthCalledWith(4, expect.objectContaining({ name: 'o' }));
|
|
340
|
-
expect(keyHandler).toHaveBeenNthCalledWith(5, expect.objectContaining({ name: 'r' }));
|
|
341
|
-
expect(keyHandler).toHaveBeenNthCalledWith(6, expect.objectContaining({ name: 'e' }));
|
|
342
|
-
// Then emit paste event
|
|
343
|
-
expect(keyHandler).toHaveBeenNthCalledWith(7, expect.objectContaining({
|
|
344
|
-
paste: true,
|
|
345
|
-
sequence: 'pasted',
|
|
346
|
-
}));
|
|
347
|
-
});
|
|
348
|
-
it('should handle data after paste markers', async () => {
|
|
349
|
-
const keyHandler = vi.fn();
|
|
350
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
351
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
352
|
-
});
|
|
353
|
-
act(() => {
|
|
354
|
-
result.current.subscribe(keyHandler);
|
|
355
|
-
});
|
|
356
|
-
// Send paste sequence followed by data
|
|
357
|
-
act(() => {
|
|
358
|
-
stdin.emit('data', Buffer.from('\x1b[200~pasted\x1b[201~after'));
|
|
359
|
-
});
|
|
360
|
-
await waitFor(() => {
|
|
361
|
-
expect(keyHandler).toHaveBeenCalledTimes(2); // 1 paste event + 1 paste event for 'after'
|
|
362
|
-
});
|
|
363
|
-
// Should emit paste event first
|
|
364
|
-
expect(keyHandler).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
365
|
-
paste: true,
|
|
366
|
-
sequence: 'pasted',
|
|
367
|
-
}));
|
|
368
|
-
// Then process 'after' as a paste event (since it's > 2 chars)
|
|
369
|
-
expect(keyHandler).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
370
|
-
paste: true,
|
|
371
|
-
sequence: 'after',
|
|
372
|
-
}));
|
|
373
|
-
});
|
|
374
|
-
it('should handle complex sequence with multiple paste blocks', async () => {
|
|
375
|
-
const keyHandler = vi.fn();
|
|
376
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
377
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
378
|
-
});
|
|
379
|
-
act(() => {
|
|
380
|
-
result.current.subscribe(keyHandler);
|
|
381
|
-
});
|
|
382
|
-
// Send complex sequence: data + paste1 + data + paste2 + data
|
|
383
|
-
act(() => {
|
|
384
|
-
stdin.emit('data', Buffer.from('start\x1b[200~first\x1b[201~middle\x1b[200~second\x1b[201~end'));
|
|
385
|
-
});
|
|
386
|
-
await waitFor(() => {
|
|
387
|
-
expect(keyHandler).toHaveBeenCalledTimes(14); // Adjusted based on actual behavior
|
|
388
|
-
});
|
|
389
|
-
// Check the sequence: 'start' (5 chars) + paste1 + 'middle' (6 chars) + paste2 + 'end' (3 chars as paste)
|
|
390
|
-
let callIndex = 1;
|
|
391
|
-
// 'start'
|
|
392
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 's' }));
|
|
393
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 't' }));
|
|
394
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'a' }));
|
|
395
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'r' }));
|
|
396
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 't' }));
|
|
397
|
-
// first paste
|
|
398
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({
|
|
399
|
-
paste: true,
|
|
400
|
-
sequence: 'first',
|
|
401
|
-
}));
|
|
402
|
-
// 'middle'
|
|
403
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'm' }));
|
|
404
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'i' }));
|
|
405
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'd' }));
|
|
406
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'd' }));
|
|
407
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'l' }));
|
|
408
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({ name: 'e' }));
|
|
409
|
-
// second paste
|
|
410
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({
|
|
411
|
-
paste: true,
|
|
412
|
-
sequence: 'second',
|
|
413
|
-
}));
|
|
414
|
-
// 'end' as paste event (since it's > 2 chars)
|
|
415
|
-
expect(keyHandler).toHaveBeenNthCalledWith(callIndex++, expect.objectContaining({
|
|
416
|
-
paste: true,
|
|
417
|
-
sequence: 'end',
|
|
418
|
-
}));
|
|
419
|
-
});
|
|
420
|
-
it('should handle fragmented paste markers across multiple data events', async () => {
|
|
421
|
-
const keyHandler = vi.fn();
|
|
422
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
423
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
424
|
-
});
|
|
425
|
-
act(() => {
|
|
426
|
-
result.current.subscribe(keyHandler);
|
|
427
|
-
});
|
|
428
|
-
// Send fragmented paste sequence
|
|
429
|
-
act(() => {
|
|
430
|
-
stdin.emit('data', Buffer.from('\x1b[200~partial'));
|
|
431
|
-
stdin.emit('data', Buffer.from(' content\x1b[201~'));
|
|
432
|
-
});
|
|
433
|
-
await waitFor(() => {
|
|
434
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
435
|
-
});
|
|
436
|
-
// Should combine the fragmented content into a single paste event
|
|
437
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
438
|
-
paste: true,
|
|
439
|
-
sequence: 'partial content',
|
|
440
|
-
}));
|
|
441
|
-
});
|
|
442
|
-
it('should handle multiline content within paste markers', async () => {
|
|
443
|
-
const keyHandler = vi.fn();
|
|
444
|
-
const multilineContent = 'line1\nline2\nline3';
|
|
445
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
446
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
447
|
-
});
|
|
448
|
-
act(() => {
|
|
449
|
-
result.current.subscribe(keyHandler);
|
|
450
|
-
});
|
|
451
|
-
// Send paste sequence with multiline content
|
|
452
|
-
act(() => {
|
|
453
|
-
stdin.emit('data', Buffer.from(`\x1b[200~${multilineContent}\x1b[201~`));
|
|
454
|
-
});
|
|
455
|
-
await waitFor(() => {
|
|
456
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
457
|
-
});
|
|
458
|
-
// Should emit a single paste event with the multiline content
|
|
459
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
460
|
-
paste: true,
|
|
461
|
-
sequence: multilineContent,
|
|
462
|
-
}));
|
|
463
|
-
});
|
|
464
|
-
it('should handle paste markers split across buffer boundaries', async () => {
|
|
465
|
-
const keyHandler = vi.fn();
|
|
466
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
467
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
468
|
-
});
|
|
469
|
-
act(() => {
|
|
470
|
-
result.current.subscribe(keyHandler);
|
|
471
|
-
});
|
|
472
|
-
// Send paste marker split across multiple data events
|
|
473
|
-
act(() => {
|
|
474
|
-
stdin.emit('data', Buffer.from('\x1b[20'));
|
|
475
|
-
stdin.emit('data', Buffer.from('0~content\x1b[2'));
|
|
476
|
-
stdin.emit('data', Buffer.from('01~'));
|
|
477
|
-
});
|
|
478
|
-
await waitFor(() => {
|
|
479
|
-
// With the current implementation, fragmented data gets processed differently
|
|
480
|
-
// The first fragment '\x1b[20' gets processed as individual characters
|
|
481
|
-
// The second fragment '0~content\x1b[2' gets processed as paste + individual chars
|
|
482
|
-
// The third fragment '01~' gets processed as individual characters
|
|
483
|
-
expect(keyHandler).toHaveBeenCalled();
|
|
484
|
-
});
|
|
485
|
-
// The current implementation processes fragmented paste markers as separate events
|
|
486
|
-
// rather than reconstructing them into a single paste event
|
|
487
|
-
expect(keyHandler.mock.calls.length).toBeGreaterThan(1);
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
|
-
it('buffers fragmented paste chunks before emitting newlines', () => {
|
|
491
|
-
vi.useFakeTimers();
|
|
492
|
-
const keyHandler = vi.fn();
|
|
493
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
494
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
495
|
-
});
|
|
496
|
-
act(() => {
|
|
497
|
-
result.current.subscribe(keyHandler);
|
|
498
|
-
});
|
|
499
|
-
try {
|
|
500
|
-
act(() => {
|
|
501
|
-
stdin.emit('data', Buffer.from('\r'));
|
|
502
|
-
stdin.emit('data', Buffer.from('rest of paste'));
|
|
503
|
-
});
|
|
504
|
-
act(() => {
|
|
505
|
-
vi.advanceTimersByTime(8);
|
|
506
|
-
});
|
|
507
|
-
// With the current implementation, fragmented data gets combined and
|
|
508
|
-
// treated as a single paste event due to the buffering mechanism
|
|
509
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
510
|
-
// Should be treated as a paste event with the combined content
|
|
511
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
512
|
-
paste: true,
|
|
513
|
-
sequence: '\rrest of paste',
|
|
514
|
-
}));
|
|
515
|
-
}
|
|
516
|
-
finally {
|
|
517
|
-
vi.useRealTimers();
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
});
|
|
521
|
-
describe('Raw keypress pipeline', () => {
|
|
522
|
-
// These tests use pasteWorkaround=true to force passthrough mode for raw keypress testing
|
|
523
|
-
it('should buffer input data and wait for timeout', () => {
|
|
524
|
-
vi.useFakeTimers();
|
|
525
|
-
const keyHandler = vi.fn();
|
|
526
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
527
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
528
|
-
});
|
|
529
|
-
act(() => {
|
|
530
|
-
result.current.subscribe(keyHandler);
|
|
531
|
-
});
|
|
532
|
-
try {
|
|
533
|
-
// Send single character
|
|
534
|
-
act(() => {
|
|
535
|
-
stdin.emit('data', Buffer.from('a'));
|
|
536
|
-
});
|
|
537
|
-
// With the current implementation, single characters are processed immediately
|
|
538
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
539
|
-
name: 'a',
|
|
540
|
-
sequence: 'a',
|
|
541
|
-
}));
|
|
542
|
-
}
|
|
543
|
-
finally {
|
|
544
|
-
vi.useRealTimers();
|
|
545
|
-
}
|
|
546
|
-
});
|
|
547
|
-
it('should concatenate new data and reset timeout', () => {
|
|
548
|
-
vi.useFakeTimers();
|
|
549
|
-
const keyHandler = vi.fn();
|
|
550
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
551
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
552
|
-
});
|
|
553
|
-
act(() => {
|
|
554
|
-
result.current.subscribe(keyHandler);
|
|
555
|
-
});
|
|
556
|
-
try {
|
|
557
|
-
// Send first chunk
|
|
558
|
-
act(() => {
|
|
559
|
-
stdin.emit('data', Buffer.from('hel'));
|
|
560
|
-
});
|
|
561
|
-
// Advance timer partially
|
|
562
|
-
act(() => {
|
|
563
|
-
vi.advanceTimersByTime(4);
|
|
564
|
-
});
|
|
565
|
-
// Send second chunk before timeout
|
|
566
|
-
act(() => {
|
|
567
|
-
stdin.emit('data', Buffer.from('lo'));
|
|
568
|
-
});
|
|
569
|
-
// With the current implementation, data is processed as it arrives
|
|
570
|
-
// First chunk 'hel' is treated as paste (multi-character)
|
|
571
|
-
expect(keyHandler).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
572
|
-
paste: true,
|
|
573
|
-
sequence: 'hel',
|
|
574
|
-
}));
|
|
575
|
-
// Second chunk 'lo' is processed as individual characters
|
|
576
|
-
expect(keyHandler).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
577
|
-
name: 'l',
|
|
578
|
-
sequence: 'l',
|
|
579
|
-
paste: false,
|
|
580
|
-
}));
|
|
581
|
-
expect(keyHandler).toHaveBeenNthCalledWith(3, expect.objectContaining({
|
|
582
|
-
name: 'o',
|
|
583
|
-
sequence: 'o',
|
|
584
|
-
paste: false,
|
|
585
|
-
}));
|
|
586
|
-
expect(keyHandler).toHaveBeenCalledTimes(3);
|
|
587
|
-
}
|
|
588
|
-
finally {
|
|
589
|
-
vi.useRealTimers();
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
it('should flush immediately when buffer exceeds limit', () => {
|
|
593
|
-
vi.useFakeTimers();
|
|
594
|
-
const keyHandler = vi.fn();
|
|
595
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
596
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
597
|
-
});
|
|
598
|
-
act(() => {
|
|
599
|
-
result.current.subscribe(keyHandler);
|
|
600
|
-
});
|
|
601
|
-
try {
|
|
602
|
-
// Create a large buffer that exceeds the 64 byte limit
|
|
603
|
-
const largeData = 'x'.repeat(65);
|
|
604
|
-
act(() => {
|
|
605
|
-
stdin.emit('data', Buffer.from(largeData));
|
|
606
|
-
});
|
|
607
|
-
// Should flush immediately without waiting for timeout
|
|
608
|
-
// Large data gets treated as paste event
|
|
609
|
-
expect(keyHandler).toHaveBeenCalledTimes(1);
|
|
610
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
611
|
-
paste: true,
|
|
612
|
-
sequence: largeData,
|
|
613
|
-
}));
|
|
614
|
-
// Advancing timer should not cause additional calls
|
|
615
|
-
const callCountBefore = keyHandler.mock.calls.length;
|
|
616
|
-
act(() => {
|
|
617
|
-
vi.advanceTimersByTime(8);
|
|
618
|
-
});
|
|
619
|
-
expect(keyHandler).toHaveBeenCalledTimes(callCountBefore);
|
|
620
|
-
}
|
|
621
|
-
finally {
|
|
622
|
-
vi.useRealTimers();
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
it('should clear timeout when new data arrives', () => {
|
|
626
|
-
vi.useFakeTimers();
|
|
627
|
-
const keyHandler = vi.fn();
|
|
628
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
629
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
630
|
-
});
|
|
631
|
-
act(() => {
|
|
632
|
-
result.current.subscribe(keyHandler);
|
|
633
|
-
});
|
|
634
|
-
try {
|
|
635
|
-
// Send first chunk
|
|
636
|
-
act(() => {
|
|
637
|
-
stdin.emit('data', Buffer.from('a'));
|
|
638
|
-
});
|
|
639
|
-
// Advance timer almost to completion
|
|
640
|
-
act(() => {
|
|
641
|
-
vi.advanceTimersByTime(7);
|
|
642
|
-
});
|
|
643
|
-
// Send second chunk (should reset timeout)
|
|
644
|
-
act(() => {
|
|
645
|
-
stdin.emit('data', Buffer.from('b'));
|
|
646
|
-
});
|
|
647
|
-
// With the current implementation, both characters are processed immediately
|
|
648
|
-
expect(keyHandler).toHaveBeenCalledTimes(2);
|
|
649
|
-
// First event should be 'a', second should be 'b'
|
|
650
|
-
expect(keyHandler).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
651
|
-
name: 'a',
|
|
652
|
-
sequence: 'a',
|
|
653
|
-
paste: false,
|
|
654
|
-
}));
|
|
655
|
-
expect(keyHandler).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
656
|
-
name: 'b',
|
|
657
|
-
sequence: 'b',
|
|
658
|
-
paste: false,
|
|
659
|
-
}));
|
|
660
|
-
}
|
|
661
|
-
finally {
|
|
662
|
-
vi.useRealTimers();
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
it('should handle multiple separate keypress events', () => {
|
|
666
|
-
vi.useFakeTimers();
|
|
667
|
-
const keyHandler = vi.fn();
|
|
668
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
669
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
670
|
-
});
|
|
671
|
-
act(() => {
|
|
672
|
-
result.current.subscribe(keyHandler);
|
|
673
|
-
});
|
|
674
|
-
try {
|
|
675
|
-
// First keypress
|
|
676
|
-
act(() => {
|
|
677
|
-
stdin.emit('data', Buffer.from('a'));
|
|
678
|
-
});
|
|
679
|
-
act(() => {
|
|
680
|
-
vi.advanceTimersByTime(8);
|
|
681
|
-
});
|
|
682
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
683
|
-
sequence: 'a',
|
|
684
|
-
}));
|
|
685
|
-
keyHandler.mockClear();
|
|
686
|
-
// Second keypress after first completed
|
|
687
|
-
act(() => {
|
|
688
|
-
stdin.emit('data', Buffer.from('b'));
|
|
689
|
-
});
|
|
690
|
-
act(() => {
|
|
691
|
-
vi.advanceTimersByTime(8);
|
|
692
|
-
});
|
|
693
|
-
expect(keyHandler).toHaveBeenCalledWith(expect.objectContaining({
|
|
694
|
-
sequence: 'b',
|
|
695
|
-
}));
|
|
696
|
-
}
|
|
697
|
-
finally {
|
|
698
|
-
vi.useRealTimers();
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
it('should handle rapid sequential data within buffer limit', () => {
|
|
702
|
-
vi.useFakeTimers();
|
|
703
|
-
const keyHandler = vi.fn();
|
|
704
|
-
const { result } = renderHook(() => useKeypressContext(), {
|
|
705
|
-
wrapper: ({ children }) => wrapper({ children, pasteWorkaround: true }),
|
|
706
|
-
});
|
|
707
|
-
act(() => {
|
|
708
|
-
result.current.subscribe(keyHandler);
|
|
709
|
-
});
|
|
710
|
-
try {
|
|
711
|
-
// Send multiple small chunks rapidly
|
|
712
|
-
act(() => {
|
|
713
|
-
stdin.emit('data', Buffer.from('h'));
|
|
714
|
-
stdin.emit('data', Buffer.from('e'));
|
|
715
|
-
stdin.emit('data', Buffer.from('l'));
|
|
716
|
-
stdin.emit('data', Buffer.from('l'));
|
|
717
|
-
stdin.emit('data', Buffer.from('o'));
|
|
718
|
-
});
|
|
719
|
-
// With the current implementation, each character is processed immediately
|
|
720
|
-
expect(keyHandler).toHaveBeenCalledTimes(5);
|
|
721
|
-
// Each character should be processed as individual keypress events
|
|
722
|
-
expect(keyHandler).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
723
|
-
name: 'h',
|
|
724
|
-
sequence: 'h',
|
|
725
|
-
paste: false,
|
|
726
|
-
}));
|
|
727
|
-
expect(keyHandler).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
728
|
-
name: 'e',
|
|
729
|
-
sequence: 'e',
|
|
730
|
-
paste: false,
|
|
731
|
-
}));
|
|
732
|
-
expect(keyHandler).toHaveBeenNthCalledWith(3, expect.objectContaining({
|
|
733
|
-
name: 'l',
|
|
734
|
-
sequence: 'l',
|
|
735
|
-
paste: false,
|
|
736
|
-
}));
|
|
737
|
-
expect(keyHandler).toHaveBeenNthCalledWith(4, expect.objectContaining({
|
|
738
|
-
name: 'l',
|
|
739
|
-
sequence: 'l',
|
|
740
|
-
paste: false,
|
|
741
|
-
}));
|
|
742
|
-
expect(keyHandler).toHaveBeenNthCalledWith(5, expect.objectContaining({
|
|
743
|
-
name: 'o',
|
|
744
|
-
sequence: 'o',
|
|
745
|
-
paste: false,
|
|
746
|
-
}));
|
|
747
|
-
}
|
|
748
|
-
finally {
|
|
749
|
-
vi.useRealTimers();
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
});
|
|
753
|
-
});
|
|
754
|
-
//# sourceMappingURL=KeypressContext.test.js.map
|