@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
|
@@ -16,6 +16,10 @@ import { parsePastedPaths } from '../../utils/clipboardUtils.js';
|
|
|
16
16
|
import { keyMatchers, Command } from '../../keyMatchers.js';
|
|
17
17
|
import { handleVimAction } from './vim-buffer-actions.js';
|
|
18
18
|
import { LRU_BUFFER_PERF_CACHE_LIMIT } from '../../constants.js';
|
|
19
|
+
const LARGE_PASTE_LINE_THRESHOLD = 5;
|
|
20
|
+
const LARGE_PASTE_CHAR_THRESHOLD = 500;
|
|
21
|
+
// Regex to match paste placeholders like [Pasted Text: 6 lines] or [Pasted Text: 501 chars #2]
|
|
22
|
+
export const PASTED_TEXT_PLACEHOLDER_REGEX = /\[Pasted Text: \d+ (?:lines|chars)(?: #\d+)?\]/g;
|
|
19
23
|
// Helper functions for line-based word navigation
|
|
20
24
|
export const isWordCharStrict = (char) => /[\w\p{L}\p{N}]/u.test(char); // Matches a single character that is any Unicode letter, any Unicode number, or an underscore
|
|
21
25
|
export const isWhitespace = (char) => /\s/.test(char);
|
|
@@ -513,9 +517,9 @@ export function calculateTransformationsForLine(line) {
|
|
|
513
517
|
return cached;
|
|
514
518
|
}
|
|
515
519
|
const transformations = [];
|
|
516
|
-
|
|
517
|
-
// Reset regex state to ensure clean matching from start of line
|
|
520
|
+
// 1. Detect image paths
|
|
518
521
|
imagePathRegex.lastIndex = 0;
|
|
522
|
+
let match;
|
|
519
523
|
while ((match = imagePathRegex.exec(line)) !== null) {
|
|
520
524
|
const logicalText = match[0];
|
|
521
525
|
const logStart = cpLen(line.substring(0, match.index));
|
|
@@ -525,8 +529,26 @@ export function calculateTransformationsForLine(line) {
|
|
|
525
529
|
logEnd,
|
|
526
530
|
logicalText,
|
|
527
531
|
collapsedText: getTransformedImagePath(logicalText),
|
|
532
|
+
type: 'image',
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
// 2. Detect paste placeholders
|
|
536
|
+
const pasteRegex = new RegExp(PASTED_TEXT_PLACEHOLDER_REGEX.source, 'g');
|
|
537
|
+
while ((match = pasteRegex.exec(line)) !== null) {
|
|
538
|
+
const logicalText = match[0];
|
|
539
|
+
const logStart = cpLen(line.substring(0, match.index));
|
|
540
|
+
const logEnd = logStart + cpLen(logicalText);
|
|
541
|
+
transformations.push({
|
|
542
|
+
logStart,
|
|
543
|
+
logEnd,
|
|
544
|
+
logicalText,
|
|
545
|
+
collapsedText: logicalText,
|
|
546
|
+
type: 'paste',
|
|
547
|
+
id: logicalText,
|
|
528
548
|
});
|
|
529
549
|
}
|
|
550
|
+
// Sort transformations by logStart to maintain consistency
|
|
551
|
+
transformations.sort((a, b) => a.logStart - b.logStart);
|
|
530
552
|
transformationsCache.set(line, transformations);
|
|
531
553
|
return transformations;
|
|
532
554
|
}
|
|
@@ -546,6 +568,39 @@ export function getTransformUnderCursor(row, col, spansByLine) {
|
|
|
546
568
|
}
|
|
547
569
|
return null;
|
|
548
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Find atomic placeholder at cursor for backspace (cursor at end).
|
|
573
|
+
* Checks all placeholder types in priority order.
|
|
574
|
+
*/
|
|
575
|
+
function findAtomicPlaceholderForBackspace(line, cursorCol, transformations) {
|
|
576
|
+
for (const transform of transformations) {
|
|
577
|
+
if (cursorCol === transform.logEnd) {
|
|
578
|
+
return {
|
|
579
|
+
start: transform.logStart,
|
|
580
|
+
end: transform.logEnd,
|
|
581
|
+
type: transform.type,
|
|
582
|
+
id: transform.id,
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Find atomic placeholder at cursor for delete (cursor at start).
|
|
590
|
+
*/
|
|
591
|
+
function findAtomicPlaceholderForDelete(line, cursorCol, transformations) {
|
|
592
|
+
for (const transform of transformations) {
|
|
593
|
+
if (cursorCol === transform.logStart) {
|
|
594
|
+
return {
|
|
595
|
+
start: transform.logStart,
|
|
596
|
+
end: transform.logEnd,
|
|
597
|
+
type: transform.type,
|
|
598
|
+
id: transform.id,
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
549
604
|
export function calculateTransformedLine(logLine, logIndex, logicalCursor, transformations) {
|
|
550
605
|
let transformedLine = '';
|
|
551
606
|
const transformedToLogMap = [];
|
|
@@ -558,7 +613,8 @@ export function calculateTransformedLine(logLine, logIndex, logicalCursor, trans
|
|
|
558
613
|
for (let i = 0; i < cpLen(textBeforeTransformation); i++) {
|
|
559
614
|
transformedToLogMap.push(lastLogPos + i);
|
|
560
615
|
}
|
|
561
|
-
const isExpanded =
|
|
616
|
+
const isExpanded = transform.type === 'image' &&
|
|
617
|
+
cursorIsOnThisLine &&
|
|
562
618
|
cursorCol >= transform.logStart &&
|
|
563
619
|
cursorCol <= transform.logEnd;
|
|
564
620
|
const transformedText = isExpanded
|
|
@@ -817,6 +873,7 @@ export const pushUndo = (currentState) => {
|
|
|
817
873
|
lines: [...currentState.lines],
|
|
818
874
|
cursorRow: currentState.cursorRow,
|
|
819
875
|
cursorCol: currentState.cursorCol,
|
|
876
|
+
pastedContent: { ...currentState.pastedContent },
|
|
820
877
|
};
|
|
821
878
|
const newStack = [...currentState.undoStack, snapshot];
|
|
822
879
|
if (newStack.length > historyLimit) {
|
|
@@ -824,6 +881,18 @@ export const pushUndo = (currentState) => {
|
|
|
824
881
|
}
|
|
825
882
|
return { ...currentState, undoStack: newStack, redoStack: [] };
|
|
826
883
|
};
|
|
884
|
+
function generatePastedTextId(content, lineCount, pastedContent) {
|
|
885
|
+
const base = lineCount > LARGE_PASTE_LINE_THRESHOLD
|
|
886
|
+
? `[Pasted Text: ${lineCount} lines]`
|
|
887
|
+
: `[Pasted Text: ${content.length} chars]`;
|
|
888
|
+
let id = base;
|
|
889
|
+
let suffix = 2;
|
|
890
|
+
while (pastedContent[id]) {
|
|
891
|
+
id = base.replace(']', ` #${suffix}]`);
|
|
892
|
+
suffix++;
|
|
893
|
+
}
|
|
894
|
+
return id;
|
|
895
|
+
}
|
|
827
896
|
function textBufferReducerLogic(state, action, options = {}) {
|
|
828
897
|
const pushUndoLocal = pushUndo;
|
|
829
898
|
const currentLine = (r) => state.lines[r] ?? '';
|
|
@@ -845,6 +914,7 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
845
914
|
cursorRow: lastNewLineIndex,
|
|
846
915
|
cursorCol: cpLen(lines[lastNewLineIndex] ?? ''),
|
|
847
916
|
preferredCol: null,
|
|
917
|
+
pastedContent: action.payload === '' ? {} : nextState.pastedContent,
|
|
848
918
|
};
|
|
849
919
|
}
|
|
850
920
|
case 'insert': {
|
|
@@ -854,6 +924,21 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
854
924
|
let newCursorCol = nextState.cursorCol;
|
|
855
925
|
const currentLine = (r) => newLines[r] ?? '';
|
|
856
926
|
let payload = action.payload;
|
|
927
|
+
let newPastedContent = nextState.pastedContent;
|
|
928
|
+
if (action.isPaste) {
|
|
929
|
+
// Normalize line endings for pastes
|
|
930
|
+
payload = payload.replace(/\r\n|\r/g, '\n');
|
|
931
|
+
const lineCount = payload.split('\n').length;
|
|
932
|
+
if (lineCount > LARGE_PASTE_LINE_THRESHOLD ||
|
|
933
|
+
payload.length > LARGE_PASTE_CHAR_THRESHOLD) {
|
|
934
|
+
const id = generatePastedTextId(payload, lineCount, newPastedContent);
|
|
935
|
+
newPastedContent = {
|
|
936
|
+
...newPastedContent,
|
|
937
|
+
[id]: payload,
|
|
938
|
+
};
|
|
939
|
+
payload = id;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
857
942
|
if (options.singleLine) {
|
|
858
943
|
payload = payload.replace(/[\r\n]/g, '');
|
|
859
944
|
}
|
|
@@ -887,16 +972,57 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
887
972
|
cursorRow: newCursorRow,
|
|
888
973
|
cursorCol: newCursorCol,
|
|
889
974
|
preferredCol: null,
|
|
975
|
+
pastedContent: newPastedContent,
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
case 'add_pasted_content': {
|
|
979
|
+
const { id, text } = action.payload;
|
|
980
|
+
return {
|
|
981
|
+
...state,
|
|
982
|
+
pastedContent: {
|
|
983
|
+
...state.pastedContent,
|
|
984
|
+
[id]: text,
|
|
985
|
+
},
|
|
890
986
|
};
|
|
891
987
|
}
|
|
892
988
|
case 'backspace': {
|
|
989
|
+
const { cursorRow, cursorCol, lines, transformationsByLine } = state;
|
|
990
|
+
// Early return if at start of buffer
|
|
991
|
+
if (cursorCol === 0 && cursorRow === 0)
|
|
992
|
+
return state;
|
|
993
|
+
// Check if cursor is at end of an atomic placeholder
|
|
994
|
+
const transformations = transformationsByLine[cursorRow] ?? [];
|
|
995
|
+
const placeholder = findAtomicPlaceholderForBackspace(lines[cursorRow], cursorCol, transformations);
|
|
996
|
+
if (placeholder) {
|
|
997
|
+
const nextState = pushUndoLocal(state);
|
|
998
|
+
const newLines = [...nextState.lines];
|
|
999
|
+
newLines[cursorRow] =
|
|
1000
|
+
cpSlice(newLines[cursorRow], 0, placeholder.start) +
|
|
1001
|
+
cpSlice(newLines[cursorRow], placeholder.end);
|
|
1002
|
+
// Recalculate transformations for the modified line
|
|
1003
|
+
const newTransformations = [...nextState.transformationsByLine];
|
|
1004
|
+
newTransformations[cursorRow] = calculateTransformationsForLine(newLines[cursorRow]);
|
|
1005
|
+
// Clean up pastedContent if this was a paste placeholder
|
|
1006
|
+
let newPastedContent = nextState.pastedContent;
|
|
1007
|
+
if (placeholder.type === 'paste' && placeholder.id) {
|
|
1008
|
+
const { [placeholder.id]: _, ...remaining } = nextState.pastedContent;
|
|
1009
|
+
newPastedContent = remaining;
|
|
1010
|
+
}
|
|
1011
|
+
return {
|
|
1012
|
+
...nextState,
|
|
1013
|
+
lines: newLines,
|
|
1014
|
+
cursorCol: placeholder.start,
|
|
1015
|
+
preferredCol: null,
|
|
1016
|
+
transformationsByLine: newTransformations,
|
|
1017
|
+
pastedContent: newPastedContent,
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
// Standard backspace logic
|
|
893
1021
|
const nextState = pushUndoLocal(state);
|
|
894
1022
|
const newLines = [...nextState.lines];
|
|
895
1023
|
let newCursorRow = nextState.cursorRow;
|
|
896
1024
|
let newCursorCol = nextState.cursorCol;
|
|
897
1025
|
const currentLine = (r) => newLines[r] ?? '';
|
|
898
|
-
if (newCursorCol === 0 && newCursorRow === 0)
|
|
899
|
-
return state;
|
|
900
1026
|
if (newCursorCol > 0) {
|
|
901
1027
|
const lineContent = currentLine(newCursorRow);
|
|
902
1028
|
newLines[newCursorRow] =
|
|
@@ -1078,7 +1204,35 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
1078
1204
|
};
|
|
1079
1205
|
}
|
|
1080
1206
|
case 'delete': {
|
|
1081
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
1207
|
+
const { cursorRow, cursorCol, lines, transformationsByLine } = state;
|
|
1208
|
+
// Check if cursor is at start of an atomic placeholder
|
|
1209
|
+
const transformations = transformationsByLine[cursorRow] ?? [];
|
|
1210
|
+
const placeholder = findAtomicPlaceholderForDelete(lines[cursorRow], cursorCol, transformations);
|
|
1211
|
+
if (placeholder) {
|
|
1212
|
+
const nextState = pushUndoLocal(state);
|
|
1213
|
+
const newLines = [...nextState.lines];
|
|
1214
|
+
newLines[cursorRow] =
|
|
1215
|
+
cpSlice(newLines[cursorRow], 0, placeholder.start) +
|
|
1216
|
+
cpSlice(newLines[cursorRow], placeholder.end);
|
|
1217
|
+
// Recalculate transformations for the modified line
|
|
1218
|
+
const newTransformations = [...nextState.transformationsByLine];
|
|
1219
|
+
newTransformations[cursorRow] = calculateTransformationsForLine(newLines[cursorRow]);
|
|
1220
|
+
// Clean up pastedContent if this was a paste placeholder
|
|
1221
|
+
let newPastedContent = nextState.pastedContent;
|
|
1222
|
+
if (placeholder.type === 'paste' && placeholder.id) {
|
|
1223
|
+
const { [placeholder.id]: _, ...remaining } = nextState.pastedContent;
|
|
1224
|
+
newPastedContent = remaining;
|
|
1225
|
+
}
|
|
1226
|
+
return {
|
|
1227
|
+
...nextState,
|
|
1228
|
+
lines: newLines,
|
|
1229
|
+
// cursorCol stays the same
|
|
1230
|
+
preferredCol: null,
|
|
1231
|
+
transformationsByLine: newTransformations,
|
|
1232
|
+
pastedContent: newPastedContent,
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
// Standard delete logic
|
|
1082
1236
|
const lineContent = currentLine(cursorRow);
|
|
1083
1237
|
if (cursorCol < currentLineLen(cursorRow)) {
|
|
1084
1238
|
const nextState = pushUndoLocal(state);
|
|
@@ -1218,6 +1372,7 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
1218
1372
|
lines: [...state.lines],
|
|
1219
1373
|
cursorRow: state.cursorRow,
|
|
1220
1374
|
cursorCol: state.cursorCol,
|
|
1375
|
+
pastedContent: { ...state.pastedContent },
|
|
1221
1376
|
};
|
|
1222
1377
|
return {
|
|
1223
1378
|
...state,
|
|
@@ -1234,6 +1389,7 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
1234
1389
|
lines: [...state.lines],
|
|
1235
1390
|
cursorRow: state.cursorRow,
|
|
1236
1391
|
cursorCol: state.cursorCol,
|
|
1392
|
+
pastedContent: { ...state.pastedContent },
|
|
1237
1393
|
};
|
|
1238
1394
|
return {
|
|
1239
1395
|
...state,
|
|
@@ -1349,10 +1505,11 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1349
1505
|
viewportWidth: viewport.width,
|
|
1350
1506
|
viewportHeight: viewport.height,
|
|
1351
1507
|
visualLayout,
|
|
1508
|
+
pastedContent: {},
|
|
1352
1509
|
};
|
|
1353
1510
|
}, [initialText, initialCursorOffset, viewport.width, viewport.height]);
|
|
1354
1511
|
const [state, dispatch] = useReducer((s, a) => textBufferReducer(s, a, { inputFilter, singleLine }), initialState);
|
|
1355
|
-
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, transformationsByLine, } = state;
|
|
1512
|
+
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, transformationsByLine, pastedContent, } = state;
|
|
1356
1513
|
const text = useMemo(() => lines.join('\n'), [lines]);
|
|
1357
1514
|
const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
|
|
1358
1515
|
const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
|
|
@@ -1388,10 +1545,10 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1388
1545
|
}
|
|
1389
1546
|
}, [visualCursor, visualScrollRow, viewport, visualLines.length]);
|
|
1390
1547
|
const insert = useCallback((ch, { paste = false } = {}) => {
|
|
1391
|
-
if (
|
|
1392
|
-
dispatch({ type: 'insert', payload: ch });
|
|
1548
|
+
if (typeof ch !== 'string') {
|
|
1393
1549
|
return;
|
|
1394
1550
|
}
|
|
1551
|
+
let textToInsert = ch;
|
|
1395
1552
|
const minLengthToInferAsDragDrop = 3;
|
|
1396
1553
|
if (ch.length >= minLengthToInferAsDragDrop &&
|
|
1397
1554
|
!shellModeActive &&
|
|
@@ -1404,14 +1561,14 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1404
1561
|
potentialPath = potentialPath.trim();
|
|
1405
1562
|
const processed = parsePastedPaths(potentialPath, isValidPath);
|
|
1406
1563
|
if (processed) {
|
|
1407
|
-
|
|
1564
|
+
textToInsert = processed;
|
|
1408
1565
|
}
|
|
1409
1566
|
}
|
|
1410
1567
|
let currentText = '';
|
|
1411
|
-
for (const char of toCodePoints(
|
|
1568
|
+
for (const char of toCodePoints(textToInsert)) {
|
|
1412
1569
|
if (char.codePointAt(0) === 127) {
|
|
1413
1570
|
if (currentText.length > 0) {
|
|
1414
|
-
dispatch({ type: 'insert', payload: currentText });
|
|
1571
|
+
dispatch({ type: 'insert', payload: currentText, isPaste: paste });
|
|
1415
1572
|
currentText = '';
|
|
1416
1573
|
}
|
|
1417
1574
|
dispatch({ type: 'backspace' });
|
|
@@ -1421,9 +1578,9 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1421
1578
|
}
|
|
1422
1579
|
}
|
|
1423
1580
|
if (currentText.length > 0) {
|
|
1424
|
-
dispatch({ type: 'insert', payload: currentText });
|
|
1581
|
+
dispatch({ type: 'insert', payload: currentText, isPaste: paste });
|
|
1425
1582
|
}
|
|
1426
|
-
}, [isValidPath, shellModeActive
|
|
1583
|
+
}, [isValidPath, shellModeActive]);
|
|
1427
1584
|
const newline = useCallback(() => {
|
|
1428
1585
|
if (singleLine) {
|
|
1429
1586
|
return;
|
|
@@ -1727,6 +1884,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1727
1884
|
cursor: [cursorRow, cursorCol],
|
|
1728
1885
|
preferredCol,
|
|
1729
1886
|
selectionAnchor,
|
|
1887
|
+
pastedContent,
|
|
1730
1888
|
allVisualLines: visualLines,
|
|
1731
1889
|
viewportVisualLines: renderedVisualLines,
|
|
1732
1890
|
visualCursor,
|
|
@@ -1795,6 +1953,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1795
1953
|
cursorCol,
|
|
1796
1954
|
preferredCol,
|
|
1797
1955
|
selectionAnchor,
|
|
1956
|
+
pastedContent,
|
|
1798
1957
|
visualLines,
|
|
1799
1958
|
renderedVisualLines,
|
|
1800
1959
|
visualCursor,
|