@google/gemini-cli 0.26.0-preview.4 → 0.27.0-nightly.20260126.cb772a5b7
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/README.md +18 -1
- package/dist/google-gemini-cli-0.27.0-nightly.20260121.97aac696f.tgz +0 -0
- package/dist/package.json +3 -4
- package/dist/src/commands/extensions.js +4 -1
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/hooks.js +4 -1
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/mcp/enableDisable.d.ts +13 -0
- package/dist/src/commands/mcp/enableDisable.js +122 -0
- package/dist/src/commands/mcp/enableDisable.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +2 -0
- package/dist/src/commands/mcp/list.js +1 -1
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp.js +7 -1
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/mcp.test.js +3 -1
- package/dist/src/commands/mcp.test.js.map +1 -1
- package/dist/src/commands/skills.js +4 -1
- package/dist/src/commands/skills.js.map +1 -1
- package/dist/src/config/config.d.ts +4 -0
- package/dist/src/config/config.js +41 -20
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +181 -15
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +8 -5
- package/dist/src/config/keyBindings.js +38 -32
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/keyBindings.test.js +8 -5
- package/dist/src/config/keyBindings.test.js.map +1 -1
- package/dist/src/config/mcp/index.d.ts +6 -0
- package/dist/src/config/mcp/index.js +7 -0
- package/dist/src/config/mcp/index.js.map +1 -0
- package/dist/src/config/mcp/mcpServerEnablement.d.ts +145 -0
- package/dist/src/config/mcp/mcpServerEnablement.js +254 -0
- package/dist/src/config/mcp/mcpServerEnablement.js.map +1 -0
- package/dist/src/config/mcp/mcpServerEnablement.test.js +147 -0
- package/dist/src/config/mcp/mcpServerEnablement.test.js.map +1 -0
- package/dist/src/config/sandboxConfig.test.js +11 -5
- package/dist/src/config/sandboxConfig.test.js.map +1 -1
- package/dist/src/config/settings.js +76 -0
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +44 -0
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +21 -78
- package/dist/src/config/settingsSchema.js +21 -79
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +1 -1
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/settings_repro.test.js +6 -2
- package/dist/src/config/settings_repro.test.js.map +1 -1
- package/dist/src/gemini.js +12 -7
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +140 -10
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +11 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +193 -3
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.js +6 -1
- package/dist/src/nonInteractiveCliCommands.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +2 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/FileCommandLoader.js +12 -4
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/FileCommandLoader.test.js +56 -0
- package/dist/src/services/FileCommandLoader.test.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +2 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/persistentStateFake.d.ts +26 -0
- package/dist/src/test-utils/persistentStateFake.js +39 -0
- package/dist/src/test-utils/persistentStateFake.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +10 -1
- package/dist/src/test-utils/render.js +45 -16
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/App.test.js +96 -38
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.js +78 -18
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +185 -19
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.test.js +5 -5
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +13 -9
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +6 -6
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +2 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.test.js +12 -0
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.js +75 -4
- package/dist/src/ui/commands/agentsCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.test.js +114 -0
- package/dist/src/ui/commands/agentsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +53 -49
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.js +79 -23
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/initCommand.test.js +8 -4
- package/dist/src/ui/commands/initCommand.test.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +136 -5
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.js +33 -20
- package/dist/src/ui/commands/policiesCommand.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.test.js +7 -4
- package/dist/src/ui/commands/policiesCommand.test.js.map +1 -1
- package/dist/src/ui/commands/rewindCommand.d.ts +7 -0
- package/dist/src/ui/commands/rewindCommand.js +132 -0
- package/dist/src/ui/commands/rewindCommand.js.map +1 -0
- package/dist/src/ui/commands/rewindCommand.test.js +242 -0
- package/dist/src/ui/commands/rewindCommand.test.js.map +1 -0
- package/dist/src/ui/commands/skillsCommand.js +6 -4
- package/dist/src/ui/commands/skillsCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.test.js +17 -3
- package/dist/src/ui/commands/skillsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +5 -3
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AboutBox.d.ts +1 -0
- package/dist/src/ui/components/AboutBox.js +5 -1
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AboutBox.test.js +8 -2
- package/dist/src/ui/components/AboutBox.test.js.map +1 -1
- package/dist/src/ui/components/AgentConfigDialog.d.ts +18 -0
- package/dist/src/ui/components/AgentConfigDialog.js +296 -0
- package/dist/src/ui/components/AgentConfigDialog.js.map +1 -0
- package/dist/src/ui/components/AgentConfigDialog.test.js +241 -0
- package/dist/src/ui/components/AgentConfigDialog.test.js.map +1 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js +9 -2
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js.map +1 -1
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +54 -25
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/AppHeader.js +4 -1
- package/dist/src/ui/components/AppHeader.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +95 -22
- package/dist/src/ui/components/AppHeader.test.js.map +1 -1
- package/dist/src/ui/components/{AutoAcceptIndicator.d.ts → ApprovalModeIndicator.d.ts} +2 -2
- package/dist/src/ui/components/{AutoAcceptIndicator.js → ApprovalModeIndicator.js} +8 -3
- package/dist/src/ui/components/ApprovalModeIndicator.js.map +1 -0
- package/dist/src/ui/components/ApprovalModeIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/{AutoAcceptIndicator.test.js → ApprovalModeIndicator.test.js} +13 -7
- package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +1 -0
- package/dist/src/ui/components/AskUserDialog.d.ts +39 -0
- package/dist/src/ui/components/AskUserDialog.js +618 -0
- package/dist/src/ui/components/AskUserDialog.js.map +1 -0
- package/dist/src/ui/components/AskUserDialog.test.d.ts +6 -0
- package/dist/src/ui/components/AskUserDialog.test.js +598 -0
- package/dist/src/ui/components/AskUserDialog.test.js.map +1 -0
- package/dist/src/ui/components/Composer.d.ts +3 -1
- package/dist/src/ui/components/Composer.js +5 -5
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +6 -6
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.js +3 -4
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.test.js +13 -29
- package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.test.js +7 -3
- package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +13 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/DialogManager.test.js +24 -0
- package/dist/src/ui/components/DialogManager.test.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +3 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.test.js +7 -0
- package/dist/src/ui/components/Footer.test.js.map +1 -1
- package/dist/src/ui/components/Help.js +5 -2
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +32 -20
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +75 -1
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.js +2 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js +12 -10
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.js +14 -20
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/Notifications.test.js +45 -35
- package/dist/src/ui/components/Notifications.test.js.map +1 -1
- package/dist/src/ui/components/RewindViewer.d.ts +1 -1
- package/dist/src/ui/components/RewindViewer.js +65 -17
- package/dist/src/ui/components/RewindViewer.js.map +1 -1
- package/dist/src/ui/components/RewindViewer.test.js +5 -3
- package/dist/src/ui/components/RewindViewer.test.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.js +3 -2
- package/dist/src/ui/components/SessionBrowser.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.test.js +10 -3
- package/dist/src/ui/components/SessionBrowser.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +1 -1
- package/dist/src/ui/components/SettingsDialog.js +266 -516
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +2 -2
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.test.js +17 -8
- package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +4 -3
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.d.ts +12 -0
- package/dist/src/ui/components/ToolConfirmationQueue.js +30 -0
- package/dist/src/ui/components/ToolConfirmationQueue.js.map +1 -0
- package/dist/src/ui/components/ToolConfirmationQueue.test.d.ts +6 -0
- package/dist/src/ui/components/ToolConfirmationQueue.test.js +71 -0
- package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -0
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +2 -4
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.js +6 -41
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +3 -2
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +61 -76
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +20 -7
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +34 -18
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +209 -24
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +7 -29
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +89 -0
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolShared.d.ts +26 -0
- package/dist/src/ui/components/messages/ToolShared.js +59 -6
- package/dist/src/ui/components/messages/ToolShared.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +3 -1
- package/dist/src/ui/components/shared/BaseSelectionList.js +4 -2
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.d.ts +72 -0
- package/dist/src/ui/components/shared/BaseSettingsDialog.js +293 -0
- package/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +434 -0
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/shared/ExpandableText.d.ts +17 -0
- package/dist/src/ui/components/{PrepareLabel.js → shared/ExpandableText.js} +30 -15
- package/dist/src/ui/components/shared/ExpandableText.js.map +1 -0
- package/dist/src/ui/components/shared/ExpandableText.test.d.ts +6 -0
- package/dist/src/ui/components/{PrepareLabel.test.js → shared/ExpandableText.test.js} +22 -11
- package/dist/src/ui/components/shared/ExpandableText.test.js.map +1 -0
- package/dist/src/ui/components/shared/TabHeader.d.ts +51 -0
- package/dist/src/ui/components/shared/TabHeader.js +42 -0
- package/dist/src/ui/components/shared/TabHeader.js.map +1 -0
- package/dist/src/ui/components/shared/TabHeader.test.d.ts +6 -0
- package/dist/src/ui/components/shared/TabHeader.test.js +106 -0
- package/dist/src/ui/components/shared/TabHeader.test.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.test.js +32 -24
- package/dist/src/ui/components/shared/TextInput.test.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +13 -0
- package/dist/src/ui/components/shared/text-buffer.js +173 -14
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +256 -44
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js +4 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.d.ts +1 -0
- package/dist/src/ui/components/views/McpStatus.js +30 -18
- package/dist/src/ui/components/views/McpStatus.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +7 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/constants/tips.js +2 -2
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +3 -2
- package/dist/src/ui/contexts/KeypressContext.js +33 -25
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +151 -41
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/MouseContext.test.js +8 -8
- package/dist/src/ui/contexts/MouseContext.test.js.map +1 -1
- package/dist/src/ui/contexts/ToolActionsContext.d.ts +20 -0
- package/dist/src/ui/contexts/ToolActionsContext.js +74 -0
- package/dist/src/ui/contexts/ToolActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/ToolActionsContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/ToolActionsContext.test.js +135 -0
- package/dist/src/ui/contexts/ToolActionsContext.test.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +3 -1
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +6 -2
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +19 -4
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/keyToAnsi.js +1 -1
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +3 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +24 -7
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +126 -30
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/toolMapping.js +8 -11
- package/dist/src/ui/hooks/toolMapping.js.map +1 -1
- package/dist/src/ui/hooks/toolMapping.test.js +27 -6
- package/dist/src/ui/hooks/toolMapping.test.js.map +1 -1
- package/dist/src/ui/hooks/{useAutoAcceptIndicator.d.ts → useApprovalModeIndicator.d.ts} +2 -2
- package/dist/src/ui/hooks/{useAutoAcceptIndicator.js → useApprovalModeIndicator.js} +25 -11
- package/dist/src/ui/hooks/useApprovalModeIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useApprovalModeIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/{useAutoAcceptIndicator.test.js → useApprovalModeIndicator.test.js} +56 -31
- package/dist/src/ui/hooks/useApprovalModeIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useConfirmingTool.d.ts +16 -0
- package/dist/src/ui/hooks/useConfirmingTool.js +39 -0
- package/dist/src/ui/hooks/useConfirmingTool.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +20 -8
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +79 -19
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.d.ts +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.js +9 -20
- package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +33 -12
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.test.js +10 -3
- package/dist/src/ui/hooks/useKeypress.test.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +7 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +3 -3
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +17 -9
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +2 -2
- package/dist/src/ui/hooks/usePhraseCycler.js +4 -14
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.js +13 -42
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.d.ts +4 -1
- package/dist/src/ui/hooks/useSelectionList.js +51 -13
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.test.js +35 -3
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.test.js +3 -2
- package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -1
- package/dist/src/ui/hooks/useShellInactivityStatus.d.ts +26 -0
- package/dist/src/ui/hooks/useShellInactivityStatus.js +46 -0
- package/dist/src/ui/hooks/useShellInactivityStatus.js.map +1 -0
- package/dist/src/ui/hooks/useShellInactivityStatus.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellInactivityStatus.test.js +84 -0
- package/dist/src/ui/hooks/useShellInactivityStatus.test.js.map +1 -0
- package/dist/src/ui/hooks/useTabbedNavigation.d.ts +53 -0
- package/dist/src/ui/hooks/useTabbedNavigation.js +150 -0
- package/dist/src/ui/hooks/useTabbedNavigation.js.map +1 -0
- package/dist/src/ui/hooks/useTabbedNavigation.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTabbedNavigation.test.js +187 -0
- package/dist/src/ui/hooks/useTabbedNavigation.test.js.map +1 -0
- package/dist/src/ui/hooks/useTips.d.ts +10 -0
- package/dist/src/ui/hooks/useTips.js +18 -0
- package/dist/src/ui/hooks/useTips.js.map +1 -0
- package/dist/src/ui/hooks/useTips.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTips.test.js +33 -0
- package/dist/src/ui/hooks/useTips.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolExecutionScheduler.d.ts +30 -0
- package/dist/src/ui/hooks/useToolExecutionScheduler.js +113 -0
- package/dist/src/ui/hooks/useToolExecutionScheduler.js.map +1 -0
- package/dist/src/ui/hooks/useToolExecutionScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolExecutionScheduler.test.js +296 -0
- package/dist/src/ui/hooks/useToolExecutionScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.d.ts +29 -0
- package/dist/src/ui/hooks/useToolScheduler.js +30 -0
- package/dist/src/ui/hooks/useToolScheduler.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolSchedulerFacade.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolSchedulerFacade.test.js +45 -0
- package/dist/src/ui/hooks/useToolSchedulerFacade.test.js.map +1 -0
- package/dist/src/ui/hooks/useTurnActivityMonitor.d.ts +16 -0
- package/dist/src/ui/hooks/useTurnActivityMonitor.js +49 -0
- package/dist/src/ui/hooks/useTurnActivityMonitor.js.map +1 -0
- package/dist/src/ui/hooks/useTurnActivityMonitor.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTurnActivityMonitor.test.js +97 -0
- package/dist/src/ui/hooks/useTurnActivityMonitor.test.js.map +1 -0
- package/dist/src/ui/hooks/vim.js +5 -3
- package/dist/src/ui/hooks/vim.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.js +4 -2
- package/dist/src/ui/hooks/vim.test.js.map +1 -1
- package/dist/src/ui/keyMatchers.js +5 -13
- package/dist/src/ui/keyMatchers.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +23 -20
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.js +10 -2
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +1 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -1
- package/dist/src/ui/types.d.ts +11 -3
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.d.ts +4 -4
- package/dist/src/ui/utils/clipboardUtils.js +198 -12
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.js +219 -47
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.windows.test.js +3 -0
- package/dist/src/ui/utils/clipboardUtils.windows.test.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +11 -3
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.d.ts +10 -0
- package/dist/src/ui/utils/directoryUtils.js +12 -0
- package/dist/src/ui/utils/directoryUtils.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.test.js +8 -4
- package/dist/src/ui/utils/directoryUtils.test.js.map +1 -1
- package/dist/src/ui/utils/formatters.d.ts +1 -1
- package/dist/src/ui/utils/formatters.js +2 -3
- package/dist/src/ui/utils/formatters.js.map +1 -1
- package/dist/src/ui/utils/highlight.d.ts +2 -2
- package/dist/src/ui/utils/highlight.js +9 -3
- package/dist/src/ui/utils/highlight.js.map +1 -1
- package/dist/src/ui/utils/highlight.test.js +3 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -1
- package/dist/src/ui/utils/terminalCapabilityManager.d.ts +1 -2
- package/dist/src/ui/utils/terminalCapabilityManager.js +2 -8
- package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -1
- package/dist/src/ui/utils/terminalCapabilityManager.test.js +2 -3
- package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.test.js +5 -3
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +5 -0
- package/dist/src/ui/utils/textUtils.js +14 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.js +19 -1
- package/dist/src/ui/utils/textUtils.test.js.map +1 -1
- package/dist/src/utils/cleanup.js +15 -0
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/events.d.ts +1 -6
- package/dist/src/utils/events.js +0 -2
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/events.test.js +4 -4
- package/dist/src/utils/events.test.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +3 -0
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
- package/dist/src/utils/installationInfo.js +4 -2
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/persistentState.d.ts +2 -0
- package/dist/src/utils/persistentState.js.map +1 -1
- package/dist/src/utils/windowTitle.d.ts +2 -1
- package/dist/src/utils/windowTitle.js +8 -1
- package/dist/src/utils/windowTitle.js.map +1 -1
- package/dist/src/utils/windowTitle.test.js +25 -1
- package/dist/src/utils/windowTitle.test.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.js +26 -5
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -5
- package/dist/google-gemini-cli-0.26.0-preview.3.tgz +0 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/components/AutoAcceptIndicator.test.js.map +0 -1
- package/dist/src/ui/components/PrepareLabel.d.ts +0 -15
- package/dist/src/ui/components/PrepareLabel.js.map +0 -1
- package/dist/src/ui/components/PrepareLabel.test.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
- /package/dist/src/{ui/components/AutoAcceptIndicator.test.d.ts → config/mcp/mcpServerEnablement.test.d.ts} +0 -0
- /package/dist/src/ui/{components/PrepareLabel.test.d.ts → commands/rewindCommand.test.d.ts} +0 -0
- /package/dist/src/ui/{hooks/useAutoAcceptIndicator.test.d.ts → components/AgentConfigDialog.test.d.ts} +0 -0
|
@@ -29,7 +29,18 @@ const initialState = {
|
|
|
29
29
|
viewportHeight: 24,
|
|
30
30
|
transformationsByLine: [[]],
|
|
31
31
|
visualLayout: defaultVisualLayout,
|
|
32
|
+
pastedContent: {},
|
|
32
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Helper to create a TextBufferState with properly calculated transformations.
|
|
36
|
+
*/
|
|
37
|
+
function createStateWithTransformations(partial) {
|
|
38
|
+
const state = { ...initialState, ...partial };
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
transformationsByLine: state.lines.map((l) => calculateTransformationsForLine(l)),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
33
44
|
describe('textBufferReducer', () => {
|
|
34
45
|
afterEach(() => {
|
|
35
46
|
vi.restoreAllMocks();
|
|
@@ -117,6 +128,18 @@ describe('textBufferReducer', () => {
|
|
|
117
128
|
expect(state.cursorCol).toBe(5);
|
|
118
129
|
});
|
|
119
130
|
});
|
|
131
|
+
describe('add_pasted_content action', () => {
|
|
132
|
+
it('should add content to pastedContent Record', () => {
|
|
133
|
+
const action = {
|
|
134
|
+
type: 'add_pasted_content',
|
|
135
|
+
payload: { id: '[Pasted Text: 6 lines]', text: 'large content' },
|
|
136
|
+
};
|
|
137
|
+
const state = textBufferReducer(initialState, action);
|
|
138
|
+
expect(state.pastedContent).toEqual({
|
|
139
|
+
'[Pasted Text: 6 lines]': 'large content',
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
});
|
|
120
143
|
describe('backspace action', () => {
|
|
121
144
|
it('should remove a character', () => {
|
|
122
145
|
const stateWithText = {
|
|
@@ -146,6 +169,130 @@ describe('textBufferReducer', () => {
|
|
|
146
169
|
expect(state.cursorCol).toBe(5);
|
|
147
170
|
});
|
|
148
171
|
});
|
|
172
|
+
describe('atomic placeholder deletion', () => {
|
|
173
|
+
describe('paste placeholders', () => {
|
|
174
|
+
it('backspace at end of paste placeholder removes entire placeholder', () => {
|
|
175
|
+
const placeholder = '[Pasted Text: 6 lines]';
|
|
176
|
+
const stateWithPlaceholder = createStateWithTransformations({
|
|
177
|
+
lines: [placeholder],
|
|
178
|
+
cursorRow: 0,
|
|
179
|
+
cursorCol: placeholder.length, // cursor at end
|
|
180
|
+
pastedContent: {
|
|
181
|
+
[placeholder]: 'line1\nline2\nline3\nline4\nline5\nline6',
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
const action = { type: 'backspace' };
|
|
185
|
+
const state = textBufferReducer(stateWithPlaceholder, action);
|
|
186
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
187
|
+
expect(state.lines).toEqual(['']);
|
|
188
|
+
expect(state.cursorCol).toBe(0);
|
|
189
|
+
// pastedContent should be cleaned up
|
|
190
|
+
expect(state.pastedContent[placeholder]).toBeUndefined();
|
|
191
|
+
});
|
|
192
|
+
it('delete at start of paste placeholder removes entire placeholder', () => {
|
|
193
|
+
const placeholder = '[Pasted Text: 6 lines]';
|
|
194
|
+
const stateWithPlaceholder = createStateWithTransformations({
|
|
195
|
+
lines: [placeholder],
|
|
196
|
+
cursorRow: 0,
|
|
197
|
+
cursorCol: 0, // cursor at start
|
|
198
|
+
pastedContent: {
|
|
199
|
+
[placeholder]: 'line1\nline2\nline3\nline4\nline5\nline6',
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
const action = { type: 'delete' };
|
|
203
|
+
const state = textBufferReducer(stateWithPlaceholder, action);
|
|
204
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
205
|
+
expect(state.lines).toEqual(['']);
|
|
206
|
+
expect(state.cursorCol).toBe(0);
|
|
207
|
+
// pastedContent should be cleaned up
|
|
208
|
+
expect(state.pastedContent[placeholder]).toBeUndefined();
|
|
209
|
+
});
|
|
210
|
+
it('backspace inside paste placeholder does normal deletion', () => {
|
|
211
|
+
const placeholder = '[Pasted Text: 6 lines]';
|
|
212
|
+
const stateWithPlaceholder = createStateWithTransformations({
|
|
213
|
+
lines: [placeholder],
|
|
214
|
+
cursorRow: 0,
|
|
215
|
+
cursorCol: 10, // cursor in middle
|
|
216
|
+
pastedContent: {
|
|
217
|
+
[placeholder]: 'line1\nline2\nline3\nline4\nline5\nline6',
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
const action = { type: 'backspace' };
|
|
221
|
+
const state = textBufferReducer(stateWithPlaceholder, action);
|
|
222
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
223
|
+
// Should only delete one character
|
|
224
|
+
expect(state.lines[0].length).toBe(placeholder.length - 1);
|
|
225
|
+
expect(state.cursorCol).toBe(9);
|
|
226
|
+
// pastedContent should NOT be cleaned up (placeholder is broken)
|
|
227
|
+
expect(state.pastedContent[placeholder]).toBeDefined();
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
describe('image placeholders', () => {
|
|
231
|
+
it('backspace at end of image path removes entire path', () => {
|
|
232
|
+
const imagePath = '@test.png';
|
|
233
|
+
const stateWithImage = createStateWithTransformations({
|
|
234
|
+
lines: [imagePath],
|
|
235
|
+
cursorRow: 0,
|
|
236
|
+
cursorCol: imagePath.length, // cursor at end
|
|
237
|
+
});
|
|
238
|
+
const action = { type: 'backspace' };
|
|
239
|
+
const state = textBufferReducer(stateWithImage, action);
|
|
240
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
241
|
+
expect(state.lines).toEqual(['']);
|
|
242
|
+
expect(state.cursorCol).toBe(0);
|
|
243
|
+
});
|
|
244
|
+
it('delete at start of image path removes entire path', () => {
|
|
245
|
+
const imagePath = '@test.png';
|
|
246
|
+
const stateWithImage = createStateWithTransformations({
|
|
247
|
+
lines: [imagePath],
|
|
248
|
+
cursorRow: 0,
|
|
249
|
+
cursorCol: 0, // cursor at start
|
|
250
|
+
});
|
|
251
|
+
const action = { type: 'delete' };
|
|
252
|
+
const state = textBufferReducer(stateWithImage, action);
|
|
253
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
254
|
+
expect(state.lines).toEqual(['']);
|
|
255
|
+
expect(state.cursorCol).toBe(0);
|
|
256
|
+
});
|
|
257
|
+
it('backspace inside image path does normal deletion', () => {
|
|
258
|
+
const imagePath = '@test.png';
|
|
259
|
+
const stateWithImage = createStateWithTransformations({
|
|
260
|
+
lines: [imagePath],
|
|
261
|
+
cursorRow: 0,
|
|
262
|
+
cursorCol: 5, // cursor in middle
|
|
263
|
+
});
|
|
264
|
+
const action = { type: 'backspace' };
|
|
265
|
+
const state = textBufferReducer(stateWithImage, action);
|
|
266
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
267
|
+
// Should only delete one character
|
|
268
|
+
expect(state.lines[0].length).toBe(imagePath.length - 1);
|
|
269
|
+
expect(state.cursorCol).toBe(4);
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
describe('undo behavior', () => {
|
|
273
|
+
it('undo after placeholder deletion restores everything', () => {
|
|
274
|
+
const placeholder = '[Pasted Text: 6 lines]';
|
|
275
|
+
const pasteContent = 'line1\nline2\nline3\nline4\nline5\nline6';
|
|
276
|
+
const stateWithPlaceholder = createStateWithTransformations({
|
|
277
|
+
lines: [placeholder],
|
|
278
|
+
cursorRow: 0,
|
|
279
|
+
cursorCol: placeholder.length,
|
|
280
|
+
pastedContent: { [placeholder]: pasteContent },
|
|
281
|
+
});
|
|
282
|
+
// Delete the placeholder
|
|
283
|
+
const deleteAction = { type: 'backspace' };
|
|
284
|
+
const stateAfterDelete = textBufferReducer(stateWithPlaceholder, deleteAction);
|
|
285
|
+
expect(stateAfterDelete.lines).toEqual(['']);
|
|
286
|
+
expect(stateAfterDelete.pastedContent[placeholder]).toBeUndefined();
|
|
287
|
+
// Undo should restore
|
|
288
|
+
const undoAction = { type: 'undo' };
|
|
289
|
+
const stateAfterUndo = textBufferReducer(stateAfterDelete, undoAction);
|
|
290
|
+
expect(stateAfterUndo).toHaveOnlyValidCharacters();
|
|
291
|
+
expect(stateAfterUndo.lines).toEqual([placeholder]);
|
|
292
|
+
expect(stateAfterUndo.pastedContent[placeholder]).toBe(pasteContent);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
});
|
|
149
296
|
describe('undo/redo actions', () => {
|
|
150
297
|
it('should undo and redo a change', () => {
|
|
151
298
|
// 1. Insert text
|
|
@@ -448,6 +595,43 @@ describe('useTextBuffer', () => {
|
|
|
448
595
|
expect(state.text).toBe('a-NEW-bc');
|
|
449
596
|
expect(state.cursor).toEqual([0, 6]);
|
|
450
597
|
});
|
|
598
|
+
it('insert: should use placeholder for large text paste', () => {
|
|
599
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
600
|
+
const largeText = '1\n2\n3\n4\n5\n6';
|
|
601
|
+
act(() => result.current.insert(largeText, { paste: true }));
|
|
602
|
+
const state = getBufferState(result);
|
|
603
|
+
expect(state.text).toBe('[Pasted Text: 6 lines]');
|
|
604
|
+
expect(result.current.pastedContent['[Pasted Text: 6 lines]']).toBe(largeText);
|
|
605
|
+
});
|
|
606
|
+
it('insert: should NOT use placeholder for large text if NOT a paste', () => {
|
|
607
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
608
|
+
const largeText = '1\n2\n3\n4\n5\n6';
|
|
609
|
+
act(() => result.current.insert(largeText, { paste: false }));
|
|
610
|
+
const state = getBufferState(result);
|
|
611
|
+
expect(state.text).toBe(largeText);
|
|
612
|
+
});
|
|
613
|
+
it('insert: should clean up pastedContent when placeholder is deleted', () => {
|
|
614
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
615
|
+
const largeText = '1\n2\n3\n4\n5\n6';
|
|
616
|
+
act(() => result.current.insert(largeText, { paste: true }));
|
|
617
|
+
expect(result.current.pastedContent['[Pasted Text: 6 lines]']).toBe(largeText);
|
|
618
|
+
// Delete the placeholder using setText
|
|
619
|
+
act(() => result.current.setText(''));
|
|
620
|
+
expect(Object.keys(result.current.pastedContent)).toHaveLength(0);
|
|
621
|
+
});
|
|
622
|
+
it('insert: should clean up pastedContent when placeholder is removed via atomic backspace', () => {
|
|
623
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
624
|
+
const largeText = '1\n2\n3\n4\n5\n6';
|
|
625
|
+
act(() => result.current.insert(largeText, { paste: true }));
|
|
626
|
+
expect(result.current.pastedContent['[Pasted Text: 6 lines]']).toBe(largeText);
|
|
627
|
+
// Single backspace at end of placeholder removes entire placeholder
|
|
628
|
+
act(() => {
|
|
629
|
+
result.current.backspace();
|
|
630
|
+
});
|
|
631
|
+
expect(getBufferState(result).text).toBe('');
|
|
632
|
+
// pastedContent is cleaned up when placeholder is deleted atomically
|
|
633
|
+
expect(Object.keys(result.current.pastedContent)).toHaveLength(0);
|
|
634
|
+
});
|
|
451
635
|
it('newline: should create a new line and move cursor', () => {
|
|
452
636
|
const { result } = renderHook(() => useTextBuffer({
|
|
453
637
|
initialText: 'ab',
|
|
@@ -849,17 +1033,19 @@ describe('useTextBuffer', () => {
|
|
|
849
1033
|
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
850
1034
|
act(() => result.current.handleInput({
|
|
851
1035
|
name: 'h',
|
|
852
|
-
ctrl: false,
|
|
853
|
-
meta: false,
|
|
854
1036
|
shift: false,
|
|
1037
|
+
alt: false,
|
|
1038
|
+
ctrl: false,
|
|
1039
|
+
cmd: false,
|
|
855
1040
|
insertable: true,
|
|
856
1041
|
sequence: 'h',
|
|
857
1042
|
}));
|
|
858
1043
|
act(() => result.current.handleInput({
|
|
859
1044
|
name: 'i',
|
|
860
|
-
ctrl: false,
|
|
861
|
-
meta: false,
|
|
862
1045
|
shift: false,
|
|
1046
|
+
alt: false,
|
|
1047
|
+
ctrl: false,
|
|
1048
|
+
cmd: false,
|
|
863
1049
|
insertable: true,
|
|
864
1050
|
sequence: 'i',
|
|
865
1051
|
}));
|
|
@@ -869,9 +1055,10 @@ describe('useTextBuffer', () => {
|
|
|
869
1055
|
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
870
1056
|
act(() => result.current.handleInput({
|
|
871
1057
|
name: 'return',
|
|
872
|
-
ctrl: false,
|
|
873
|
-
meta: false,
|
|
874
1058
|
shift: false,
|
|
1059
|
+
alt: false,
|
|
1060
|
+
ctrl: false,
|
|
1061
|
+
cmd: false,
|
|
875
1062
|
insertable: true,
|
|
876
1063
|
sequence: '\r',
|
|
877
1064
|
}));
|
|
@@ -881,9 +1068,10 @@ describe('useTextBuffer', () => {
|
|
|
881
1068
|
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
882
1069
|
act(() => result.current.handleInput({
|
|
883
1070
|
name: 'j',
|
|
884
|
-
ctrl: true,
|
|
885
|
-
meta: false,
|
|
886
1071
|
shift: false,
|
|
1072
|
+
alt: false,
|
|
1073
|
+
ctrl: true,
|
|
1074
|
+
cmd: false,
|
|
887
1075
|
insertable: false,
|
|
888
1076
|
sequence: '\n',
|
|
889
1077
|
}));
|
|
@@ -893,9 +1081,10 @@ describe('useTextBuffer', () => {
|
|
|
893
1081
|
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
894
1082
|
act(() => result.current.handleInput({
|
|
895
1083
|
name: 'tab',
|
|
896
|
-
ctrl: false,
|
|
897
|
-
meta: false,
|
|
898
1084
|
shift: false,
|
|
1085
|
+
alt: false,
|
|
1086
|
+
ctrl: false,
|
|
1087
|
+
cmd: false,
|
|
899
1088
|
insertable: false,
|
|
900
1089
|
sequence: '\t',
|
|
901
1090
|
}));
|
|
@@ -905,9 +1094,10 @@ describe('useTextBuffer', () => {
|
|
|
905
1094
|
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
906
1095
|
act(() => result.current.handleInput({
|
|
907
1096
|
name: 'tab',
|
|
908
|
-
ctrl: false,
|
|
909
|
-
meta: false,
|
|
910
1097
|
shift: true,
|
|
1098
|
+
alt: false,
|
|
1099
|
+
ctrl: false,
|
|
1100
|
+
cmd: false,
|
|
911
1101
|
insertable: false,
|
|
912
1102
|
sequence: '\u001b[9;2u',
|
|
913
1103
|
}));
|
|
@@ -922,9 +1112,10 @@ describe('useTextBuffer', () => {
|
|
|
922
1112
|
act(() => result.current.move('end'));
|
|
923
1113
|
act(() => result.current.handleInput({
|
|
924
1114
|
name: 'backspace',
|
|
925
|
-
ctrl: false,
|
|
926
|
-
meta: false,
|
|
927
1115
|
shift: false,
|
|
1116
|
+
alt: false,
|
|
1117
|
+
ctrl: false,
|
|
1118
|
+
cmd: false,
|
|
928
1119
|
insertable: false,
|
|
929
1120
|
sequence: '\x7f',
|
|
930
1121
|
}));
|
|
@@ -941,25 +1132,28 @@ describe('useTextBuffer', () => {
|
|
|
941
1132
|
act(() => {
|
|
942
1133
|
result.current.handleInput({
|
|
943
1134
|
name: 'backspace',
|
|
944
|
-
ctrl: false,
|
|
945
|
-
meta: false,
|
|
946
1135
|
shift: false,
|
|
1136
|
+
alt: false,
|
|
1137
|
+
ctrl: false,
|
|
1138
|
+
cmd: false,
|
|
947
1139
|
insertable: false,
|
|
948
1140
|
sequence: '\x7f',
|
|
949
1141
|
});
|
|
950
1142
|
result.current.handleInput({
|
|
951
1143
|
name: 'backspace',
|
|
952
|
-
ctrl: false,
|
|
953
|
-
meta: false,
|
|
954
1144
|
shift: false,
|
|
1145
|
+
alt: false,
|
|
1146
|
+
ctrl: false,
|
|
1147
|
+
cmd: false,
|
|
955
1148
|
insertable: false,
|
|
956
1149
|
sequence: '\x7f',
|
|
957
1150
|
});
|
|
958
1151
|
result.current.handleInput({
|
|
959
1152
|
name: 'backspace',
|
|
960
|
-
ctrl: false,
|
|
961
|
-
meta: false,
|
|
962
1153
|
shift: false,
|
|
1154
|
+
alt: false,
|
|
1155
|
+
ctrl: false,
|
|
1156
|
+
cmd: false,
|
|
963
1157
|
insertable: false,
|
|
964
1158
|
sequence: '\x7f',
|
|
965
1159
|
});
|
|
@@ -1004,21 +1198,23 @@ describe('useTextBuffer', () => {
|
|
|
1004
1198
|
act(() => result.current.move('end')); // cursor [0,2]
|
|
1005
1199
|
act(() => result.current.handleInput({
|
|
1006
1200
|
name: 'left',
|
|
1007
|
-
ctrl: false,
|
|
1008
|
-
meta: false,
|
|
1009
1201
|
shift: false,
|
|
1202
|
+
alt: false,
|
|
1203
|
+
ctrl: false,
|
|
1204
|
+
cmd: false,
|
|
1010
1205
|
insertable: false,
|
|
1011
1206
|
sequence: '\x1b[D',
|
|
1012
|
-
}));
|
|
1207
|
+
}));
|
|
1013
1208
|
expect(getBufferState(result).cursor).toEqual([0, 1]);
|
|
1014
1209
|
act(() => result.current.handleInput({
|
|
1015
1210
|
name: 'right',
|
|
1016
|
-
ctrl: false,
|
|
1017
|
-
meta: false,
|
|
1018
1211
|
shift: false,
|
|
1212
|
+
alt: false,
|
|
1213
|
+
ctrl: false,
|
|
1214
|
+
cmd: false,
|
|
1019
1215
|
insertable: false,
|
|
1020
1216
|
sequence: '\x1b[C',
|
|
1021
|
-
}));
|
|
1217
|
+
}));
|
|
1022
1218
|
expect(getBufferState(result).cursor).toEqual([0, 2]);
|
|
1023
1219
|
});
|
|
1024
1220
|
it('should strip ANSI escape codes when pasting text', () => {
|
|
@@ -1027,9 +1223,10 @@ describe('useTextBuffer', () => {
|
|
|
1027
1223
|
// Simulate pasting by calling handleInput with a string longer than 1 char
|
|
1028
1224
|
act(() => result.current.handleInput({
|
|
1029
1225
|
name: '',
|
|
1030
|
-
ctrl: false,
|
|
1031
|
-
meta: false,
|
|
1032
1226
|
shift: false,
|
|
1227
|
+
alt: false,
|
|
1228
|
+
ctrl: false,
|
|
1229
|
+
cmd: false,
|
|
1033
1230
|
insertable: true,
|
|
1034
1231
|
sequence: textWithAnsi,
|
|
1035
1232
|
}));
|
|
@@ -1039,9 +1236,10 @@ describe('useTextBuffer', () => {
|
|
|
1039
1236
|
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1040
1237
|
act(() => result.current.handleInput({
|
|
1041
1238
|
name: 'return',
|
|
1042
|
-
ctrl: false,
|
|
1043
|
-
meta: false,
|
|
1044
1239
|
shift: true,
|
|
1240
|
+
alt: false,
|
|
1241
|
+
ctrl: false,
|
|
1242
|
+
cmd: false,
|
|
1045
1243
|
insertable: true,
|
|
1046
1244
|
sequence: '\r',
|
|
1047
1245
|
})); // Simulates Shift+Enter in VSCode terminal
|
|
@@ -1064,8 +1262,14 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1064
1262
|
result.current.insert(longText, { paste: true });
|
|
1065
1263
|
});
|
|
1066
1264
|
const state = getBufferState(result);
|
|
1067
|
-
// Check that the text is the result of three concatenations.
|
|
1068
|
-
|
|
1265
|
+
// Check that the text is the result of three concatenations of unique placeholders.
|
|
1266
|
+
// Now that ID generation is in the reducer, they are correctly unique even when batched.
|
|
1267
|
+
expect(state.lines).toStrictEqual([
|
|
1268
|
+
'[Pasted Text: 8 lines][Pasted Text: 8 lines #2][Pasted Text: 8 lines #3]',
|
|
1269
|
+
]);
|
|
1270
|
+
expect(result.current.pastedContent['[Pasted Text: 8 lines]']).toBe(longText);
|
|
1271
|
+
expect(result.current.pastedContent['[Pasted Text: 8 lines #2]']).toBe(longText);
|
|
1272
|
+
expect(result.current.pastedContent['[Pasted Text: 8 lines #3]']).toBe(longText);
|
|
1069
1273
|
const expectedCursorPos = offsetToLogicalPos(state.text, state.text.length);
|
|
1070
1274
|
expect(state.cursor).toEqual(expectedCursorPos);
|
|
1071
1275
|
});
|
|
@@ -1198,9 +1402,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1198
1402
|
describe('Input Sanitization', () => {
|
|
1199
1403
|
const createInput = (sequence) => ({
|
|
1200
1404
|
name: '',
|
|
1201
|
-
ctrl: false,
|
|
1202
|
-
meta: false,
|
|
1203
1405
|
shift: false,
|
|
1406
|
+
alt: false,
|
|
1407
|
+
ctrl: false,
|
|
1408
|
+
cmd: false,
|
|
1204
1409
|
insertable: true,
|
|
1205
1410
|
sequence,
|
|
1206
1411
|
});
|
|
@@ -1243,9 +1448,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1243
1448
|
expect(largeTextWithUnsafe.length).toBeGreaterThan(5000);
|
|
1244
1449
|
act(() => result.current.handleInput({
|
|
1245
1450
|
name: '',
|
|
1246
|
-
ctrl: false,
|
|
1247
|
-
meta: false,
|
|
1248
1451
|
shift: false,
|
|
1452
|
+
alt: false,
|
|
1453
|
+
ctrl: false,
|
|
1454
|
+
cmd: false,
|
|
1249
1455
|
insertable: true,
|
|
1250
1456
|
sequence: largeTextWithUnsafe,
|
|
1251
1457
|
}));
|
|
@@ -1268,9 +1474,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1268
1474
|
expect(largeTextWithAnsi.length).toBeGreaterThan(5000);
|
|
1269
1475
|
act(() => result.current.handleInput({
|
|
1270
1476
|
name: '',
|
|
1271
|
-
ctrl: false,
|
|
1272
|
-
meta: false,
|
|
1273
1477
|
shift: false,
|
|
1478
|
+
alt: false,
|
|
1479
|
+
ctrl: false,
|
|
1480
|
+
cmd: false,
|
|
1274
1481
|
insertable: true,
|
|
1275
1482
|
sequence: largeTextWithAnsi,
|
|
1276
1483
|
}));
|
|
@@ -1286,9 +1493,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1286
1493
|
const emojis = '🐍🐳🦀🦄';
|
|
1287
1494
|
act(() => result.current.handleInput({
|
|
1288
1495
|
name: '',
|
|
1289
|
-
ctrl: false,
|
|
1290
|
-
meta: false,
|
|
1291
1496
|
shift: false,
|
|
1497
|
+
alt: false,
|
|
1498
|
+
ctrl: false,
|
|
1499
|
+
cmd: false,
|
|
1292
1500
|
insertable: true,
|
|
1293
1501
|
sequence: emojis,
|
|
1294
1502
|
}));
|
|
@@ -1429,9 +1637,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1429
1637
|
}));
|
|
1430
1638
|
act(() => result.current.handleInput({
|
|
1431
1639
|
name: 'return',
|
|
1432
|
-
ctrl: false,
|
|
1433
|
-
meta: false,
|
|
1434
1640
|
shift: false,
|
|
1641
|
+
alt: false,
|
|
1642
|
+
ctrl: false,
|
|
1643
|
+
cmd: false,
|
|
1435
1644
|
insertable: true,
|
|
1436
1645
|
sequence: '\r',
|
|
1437
1646
|
}));
|
|
@@ -1445,9 +1654,10 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
|
|
1445
1654
|
}));
|
|
1446
1655
|
act(() => result.current.handleInput({
|
|
1447
1656
|
name: 'f1',
|
|
1448
|
-
ctrl: false,
|
|
1449
|
-
meta: false,
|
|
1450
1657
|
shift: false,
|
|
1658
|
+
alt: false,
|
|
1659
|
+
ctrl: false,
|
|
1660
|
+
cmd: false,
|
|
1451
1661
|
insertable: false,
|
|
1452
1662
|
sequence: '\u001bOP',
|
|
1453
1663
|
}));
|
|
@@ -1994,12 +2204,14 @@ describe('Transformation Utilities', () => {
|
|
|
1994
2204
|
logEnd: 14,
|
|
1995
2205
|
logicalText: '@test.png',
|
|
1996
2206
|
collapsedText: '[Image @test.png]',
|
|
2207
|
+
type: 'image',
|
|
1997
2208
|
},
|
|
1998
2209
|
{
|
|
1999
2210
|
logStart: 20,
|
|
2000
2211
|
logEnd: 31,
|
|
2001
2212
|
logicalText: '@another.jpg',
|
|
2002
2213
|
collapsedText: '[Image @another.jpg]',
|
|
2214
|
+
type: 'image',
|
|
2003
2215
|
},
|
|
2004
2216
|
];
|
|
2005
2217
|
it('should find transformation when cursor is inside it', () => {
|