@qwen-code/qwen-code 0.0.1-dev1 → 0.0.2
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 +219 -41
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +79 -0
- package/dist/src/config/auth.d.ts +9 -0
- package/dist/src/config/auth.js +48 -0
- package/dist/src/config/auth.js.map +1 -0
- package/dist/src/config/config.d.ts +39 -0
- package/dist/src/config/config.js +318 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/extension.d.ts +21 -0
- package/dist/src/config/extension.js +109 -0
- package/dist/src/config/extension.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +13 -0
- package/dist/src/config/sandboxConfig.js +75 -0
- package/dist/src/config/sandboxConfig.js.map +1 -0
- package/dist/src/config/settings.d.ts +95 -0
- package/dist/src/config/settings.js +263 -0
- package/dist/src/config/settings.js.map +1 -0
- package/dist/src/gemini.d.ts +6 -0
- package/dist/src/gemini.js +256 -0
- package/dist/src/gemini.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +6 -0
- package/dist/src/generated/git-commit.js +9 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/nonInteractiveCli.d.ts +7 -0
- package/dist/src/nonInteractiveCli.js +191 -0
- package/dist/src/nonInteractiveCli.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +13 -0
- package/dist/src/services/CommandService.js +38 -0
- package/dist/src/services/CommandService.js.map +1 -0
- package/dist/src/ui/App.d.ts +15 -0
- package/dist/src/ui/App.js +499 -0
- package/dist/src/ui/App.js.map +1 -0
- package/dist/src/ui/colors.d.ts +7 -0
- package/dist/src/ui/colors.js +48 -0
- package/dist/src/ui/colors.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
- package/dist/src/ui/commands/aboutCommand.js +37 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +7 -0
- package/dist/src/ui/commands/authCommand.js +14 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.d.ts +7 -0
- package/dist/src/ui/commands/clearCommand.js +16 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +7 -0
- package/dist/src/ui/commands/helpCommand.js +18 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/memoryCommand.js +81 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -0
- package/dist/src/ui/commands/privacyCommand.d.ts +7 -0
- package/dist/src/ui/commands/privacyCommand.js +14 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +7 -0
- package/dist/src/ui/commands/themeCommand.js +14 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +64 -0
- package/dist/src/ui/commands/types.js +7 -0
- package/dist/src/ui/commands/types.js.map +1 -0
- package/dist/src/ui/components/AboutBox.d.ts +16 -0
- package/dist/src/ui/components/AboutBox.js +6 -0
- package/dist/src/ui/components/AboutBox.js.map +1 -0
- package/dist/src/ui/components/AsciiArt.d.ts +7 -0
- package/dist/src/ui/components/AsciiArt.js +22 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -0
- package/dist/src/ui/components/AuthDialog.d.ts +15 -0
- package/dist/src/ui/components/AuthDialog.js +90 -0
- package/dist/src/ui/components/AuthDialog.js.map +1 -0
- package/dist/src/ui/components/AuthInProgress.d.ts +11 -0
- package/dist/src/ui/components/AuthInProgress.js +27 -0
- package/dist/src/ui/components/AuthInProgress.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js +26 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +15 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js +41 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +14 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js +34 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +15 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +73 -0
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +21 -0
- package/dist/src/ui/components/Footer.js +14 -0
- package/dist/src/ui/components/Footer.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +17 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +16 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
- package/dist/src/ui/components/Header.d.ts +14 -0
- package/dist/src/ui/components/Header.js +20 -0
- package/dist/src/ui/components/Header.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +12 -0
- package/dist/src/ui/components/Help.js +10 -0
- package/dist/src/ui/components/Help.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +18 -0
- package/dist/src/ui/components/HistoryItemDisplay.js +17 -0
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +25 -0
- package/dist/src/ui/components/InputPrompt.js +338 -0
- package/dist/src/ui/components/InputPrompt.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
- package/dist/src/ui/components/LoadingIndicator.js +20 -0
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +27 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +7 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +33 -0
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +12 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js +118 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +11 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +4 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
- package/dist/src/ui/components/ShellModeIndicator.js +5 -0
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
- package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
- package/dist/src/ui/components/ShowMoreLines.js +24 -0
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.d.ts +12 -0
- package/dist/src/ui/components/StatsDisplay.js +42 -0
- package/dist/src/ui/components/StatsDisplay.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +21 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +32 -0
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.d.ts +19 -0
- package/dist/src/ui/components/ThemeDialog.js +127 -0
- package/dist/src/ui/components/ThemeDialog.js.map +1 -0
- package/dist/src/ui/components/Tips.d.ts +12 -0
- package/dist/src/ui/components/Tips.js +8 -0
- package/dist/src/ui/components/Tips.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +7 -0
- package/dist/src/ui/components/ToolStatsDisplay.js +41 -0
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
- package/dist/src/ui/components/UpdateNotification.js +10 -0
- package/dist/src/ui/components/UpdateNotification.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/CompressionMessage.js +16 -0
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +15 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +212 -0
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
- package/dist/src/ui/components/messages/GeminiMessage.js +10 -0
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +14 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js +15 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/InfoMessage.js +9 -0
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +15 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +111 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +18 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js +53 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +15 -0
- package/dist/src/ui/components/messages/ToolMessage.js +61 -0
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/UserMessage.js +9 -0
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/UserShellMessage.js +9 -0
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +384 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +44 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js +100 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +184 -0
- package/dist/src/ui/components/shared/text-buffer.js +1010 -0
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
- package/dist/src/ui/constants.d.ts +8 -0
- package/dist/src/ui/constants.js +12 -0
- package/dist/src/ui/constants.js.map +1 -0
- package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
- package/dist/src/ui/contexts/OverflowContext.js +43 -0
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.d.ts +37 -0
- package/dist/src/ui/contexts/SessionContext.js +68 -0
- package/dist/src/ui/contexts/SessionContext.js.map +1 -0
- package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
- package/dist/src/ui/contexts/StreamingContext.js +15 -0
- package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
- package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
- package/dist/src/ui/editors/editorSettingsManager.js +54 -0
- package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +31 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +310 -0
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +16 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +261 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +27 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +1042 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/useAuthCommand.d.ts +14 -0
- package/dist/src/ui/hooks/useAuthCommand.js +64 -0
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +10 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +37 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
- package/dist/src/ui/hooks/useBracketedPaste.js +32 -0
- package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
- package/dist/src/ui/hooks/useCompletion.d.ts +21 -0
- package/dist/src/ui/hooks/useCompletion.js +375 -0
- package/dist/src/ui/hooks/useCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +12 -0
- package/dist/src/ui/hooks/useConsoleMessages.js +60 -0
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
- package/dist/src/ui/hooks/useEditorSettings.js +43 -0
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +23 -0
- package/dist/src/ui/hooks/useGeminiStream.js +579 -0
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.js +61 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +22 -0
- package/dist/src/ui/hooks/useHistoryManager.js +72 -0
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistory.js +84 -0
- package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +29 -0
- package/dist/src/ui/hooks/useKeypress.js +156 -0
- package/dist/src/ui/hooks/useKeypress.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +10 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js +44 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useLogger.d.ts +10 -0
- package/dist/src/ui/hooks/useLogger.js +29 -0
- package/dist/src/ui/hooks/useLogger.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +189 -0
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +16 -0
- package/dist/src/ui/hooks/usePrivacySettings.js +115 -0
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +33 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js +186 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +11 -0
- package/dist/src/ui/hooks/useShellHistory.js +89 -0
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js +58 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
- package/dist/src/ui/hooks/useStateAndRef.js +26 -0
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
- package/dist/src/ui/hooks/useTerminalSize.js +27 -0
- package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
- package/dist/src/ui/hooks/useThemeCommand.js +78 -0
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.d.ts +12 -0
- package/dist/src/ui/hooks/useTimer.js +58 -0
- package/dist/src/ui/hooks/useTimer.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +12 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +40 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +10 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +17 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +10 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +17 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +12 -0
- package/dist/src/ui/privacy/PrivacyNotice.js +25 -0
- package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.d.ts +7 -0
- package/dist/src/ui/themes/ansi-light.js +139 -0
- package/dist/src/ui/themes/ansi-light.js.map +1 -0
- package/dist/src/ui/themes/ansi.d.ts +7 -0
- package/dist/src/ui/themes/ansi.js +149 -0
- package/dist/src/ui/themes/ansi.js.map +1 -0
- package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
- package/dist/src/ui/themes/atom-one-dark.js +136 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
- package/dist/src/ui/themes/ayu-light.d.ts +7 -0
- package/dist/src/ui/themes/ayu-light.js +128 -0
- package/dist/src/ui/themes/ayu-light.js.map +1 -0
- package/dist/src/ui/themes/ayu.d.ts +7 -0
- package/dist/src/ui/themes/ayu.js +102 -0
- package/dist/src/ui/themes/ayu.js.map +1 -0
- package/dist/src/ui/themes/default-light.d.ts +7 -0
- package/dist/src/ui/themes/default-light.js +100 -0
- package/dist/src/ui/themes/default-light.js.map +1 -0
- package/dist/src/ui/themes/default.d.ts +7 -0
- package/dist/src/ui/themes/default.js +143 -0
- package/dist/src/ui/themes/default.js.map +1 -0
- package/dist/src/ui/themes/dracula.d.ts +7 -0
- package/dist/src/ui/themes/dracula.js +113 -0
- package/dist/src/ui/themes/dracula.js.map +1 -0
- package/dist/src/ui/themes/github-dark.d.ts +7 -0
- package/dist/src/ui/themes/github-dark.js +136 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -0
- package/dist/src/ui/themes/github-light.d.ts +7 -0
- package/dist/src/ui/themes/github-light.js +138 -0
- package/dist/src/ui/themes/github-light.js.map +1 -0
- package/dist/src/ui/themes/googlecode.d.ts +7 -0
- package/dist/src/ui/themes/googlecode.js +135 -0
- package/dist/src/ui/themes/googlecode.js.map +1 -0
- package/dist/src/ui/themes/no-color.d.ts +7 -0
- package/dist/src/ui/themes/no-color.js +84 -0
- package/dist/src/ui/themes/no-color.js.map +1 -0
- package/dist/src/ui/themes/qwen-dark.d.ts +7 -0
- package/dist/src/ui/themes/qwen-dark.js +102 -0
- package/dist/src/ui/themes/qwen-dark.js.map +1 -0
- package/dist/src/ui/themes/qwen-light.d.ts +7 -0
- package/dist/src/ui/themes/qwen-light.js +128 -0
- package/dist/src/ui/themes/qwen-light.js.map +1 -0
- package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
- package/dist/src/ui/themes/shades-of-purple.js +302 -0
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +33 -0
- package/dist/src/ui/themes/theme-manager.js +119 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +67 -0
- package/dist/src/ui/themes/theme.js +304 -0
- package/dist/src/ui/themes/theme.js.map +1 -0
- package/dist/src/ui/themes/xcode.d.ts +7 -0
- package/dist/src/ui/themes/xcode.js +143 -0
- package/dist/src/ui/themes/xcode.js.map +1 -0
- package/dist/src/ui/types.d.ts +172 -0
- package/dist/src/ui/types.js +43 -0
- package/dist/src/ui/types.js.map +1 -0
- package/dist/src/ui/utils/CodeColorizer.d.ts +14 -0
- package/dist/src/ui/utils/CodeColorizer.js +97 -0
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
- package/dist/src/ui/utils/ConsolePatcher.d.ts +23 -0
- package/dist/src/ui/utils/ConsolePatcher.js +42 -0
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +104 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +14 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +205 -0
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.d.ts +17 -0
- package/dist/src/ui/utils/TableRenderer.js +84 -0
- package/dist/src/ui/utils/TableRenderer.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.d.ts +22 -0
- package/dist/src/ui/utils/clipboardUtils.js +127 -0
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +22 -0
- package/dist/src/ui/utils/commandUtils.js +25 -0
- package/dist/src/ui/utils/commandUtils.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +10 -0
- package/dist/src/ui/utils/computeStats.js +55 -0
- package/dist/src/ui/utils/computeStats.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.d.ts +17 -0
- package/dist/src/ui/utils/displayUtils.js +24 -0
- package/dist/src/ui/utils/displayUtils.js.map +1 -0
- package/dist/src/ui/utils/errorParsing.d.ts +7 -0
- package/dist/src/ui/utils/errorParsing.js +90 -0
- package/dist/src/ui/utils/errorParsing.js.map +1 -0
- package/dist/src/ui/utils/formatters.d.ts +13 -0
- package/dist/src/ui/utils/formatters.js +56 -0
- package/dist/src/ui/utils/formatters.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.js +110 -0
- package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
- package/dist/src/ui/utils/textUtils.d.ts +22 -0
- package/dist/src/ui/utils/textUtils.js +58 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.js +36 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +8 -0
- package/dist/src/utils/cleanup.js +34 -0
- package/dist/src/utils/cleanup.js.map +1 -0
- package/dist/src/utils/package.d.ts +12 -0
- package/dist/src/utils/package.js +24 -0
- package/dist/src/utils/package.js.map +1 -0
- package/dist/src/utils/readStdin.d.ts +6 -0
- package/dist/src/utils/readStdin.js +34 -0
- package/dist/src/utils/readStdin.js.map +1 -0
- package/dist/src/utils/sandbox.d.ts +7 -0
- package/dist/src/utils/sandbox.js +690 -0
- package/dist/src/utils/sandbox.js.map +1 -0
- package/dist/src/utils/startupWarnings.d.ts +6 -0
- package/dist/src/utils/startupWarnings.js +40 -0
- package/dist/src/utils/startupWarnings.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.js +48 -0
- package/dist/src/utils/userStartupWarnings.js.map +1 -0
- package/dist/src/utils/version.d.ts +6 -0
- package/dist/src/utils/version.js +11 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +63 -69
- package/README.gemini.md +0 -162
- package/bundle/gemini.js +0 -291272
- /package/{bundle → dist/src/utils}/sandbox-macos-permissive-closed.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-permissive-open.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-permissive-proxied.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-closed.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-open.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-proxied.sb +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
import { Text, Box, useInput } from 'ink';
|
|
9
|
+
import { Colors } from '../../colors.js';
|
|
10
|
+
/**
|
|
11
|
+
* A custom component that displays a list of items with radio buttons,
|
|
12
|
+
* supporting scrolling and keyboard navigation.
|
|
13
|
+
*
|
|
14
|
+
* @template T The type of the value associated with each radio item.
|
|
15
|
+
*/
|
|
16
|
+
export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlight, isFocused, showScrollArrows = false, maxItemsToShow = 10, }) {
|
|
17
|
+
// Ensure initialIndex is within bounds
|
|
18
|
+
const safeInitialIndex = items.length > 0
|
|
19
|
+
? Math.max(0, Math.min(initialIndex, items.length - 1))
|
|
20
|
+
: 0;
|
|
21
|
+
const [activeIndex, setActiveIndex] = useState(safeInitialIndex);
|
|
22
|
+
const [scrollOffset, setScrollOffset] = useState(0);
|
|
23
|
+
// Ensure activeIndex is always within bounds when items change
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (items.length === 0) {
|
|
26
|
+
setActiveIndex(0);
|
|
27
|
+
}
|
|
28
|
+
else if (activeIndex >= items.length) {
|
|
29
|
+
setActiveIndex(Math.max(0, items.length - 1));
|
|
30
|
+
}
|
|
31
|
+
}, [items.length, activeIndex]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const newScrollOffset = Math.max(0, Math.min(activeIndex - maxItemsToShow + 1, items.length - maxItemsToShow));
|
|
34
|
+
if (activeIndex < scrollOffset) {
|
|
35
|
+
setScrollOffset(activeIndex);
|
|
36
|
+
}
|
|
37
|
+
else if (activeIndex >= scrollOffset + maxItemsToShow) {
|
|
38
|
+
setScrollOffset(newScrollOffset);
|
|
39
|
+
}
|
|
40
|
+
}, [activeIndex, items.length, scrollOffset, maxItemsToShow]);
|
|
41
|
+
useInput((input, key) => {
|
|
42
|
+
if (input === 'k' || key.upArrow) {
|
|
43
|
+
if (items.length > 0) {
|
|
44
|
+
const newIndex = activeIndex > 0 ? activeIndex - 1 : items.length - 1;
|
|
45
|
+
setActiveIndex(newIndex);
|
|
46
|
+
if (items[newIndex]) {
|
|
47
|
+
onHighlight?.(items[newIndex].value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (input === 'j' || key.downArrow) {
|
|
52
|
+
if (items.length > 0) {
|
|
53
|
+
const newIndex = activeIndex < items.length - 1 ? activeIndex + 1 : 0;
|
|
54
|
+
setActiveIndex(newIndex);
|
|
55
|
+
if (items[newIndex]) {
|
|
56
|
+
onHighlight?.(items[newIndex].value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (key.return) {
|
|
61
|
+
// Add bounds check before accessing items[activeIndex]
|
|
62
|
+
if (activeIndex >= 0 &&
|
|
63
|
+
activeIndex < items.length &&
|
|
64
|
+
items[activeIndex]) {
|
|
65
|
+
onSelect(items[activeIndex].value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Enable selection directly from number keys.
|
|
69
|
+
if (/^[1-9]$/.test(input)) {
|
|
70
|
+
const targetIndex = Number.parseInt(input, 10) - 1;
|
|
71
|
+
if (targetIndex >= 0 && targetIndex < visibleItems.length) {
|
|
72
|
+
const selectedItem = visibleItems[targetIndex];
|
|
73
|
+
if (selectedItem) {
|
|
74
|
+
onSelect?.(selectedItem.value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
isActive: isFocused &&
|
|
80
|
+
items.length > 0 &&
|
|
81
|
+
activeIndex >= 0 &&
|
|
82
|
+
activeIndex < items.length,
|
|
83
|
+
});
|
|
84
|
+
const visibleItems = items.slice(scrollOffset, scrollOffset + maxItemsToShow);
|
|
85
|
+
return (_jsxs(Box, { flexDirection: "column", children: [showScrollArrows && (_jsx(Text, { color: scrollOffset > 0 ? Colors.Foreground : Colors.Gray, children: "\u25B2" })), visibleItems.map((item, index) => {
|
|
86
|
+
const itemIndex = scrollOffset + index;
|
|
87
|
+
const isSelected = activeIndex === itemIndex;
|
|
88
|
+
let textColor = Colors.Foreground;
|
|
89
|
+
if (isSelected) {
|
|
90
|
+
textColor = Colors.AccentGreen;
|
|
91
|
+
}
|
|
92
|
+
else if (item.disabled) {
|
|
93
|
+
textColor = Colors.Gray;
|
|
94
|
+
}
|
|
95
|
+
return (_jsxs(Box, { children: [_jsx(Box, { minWidth: 2, flexShrink: 0, children: _jsx(Text, { color: isSelected ? Colors.AccentGreen : Colors.Foreground, children: isSelected ? '●' : '○' }) }), item.themeNameDisplay && item.themeTypeDisplay ? (_jsxs(Text, { color: textColor, wrap: "truncate", children: [item.themeNameDisplay, ' ', _jsx(Text, { color: Colors.Gray, children: item.themeTypeDisplay })] })) : (_jsx(Text, { color: textColor, wrap: "truncate", children: item.label }))] }, item.label));
|
|
96
|
+
}), showScrollArrows && (_jsx(Text, { color: scrollOffset + maxItemsToShow < items.length
|
|
97
|
+
? Colors.Foreground
|
|
98
|
+
: Colors.Gray, children: "\u25BC" }))] }));
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=RadioButtonSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/RadioButtonSelect.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAmCzC;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAI,EACnC,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,gBAAgB,GAAG,KAAK,EACxB,cAAc,GAAG,EAAE,GACO;IAC1B,uCAAuC;IACvC,MAAM,gBAAgB,GACpB,KAAK,CAAC,MAAM,GAAG,CAAC;QACd,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC,CAAC;IACR,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACjE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpD,+DAA+D;IAC/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,cAAc,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,IAAI,WAAW,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACvC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC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CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,UAAU,YACpC,IAAI,CAAC,KAAK,GACN,CACR,KAfO,IAAI,CAAC,KAAK,CAgBd,CACP,CAAC;YACJ,CAAC,CAAC,EACD,gBAAgB,IAAI,CACnB,KAAC,IAAI,IACH,KAAK,EACH,YAAY,GAAG,cAAc,GAAG,KAAK,CAAC,MAAM;oBAC1C,CAAC,CAAC,MAAM,CAAC,UAAU;oBACnB,CAAC,CAAC,MAAM,CAAC,IAAI,uBAIZ,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type Direction = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'home' | 'end';
|
|
7
|
+
export interface Viewport {
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
10
|
+
}
|
|
11
|
+
interface UseTextBufferProps {
|
|
12
|
+
initialText?: string;
|
|
13
|
+
initialCursorOffset?: number;
|
|
14
|
+
viewport: Viewport;
|
|
15
|
+
stdin?: NodeJS.ReadStream | null;
|
|
16
|
+
setRawMode?: (mode: boolean) => void;
|
|
17
|
+
onChange?: (text: string) => void;
|
|
18
|
+
isValidPath: (path: string) => boolean;
|
|
19
|
+
shellModeActive?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface UndoHistoryEntry {
|
|
22
|
+
lines: string[];
|
|
23
|
+
cursorRow: number;
|
|
24
|
+
cursorCol: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function offsetToLogicalPos(text: string, offset: number): [number, number];
|
|
27
|
+
interface TextBufferState {
|
|
28
|
+
lines: string[];
|
|
29
|
+
cursorRow: number;
|
|
30
|
+
cursorCol: number;
|
|
31
|
+
preferredCol: number | null;
|
|
32
|
+
undoStack: UndoHistoryEntry[];
|
|
33
|
+
redoStack: UndoHistoryEntry[];
|
|
34
|
+
clipboard: string | null;
|
|
35
|
+
selectionAnchor: [number, number] | null;
|
|
36
|
+
viewportWidth: number;
|
|
37
|
+
}
|
|
38
|
+
type TextBufferAction = {
|
|
39
|
+
type: 'set_text';
|
|
40
|
+
payload: string;
|
|
41
|
+
pushToUndo?: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'insert';
|
|
44
|
+
payload: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'backspace';
|
|
47
|
+
} | {
|
|
48
|
+
type: 'move';
|
|
49
|
+
payload: {
|
|
50
|
+
dir: Direction;
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
type: 'delete';
|
|
54
|
+
} | {
|
|
55
|
+
type: 'delete_word_left';
|
|
56
|
+
} | {
|
|
57
|
+
type: 'delete_word_right';
|
|
58
|
+
} | {
|
|
59
|
+
type: 'kill_line_right';
|
|
60
|
+
} | {
|
|
61
|
+
type: 'kill_line_left';
|
|
62
|
+
} | {
|
|
63
|
+
type: 'undo';
|
|
64
|
+
} | {
|
|
65
|
+
type: 'redo';
|
|
66
|
+
} | {
|
|
67
|
+
type: 'replace_range';
|
|
68
|
+
payload: {
|
|
69
|
+
startRow: number;
|
|
70
|
+
startCol: number;
|
|
71
|
+
endRow: number;
|
|
72
|
+
endCol: number;
|
|
73
|
+
text: string;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
type: 'move_to_offset';
|
|
77
|
+
payload: {
|
|
78
|
+
offset: number;
|
|
79
|
+
};
|
|
80
|
+
} | {
|
|
81
|
+
type: 'create_undo_snapshot';
|
|
82
|
+
} | {
|
|
83
|
+
type: 'set_viewport_width';
|
|
84
|
+
payload: number;
|
|
85
|
+
};
|
|
86
|
+
export declare function textBufferReducer(state: TextBufferState, action: TextBufferAction): TextBufferState;
|
|
87
|
+
export declare function useTextBuffer({ initialText, initialCursorOffset, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive, }: UseTextBufferProps): TextBuffer;
|
|
88
|
+
export interface TextBuffer {
|
|
89
|
+
lines: string[];
|
|
90
|
+
text: string;
|
|
91
|
+
cursor: [number, number];
|
|
92
|
+
/**
|
|
93
|
+
* When the user moves the caret vertically we try to keep their original
|
|
94
|
+
* horizontal column even when passing through shorter lines. We remember
|
|
95
|
+
* that *preferred* column in this field while the user is still travelling
|
|
96
|
+
* vertically. Any explicit horizontal movement resets the preference.
|
|
97
|
+
*/
|
|
98
|
+
preferredCol: number | null;
|
|
99
|
+
selectionAnchor: [number, number] | null;
|
|
100
|
+
allVisualLines: string[];
|
|
101
|
+
viewportVisualLines: string[];
|
|
102
|
+
visualCursor: [number, number];
|
|
103
|
+
visualScrollRow: number;
|
|
104
|
+
/**
|
|
105
|
+
* Replaces the entire buffer content with the provided text.
|
|
106
|
+
* The operation is undoable.
|
|
107
|
+
*/
|
|
108
|
+
setText: (text: string) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Insert a single character or string without newlines.
|
|
111
|
+
*/
|
|
112
|
+
insert: (ch: string) => void;
|
|
113
|
+
newline: () => void;
|
|
114
|
+
backspace: () => void;
|
|
115
|
+
del: () => void;
|
|
116
|
+
move: (dir: Direction) => void;
|
|
117
|
+
undo: () => void;
|
|
118
|
+
redo: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Replaces the text within the specified range with new text.
|
|
121
|
+
* Handles both single-line and multi-line ranges.
|
|
122
|
+
*
|
|
123
|
+
* @param startRow The starting row index (inclusive).
|
|
124
|
+
* @param startCol The starting column index (inclusive, code-point based).
|
|
125
|
+
* @param endRow The ending row index (inclusive).
|
|
126
|
+
* @param endCol The ending column index (exclusive, code-point based).
|
|
127
|
+
* @param text The new text to insert.
|
|
128
|
+
* @returns True if the buffer was modified, false otherwise.
|
|
129
|
+
*/
|
|
130
|
+
replaceRange: (startRow: number, startCol: number, endRow: number, endCol: number, text: string) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Delete the word to the *left* of the caret, mirroring common
|
|
133
|
+
* Ctrl/Alt+Backspace behaviour in editors & terminals. Both the adjacent
|
|
134
|
+
* whitespace *and* the word characters immediately preceding the caret are
|
|
135
|
+
* removed. If the caret is already at column‑0 this becomes a no-op.
|
|
136
|
+
*/
|
|
137
|
+
deleteWordLeft: () => void;
|
|
138
|
+
/**
|
|
139
|
+
* Delete the word to the *right* of the caret, akin to many editors'
|
|
140
|
+
* Ctrl/Alt+Delete shortcut. Removes any whitespace/punctuation that
|
|
141
|
+
* follows the caret and the next contiguous run of word characters.
|
|
142
|
+
*/
|
|
143
|
+
deleteWordRight: () => void;
|
|
144
|
+
/**
|
|
145
|
+
* Deletes text from the cursor to the end of the current line.
|
|
146
|
+
*/
|
|
147
|
+
killLineRight: () => void;
|
|
148
|
+
/**
|
|
149
|
+
* Deletes text from the start of the current line to the cursor.
|
|
150
|
+
*/
|
|
151
|
+
killLineLeft: () => void;
|
|
152
|
+
/**
|
|
153
|
+
* High level "handleInput" – receives what Ink gives us.
|
|
154
|
+
*/
|
|
155
|
+
handleInput: (key: {
|
|
156
|
+
name: string;
|
|
157
|
+
ctrl: boolean;
|
|
158
|
+
meta: boolean;
|
|
159
|
+
shift: boolean;
|
|
160
|
+
paste: boolean;
|
|
161
|
+
sequence: string;
|
|
162
|
+
}) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Opens the current buffer contents in the user's preferred terminal text
|
|
165
|
+
* editor ($VISUAL or $EDITOR, falling back to "vi"). The method blocks
|
|
166
|
+
* until the editor exits, then reloads the file and replaces the in‑memory
|
|
167
|
+
* buffer with whatever the user saved.
|
|
168
|
+
*
|
|
169
|
+
* The operation is treated as a single undoable edit – we snapshot the
|
|
170
|
+
* previous state *once* before launching the editor so one `undo()` will
|
|
171
|
+
* revert the entire change set.
|
|
172
|
+
*
|
|
173
|
+
* Note: We purposefully rely on the *synchronous* spawn API so that the
|
|
174
|
+
* calling process genuinely waits for the editor to close before
|
|
175
|
+
* continuing. This mirrors Git's behaviour and simplifies downstream
|
|
176
|
+
* control‑flow (callers can simply `await` the Promise).
|
|
177
|
+
*/
|
|
178
|
+
openInExternalEditor: (opts?: {
|
|
179
|
+
editor?: string;
|
|
180
|
+
}) => Promise<void>;
|
|
181
|
+
replaceRangeByOffset: (startOffset: number, endOffset: number, replacementText: string) => void;
|
|
182
|
+
moveToOffset(offset: number): void;
|
|
183
|
+
}
|
|
184
|
+
export {};
|