@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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { getCliVersion } from '../../utils/version.js';
|
|
7
|
+
import process from 'node:process';
|
|
8
|
+
import { MessageType } from '../types.js';
|
|
9
|
+
export const aboutCommand = {
|
|
10
|
+
name: 'about',
|
|
11
|
+
description: 'show version info',
|
|
12
|
+
action: async (context) => {
|
|
13
|
+
const osVersion = process.platform;
|
|
14
|
+
let sandboxEnv = 'no sandbox';
|
|
15
|
+
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
|
|
16
|
+
sandboxEnv = process.env.SANDBOX;
|
|
17
|
+
}
|
|
18
|
+
else if (process.env.SANDBOX === 'sandbox-exec') {
|
|
19
|
+
sandboxEnv = `sandbox-exec (${process.env.SEATBELT_PROFILE || 'unknown'})`;
|
|
20
|
+
}
|
|
21
|
+
const modelVersion = context.services.config?.getModel() || 'Unknown';
|
|
22
|
+
const cliVersion = await getCliVersion();
|
|
23
|
+
const selectedAuthType = context.services.settings.merged.selectedAuthType || '';
|
|
24
|
+
const gcpProject = process.env.GOOGLE_CLOUD_PROJECT || '';
|
|
25
|
+
const aboutItem = {
|
|
26
|
+
type: MessageType.ABOUT,
|
|
27
|
+
cliVersion,
|
|
28
|
+
osVersion,
|
|
29
|
+
sandboxEnv,
|
|
30
|
+
modelVersion,
|
|
31
|
+
selectedAuthType,
|
|
32
|
+
gcpProject,
|
|
33
|
+
};
|
|
34
|
+
context.ui.addItem(aboutItem, Date.now());
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=aboutCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aboutCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/aboutCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAyB,MAAM,aAAa,CAAC;AAEjE,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,mBAAmB;IAChC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QACnC,IAAI,UAAU,GAAG,YAAY,CAAC;QAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;YAClE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QACnC,CAAC;aAAM,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;YAClD,UAAU,GAAG,iBACX,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,SAClC,GAAG,CAAC;QACN,CAAC;QACD,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;QACtE,MAAM,UAAU,GAAG,MAAM,aAAa,EAAE,CAAC;QACzC,MAAM,gBAAgB,GACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC;QAE1D,MAAM,SAAS,GAAiC;YAC9C,IAAI,EAAE,WAAW,CAAC,KAAK;YACvB,UAAU;YACV,SAAS;YACT,UAAU;YACV,YAAY;YACZ,gBAAgB;YAChB,UAAU;SACX,CAAC;QAEF,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const authCommand = {
|
|
7
|
+
name: 'auth',
|
|
8
|
+
description: 'change the auth method',
|
|
9
|
+
action: (_context, _args) => ({
|
|
10
|
+
type: 'dialog',
|
|
11
|
+
dialog: 'auth',
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=authCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/authCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,wBAAwB;IACrC,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAA0B,EAAE,CAAC,CAAC;QACpD,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;KACf,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const clearCommand = {
|
|
7
|
+
name: 'clear',
|
|
8
|
+
description: 'clear the screen and conversation history',
|
|
9
|
+
action: async (context, _args) => {
|
|
10
|
+
context.ui.setDebugMessage('Clearing terminal and resetting chat.');
|
|
11
|
+
await context.services.config?.getGeminiClient()?.resetChat();
|
|
12
|
+
context.session.resetSession();
|
|
13
|
+
context.ui.clear();
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=clearCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/clearCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC/B,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC,uCAAuC,CAAC,CAAC;QACpE,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,CAAC;QAC9D,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const helpCommand = {
|
|
7
|
+
name: 'help',
|
|
8
|
+
altName: '?',
|
|
9
|
+
description: 'for help on qwen code',
|
|
10
|
+
action: (_context, _args) => {
|
|
11
|
+
console.debug('Opening help UI ...');
|
|
12
|
+
return {
|
|
13
|
+
type: 'dialog',
|
|
14
|
+
dialog: 'help',
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=helpCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/helpCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,uBAAuB;IACpC,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAA0B,EAAE;QAClD,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACrC,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { getErrorMessage } from '@qwen-code/qwen-code-core';
|
|
7
|
+
import { MessageType } from '../types.js';
|
|
8
|
+
export const memoryCommand = {
|
|
9
|
+
name: 'memory',
|
|
10
|
+
description: 'Commands for interacting with memory.',
|
|
11
|
+
subCommands: [
|
|
12
|
+
{
|
|
13
|
+
name: 'show',
|
|
14
|
+
description: 'Show the current memory contents.',
|
|
15
|
+
action: async (context) => {
|
|
16
|
+
const memoryContent = context.services.config?.getUserMemory() || '';
|
|
17
|
+
const fileCount = context.services.config?.getGeminiMdFileCount() || 0;
|
|
18
|
+
const messageContent = memoryContent.length > 0
|
|
19
|
+
? `Current memory content from ${fileCount} file(s):\n\n---\n${memoryContent}\n---`
|
|
20
|
+
: 'Memory is currently empty.';
|
|
21
|
+
context.ui.addItem({
|
|
22
|
+
type: MessageType.INFO,
|
|
23
|
+
text: messageContent,
|
|
24
|
+
}, Date.now());
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'add',
|
|
29
|
+
description: 'Add content to the memory.',
|
|
30
|
+
action: (context, args) => {
|
|
31
|
+
if (!args || args.trim() === '') {
|
|
32
|
+
return {
|
|
33
|
+
type: 'message',
|
|
34
|
+
messageType: 'error',
|
|
35
|
+
content: 'Usage: /memory add <text to remember>',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
context.ui.addItem({
|
|
39
|
+
type: MessageType.INFO,
|
|
40
|
+
text: `Attempting to save to memory: "${args.trim()}"`,
|
|
41
|
+
}, Date.now());
|
|
42
|
+
return {
|
|
43
|
+
type: 'tool',
|
|
44
|
+
toolName: 'save_memory',
|
|
45
|
+
toolArgs: { fact: args.trim() },
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'refresh',
|
|
51
|
+
description: 'Refresh the memory from the source.',
|
|
52
|
+
action: async (context) => {
|
|
53
|
+
context.ui.addItem({
|
|
54
|
+
type: MessageType.INFO,
|
|
55
|
+
text: 'Refreshing memory from source files...',
|
|
56
|
+
}, Date.now());
|
|
57
|
+
try {
|
|
58
|
+
const result = await context.services.config?.refreshMemory();
|
|
59
|
+
if (result) {
|
|
60
|
+
const { memoryContent, fileCount } = result;
|
|
61
|
+
const successMessage = memoryContent.length > 0
|
|
62
|
+
? `Memory refreshed successfully. Loaded ${memoryContent.length} characters from ${fileCount} file(s).`
|
|
63
|
+
: 'Memory refreshed successfully. No memory content found.';
|
|
64
|
+
context.ui.addItem({
|
|
65
|
+
type: MessageType.INFO,
|
|
66
|
+
text: successMessage,
|
|
67
|
+
}, Date.now());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
const errorMessage = getErrorMessage(error);
|
|
72
|
+
context.ui.addItem({
|
|
73
|
+
type: MessageType.ERROR,
|
|
74
|
+
text: `Error refreshing memory: ${errorMessage}`,
|
|
75
|
+
}, Date.now());
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=memoryCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoryCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/memoryCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,uCAAuC;IACpD,WAAW,EAAE;QACX;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,mCAAmC;YAChD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBACxB,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;gBACrE,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;gBAEvE,MAAM,cAAc,GAClB,aAAa,CAAC,MAAM,GAAG,CAAC;oBACtB,CAAC,CAAC,+BAA+B,SAAS,qBAAqB,aAAa,OAAO;oBACnF,CAAC,CAAC,4BAA4B,CAAC;gBAEnC,OAAO,CAAC,EAAE,CAAC,OAAO,CAChB;oBACE,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,IAAI,EAAE,cAAc;iBACrB,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,4BAA4B;YACzC,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,EAAmC,EAAE;gBACzD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IAAI,EAAE,cAAc;yBACrB,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;oBAC5C,OAAO,CAAC,EAAE,CAAC,OAAO,CAChB;wBACE,IAAI,EAAE,WAAW,CAAC,KAAK;wBACvB,IAAI,EAAE,4BAA4B,YAAY,EAAE;qBACjD,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;gBACJ,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const privacyCommand = {
|
|
7
|
+
name: 'privacy',
|
|
8
|
+
description: 'display the privacy notice',
|
|
9
|
+
action: () => ({
|
|
10
|
+
type: 'dialog',
|
|
11
|
+
dialog: 'privacy',
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=privacyCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacyCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/privacyCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,GAA2B,EAAE,CAAC,CAAC;QACrC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,SAAS;KAClB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const themeCommand = {
|
|
7
|
+
name: 'theme',
|
|
8
|
+
description: 'change the theme',
|
|
9
|
+
action: (_context, _args) => ({
|
|
10
|
+
type: 'dialog',
|
|
11
|
+
dialog: 'theme',
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=themeCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/themeCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,kBAAkB;IAC/B,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAA0B,EAAE,CAAC,CAAC;QACpD,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,OAAO;KAChB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Config, GitService, Logger } from '@qwen-code/qwen-code-core';
|
|
7
|
+
import { LoadedSettings } from '../../config/settings.js';
|
|
8
|
+
import { UseHistoryManagerReturn } from '../hooks/useHistoryManager.js';
|
|
9
|
+
import { SessionStatsState } from '../contexts/SessionContext.js';
|
|
10
|
+
export interface CommandContext {
|
|
11
|
+
services: {
|
|
12
|
+
config: Config | null;
|
|
13
|
+
settings: LoadedSettings;
|
|
14
|
+
git: GitService | undefined;
|
|
15
|
+
logger: Logger;
|
|
16
|
+
};
|
|
17
|
+
ui: {
|
|
18
|
+
/** Adds a new item to the history display. */
|
|
19
|
+
addItem: UseHistoryManagerReturn['addItem'];
|
|
20
|
+
/** Clears all history items and the console screen. */
|
|
21
|
+
clear: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the transient debug message displayed in the application footer in debug mode.
|
|
24
|
+
*/
|
|
25
|
+
setDebugMessage: (message: string) => void;
|
|
26
|
+
};
|
|
27
|
+
session: {
|
|
28
|
+
stats: SessionStatsState;
|
|
29
|
+
resetSession: () => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The return type for a command action that results in scheduling a tool call.
|
|
34
|
+
*/
|
|
35
|
+
export interface ToolActionReturn {
|
|
36
|
+
type: 'tool';
|
|
37
|
+
toolName: string;
|
|
38
|
+
toolArgs: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The return type for a command action that results in a simple message
|
|
42
|
+
* being displayed to the user.
|
|
43
|
+
*/
|
|
44
|
+
export interface MessageActionReturn {
|
|
45
|
+
type: 'message';
|
|
46
|
+
messageType: 'info' | 'error';
|
|
47
|
+
content: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The return type for a command action that needs to open a dialog.
|
|
51
|
+
*/
|
|
52
|
+
export interface OpenDialogActionReturn {
|
|
53
|
+
type: 'dialog';
|
|
54
|
+
dialog: 'help' | 'auth' | 'theme' | 'privacy';
|
|
55
|
+
}
|
|
56
|
+
export type SlashCommandActionReturn = ToolActionReturn | MessageActionReturn | OpenDialogActionReturn;
|
|
57
|
+
export interface SlashCommand {
|
|
58
|
+
name: string;
|
|
59
|
+
altName?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
action?: (context: CommandContext, args: string) => void | SlashCommandActionReturn | Promise<void | SlashCommandActionReturn>;
|
|
62
|
+
completion?: (context: CommandContext, partialArg: string) => Promise<string[]>;
|
|
63
|
+
subCommands?: SlashCommand[];
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/commands/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
interface AboutBoxProps {
|
|
8
|
+
cliVersion: string;
|
|
9
|
+
osVersion: string;
|
|
10
|
+
sandboxEnv: string;
|
|
11
|
+
modelVersion: string;
|
|
12
|
+
selectedAuthType: string;
|
|
13
|
+
gcpProject: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const AboutBox: React.FC<AboutBoxProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { Colors } from '../colors.js';
|
|
4
|
+
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
|
5
|
+
export const AboutBox = ({ cliVersion, osVersion, sandboxEnv, modelVersion, selectedAuthType, gcpProject, }) => (_jsxs(Box, { borderStyle: "round", borderColor: Colors.Gray, flexDirection: "column", padding: 1, marginY: 1, width: "100%", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: Colors.AccentPurple, children: "About Qwen Code" }) }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "CLI Version" }) }), _jsx(Box, { children: _jsx(Text, { children: cliVersion }) })] }), GIT_COMMIT_INFO && !['N/A'].includes(GIT_COMMIT_INFO) && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "Git Commit" }) }), _jsx(Box, { children: _jsx(Text, { children: GIT_COMMIT_INFO }) })] })), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "Model" }) }), _jsx(Box, { children: _jsx(Text, { children: modelVersion }) })] }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "Sandbox" }) }), _jsx(Box, { children: _jsx(Text, { children: sandboxEnv }) })] }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "OS" }) }), _jsx(Box, { children: _jsx(Text, { children: osVersion }) })] }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "Auth Method" }) }), _jsx(Box, { children: _jsx(Text, { children: selectedAuthType.startsWith('oauth') ? 'OAuth' : selectedAuthType }) })] }), gcpProject && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: "35%", children: _jsx(Text, { bold: true, color: Colors.LightBlue, children: "GCP Project" }) }), _jsx(Box, { children: _jsx(Text, { children: gcpProject }) })] }))] }));
|
|
6
|
+
//# sourceMappingURL=AboutBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AboutBox.js","sourceRoot":"","sources":["../../../../src/ui/components/AboutBox.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAWhE,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAChD,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,EAAE,EAAE,CAAC,CACJ,MAAC,GAAG,IACF,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,MAAM,CAAC,IAAI,EACxB,aAAa,EAAC,QAAQ,EACtB,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,EACV,KAAK,EAAC,MAAM,aAEZ,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,I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F,KAAC,IAAI,cAAE,SAAS,GAAQ,GACpB,IACF,EACN,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,aACtB,KAAC,GAAG,IAAC,KAAK,EAAC,KAAK,YACd,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,MAAM,CAAC,SAAS,4BAE3B,GACH,EACN,KAAC,GAAG,cACF,KAAC,IAAI,cACF,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,GAC7D,GACH,IACF,EACL,UAAU,IAAI,CACb,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,aACtB,KAAC,GAAG,IAAC,KAAK,EAAC,KAAK,YACd,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,MAAM,CAAC,SAAS,4BAE3B,GACH,EACN,KAAC,GAAG,cACF,KAAC,IAAI,cAAE,UAAU,GAAQ,GACrB,IACF,CACP,IACG,CACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const shortAsciiLogo = "\n \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\n\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\n\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\n\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\n \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \n";
|
|
7
|
+
export declare const longAsciiLogo = "\n\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\n\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\n \u255A\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\n \u2588\u2588\u2554\u255D \u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\n\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\n\u255A\u2550\u255D \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\n";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const shortAsciiLogo = `
|
|
7
|
+
██████╗ ██╗ ██╗███████╗███╗ ██╗
|
|
8
|
+
██╔═══██╗██║ ██║██╔════╝████╗ ██║
|
|
9
|
+
██║ ██║██║ █╗ ██║█████╗ ██╔██╗ ██║
|
|
10
|
+
██║▄▄ ██║██║███╗██║██╔══╝ ██║╚██╗██║
|
|
11
|
+
╚██████╔╝╚███╔███╔╝███████╗██║ ╚████║
|
|
12
|
+
╚══▀▀═╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═══╝
|
|
13
|
+
`;
|
|
14
|
+
export const longAsciiLogo = `
|
|
15
|
+
██╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗
|
|
16
|
+
╚██╗ ██╔═══██╗██║ ██║██╔════╝████╗ ██║
|
|
17
|
+
╚██╗ ██║ ██║██║ █╗ ██║█████╗ ██╔██╗ ██║
|
|
18
|
+
██╔╝ ██║▄▄ ██║██║███╗██║██╔══╝ ██║╚██╗██║
|
|
19
|
+
██╔╝ ╚██████╔╝╚███╔███╔╝███████╗██║ ╚████║
|
|
20
|
+
╚═╝ ╚══▀▀═╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═══╝
|
|
21
|
+
`;
|
|
22
|
+
//# sourceMappingURL=AsciiArt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsciiArt.js","sourceRoot":"","sources":["../../../../src/ui/components/AsciiArt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;CAO7B,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;CAO5B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
|
8
|
+
import { AuthType } from '@qwen-code/qwen-code-core';
|
|
9
|
+
interface AuthDialogProps {
|
|
10
|
+
onSelect: (authMethod: AuthType | undefined, scope: SettingScope) => void;
|
|
11
|
+
settings: LoadedSettings;
|
|
12
|
+
initialErrorMessage?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function AuthDialog({ onSelect, settings, initialErrorMessage, }: AuthDialogProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
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 { useState } from 'react';
|
|
8
|
+
import { Box, Text, useInput } from 'ink';
|
|
9
|
+
import { Colors } from '../colors.js';
|
|
10
|
+
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
|
11
|
+
import { SettingScope } from '../../config/settings.js';
|
|
12
|
+
import { AuthType } from '@qwen-code/qwen-code-core';
|
|
13
|
+
import { validateAuthMethod, setOpenAIApiKey, setOpenAIBaseUrl, setOpenAIModel, } from '../../config/auth.js';
|
|
14
|
+
import { OpenAIKeyPrompt } from './OpenAIKeyPrompt.js';
|
|
15
|
+
function parseDefaultAuthType(defaultAuthType) {
|
|
16
|
+
if (defaultAuthType &&
|
|
17
|
+
Object.values(AuthType).includes(defaultAuthType)) {
|
|
18
|
+
return defaultAuthType;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
export function AuthDialog({ onSelect, settings, initialErrorMessage, }) {
|
|
23
|
+
const [errorMessage, setErrorMessage] = useState(initialErrorMessage || null);
|
|
24
|
+
const [showOpenAIKeyPrompt, setShowOpenAIKeyPrompt] = useState(false);
|
|
25
|
+
const items = [{ label: 'OpenAI', value: AuthType.USE_OPENAI }];
|
|
26
|
+
const initialAuthIndex = Math.max(0, items.findIndex((item) => {
|
|
27
|
+
if (settings.merged.selectedAuthType) {
|
|
28
|
+
return item.value === settings.merged.selectedAuthType;
|
|
29
|
+
}
|
|
30
|
+
const defaultAuthType = parseDefaultAuthType(process.env.GEMINI_DEFAULT_AUTH_TYPE);
|
|
31
|
+
if (defaultAuthType) {
|
|
32
|
+
return item.value === defaultAuthType;
|
|
33
|
+
}
|
|
34
|
+
if (process.env.GEMINI_API_KEY) {
|
|
35
|
+
return item.value === AuthType.USE_GEMINI;
|
|
36
|
+
}
|
|
37
|
+
return item.value === AuthType.LOGIN_WITH_GOOGLE;
|
|
38
|
+
}));
|
|
39
|
+
const handleAuthSelect = (authMethod) => {
|
|
40
|
+
const error = validateAuthMethod(authMethod);
|
|
41
|
+
if (error) {
|
|
42
|
+
if (authMethod === AuthType.USE_OPENAI && !process.env.OPENAI_API_KEY) {
|
|
43
|
+
setShowOpenAIKeyPrompt(true);
|
|
44
|
+
setErrorMessage(null);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
setErrorMessage(error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setErrorMessage(null);
|
|
52
|
+
onSelect(authMethod, SettingScope.User);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const handleOpenAIKeySubmit = (apiKey, baseUrl, model) => {
|
|
56
|
+
setOpenAIApiKey(apiKey);
|
|
57
|
+
setOpenAIBaseUrl(baseUrl);
|
|
58
|
+
setOpenAIModel(model);
|
|
59
|
+
setShowOpenAIKeyPrompt(false);
|
|
60
|
+
onSelect(AuthType.USE_OPENAI, SettingScope.User);
|
|
61
|
+
};
|
|
62
|
+
const handleOpenAIKeyCancel = () => {
|
|
63
|
+
setShowOpenAIKeyPrompt(false);
|
|
64
|
+
setErrorMessage('OpenAI API key is required to use OpenAI authentication.');
|
|
65
|
+
};
|
|
66
|
+
useInput((_input, key) => {
|
|
67
|
+
// 当显示 OpenAIKeyPrompt 时,不处理输入事件
|
|
68
|
+
if (showOpenAIKeyPrompt) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (key.escape) {
|
|
72
|
+
// Prevent exit if there is an error message.
|
|
73
|
+
// This means they user is not authenticated yet.
|
|
74
|
+
if (errorMessage) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (settings.merged.selectedAuthType === undefined) {
|
|
78
|
+
// Prevent exiting if no auth method is set
|
|
79
|
+
setErrorMessage('You must select an auth method to proceed. Press Ctrl+C twice to exit.');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
onSelect(undefined, SettingScope.User);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
if (showOpenAIKeyPrompt) {
|
|
86
|
+
return (_jsx(OpenAIKeyPrompt, { onSubmit: handleOpenAIKeySubmit, onCancel: handleOpenAIKeyCancel }));
|
|
87
|
+
}
|
|
88
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: Colors.Gray, flexDirection: "column", padding: 1, width: "100%", children: [_jsx(Text, { bold: true, children: "Get started" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: "How would you like to authenticate for this project?" }) }), _jsx(Box, { marginTop: 1, children: _jsx(RadioButtonSelect, { items: items, initialIndex: initialAuthIndex, onSelect: handleAuthSelect, isFocused: true }) }), errorMessage && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: Colors.AccentRed, children: errorMessage }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: Colors.AccentPurple, children: "(Use Enter to Set Auth)" }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: "Terms of Services and Privacy Notice for Qwen Code" }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: Colors.AccentBlue, children: 'https://github.com/QwenLM/Qwen3-Coder/blob/main/README.md' }) })] }));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=AuthDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthDialog.js","sourceRoot":"","sources":["../../../../src/ui/components/AuthDialog.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAkB,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQvD,SAAS,oBAAoB,CAC3B,eAAmC;IAEnC,IACE,eAAe;QACf,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,eAA2B,CAAC,EAC7D,CAAC;QACD,OAAO,eAA2B,CAAC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|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
interface AuthInProgressProps {
|
|
8
|
+
onTimeout: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function AuthInProgress({ onTimeout, }: AuthInProgressProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { useState, useEffect } from 'react';
|
|
8
|
+
import { Box, Text, useInput } from 'ink';
|
|
9
|
+
import Spinner from 'ink-spinner';
|
|
10
|
+
import { Colors } from '../colors.js';
|
|
11
|
+
export function AuthInProgress({ onTimeout, }) {
|
|
12
|
+
const [timedOut, setTimedOut] = useState(false);
|
|
13
|
+
useInput((_, key) => {
|
|
14
|
+
if (key.escape) {
|
|
15
|
+
onTimeout();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const timer = setTimeout(() => {
|
|
20
|
+
setTimedOut(true);
|
|
21
|
+
onTimeout();
|
|
22
|
+
}, 180000);
|
|
23
|
+
return () => clearTimeout(timer);
|
|
24
|
+
}, [onTimeout]);
|
|
25
|
+
return (_jsx(Box, { borderStyle: "round", borderColor: Colors.Gray, flexDirection: "column", padding: 1, width: "100%", children: timedOut ? (_jsx(Text, { color: Colors.AccentRed, children: "Authentication timed out. Please try again." })) : (_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Waiting for auth... (Press ESC to cancel)"] }) })) }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=AuthInProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthInProgress.js","sourceRoot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CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { ApprovalMode } from '@qwen-code/qwen-code-core';
|
|
8
|
+
interface AutoAcceptIndicatorProps {
|
|
9
|
+
approvalMode: ApprovalMode;
|
|
10
|
+
}
|
|
11
|
+
export declare const AutoAcceptIndicator: React.FC<AutoAcceptIndicatorProps>;
|
|
12
|
+
export {};
|