@machina.ai/cell-cli 0.1.13-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.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/acp/acp.d.ts +208 -0
- package/dist/src/acp/acp.js +193 -0
- package/dist/src/acp/acp.js.map +1 -0
- package/dist/src/acp/acpPeer.d.ts +8 -0
- package/dist/src/acp/acpPeer.js +537 -0
- package/dist/src/acp/acpPeer.js.map +1 -0
- package/dist/src/config/auth.d.ts +6 -0
- package/dist/src/config/auth.js +15 -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 +359 -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 +114 -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 +91 -0
- package/dist/src/config/settings.js +282 -0
- package/dist/src/config/settings.js.map +1 -0
- package/dist/src/gemini.d.ts +6 -0
- package/dist/src/gemini.js +242 -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 +124 -0
- package/dist/src/nonInteractiveCli.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
- package/dist/src/services/BuiltinCommandLoader.js +70 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +51 -0
- package/dist/src/services/CommandService.js +74 -0
- package/dist/src/services/CommandService.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +37 -0
- package/dist/src/services/FileCommandLoader.js +133 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -0
- package/dist/src/services/types.d.ts +22 -0
- package/dist/src/services/types.js +7 -0
- package/dist/src/services/types.js.map +1 -0
- package/dist/src/ui/App.d.ts +15 -0
- package/dist/src/ui/App.js +488 -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 +39 -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 +16 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +63 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +7 -0
- package/dist/src/ui/commands/chatCommand.js +174 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.d.ts +7 -0
- package/dist/src/ui/commands/clearCommand.js +27 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +64 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.d.ts +7 -0
- package/dist/src/ui/commands/copyCommand.js +59 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -0
- package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
- package/dist/src/ui/commands/corgiCommand.js +15 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +31 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +16 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/extensionsCommand.js +31 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +7 -0
- package/dist/src/ui/commands/helpCommand.js +20 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.d.ts +8 -0
- package/dist/src/ui/commands/ideCommand.js +127 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +206 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/memoryCommand.js +86 -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 +16 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +34 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +128 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +54 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +7 -0
- package/dist/src/ui/commands/themeCommand.js +16 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +56 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +110 -0
- package/dist/src/ui/commands/types.js +11 -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 +32 -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 +50 -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 +20 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js +68 -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 +387 -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/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 +148 -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 +16 -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 +55 -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 +451 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +46 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js +119 -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 +9 -0
- package/dist/src/ui/constants.js +13 -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 +36 -0
- package/dist/src/ui/contexts/SessionContext.js +59 -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 +347 -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 +295 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +20 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +294 -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 +65 -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 +22 -0
- package/dist/src/ui/hooks/useCompletion.js +393 -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/useFocus.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.js +41 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +23 -0
- package/dist/src/ui/hooks/useGeminiStream.js +613 -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 +79 -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/color-utils.d.ts +21 -0
- package/dist/src/ui/themes/color-utils.js +221 -0
- package/dist/src/ui/themes/color-utils.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/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 +58 -0
- package/dist/src/ui/themes/theme-manager.js +179 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +84 -0
- package/dist/src/ui/themes/theme.js +341 -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 +180 -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 +15 -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 +23 -0
- package/dist/src/ui/utils/commandUtils.js +72 -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 +40 -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-macos-permissive-closed.sb +26 -0
- package/dist/src/utils/sandbox-macos-permissive-open.sb +19 -0
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +31 -0
- package/dist/src/utils/sandbox-macos-restrictive-closed.sb +87 -0
- package/dist/src/utils/sandbox-macos-restrictive-open.sb +90 -0
- package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +92 -0
- package/dist/src/utils/sandbox.d.ts +7 -0
- package/dist/src/utils/sandbox.js +680 -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 +54 -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 +79 -0
|
@@ -0,0 +1,39 @@
|
|
|
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 { CommandKind } from './types.js';
|
|
8
|
+
import process from 'node:process';
|
|
9
|
+
import { MessageType } from '../types.js';
|
|
10
|
+
export const aboutCommand = {
|
|
11
|
+
name: 'about',
|
|
12
|
+
description: 'show version info',
|
|
13
|
+
kind: CommandKind.BUILT_IN,
|
|
14
|
+
action: async (context) => {
|
|
15
|
+
const osVersion = process.platform;
|
|
16
|
+
let sandboxEnv = 'no sandbox';
|
|
17
|
+
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
|
|
18
|
+
sandboxEnv = process.env.SANDBOX;
|
|
19
|
+
}
|
|
20
|
+
else if (process.env.SANDBOX === 'sandbox-exec') {
|
|
21
|
+
sandboxEnv = `sandbox-exec (${process.env.SEATBELT_PROFILE || 'unknown'})`;
|
|
22
|
+
}
|
|
23
|
+
const modelVersion = context.services.config?.getModel() || 'Unknown';
|
|
24
|
+
const cliVersion = await getCliVersion();
|
|
25
|
+
const selectedAuthType = context.services.settings.merged.selectedAuthType || '';
|
|
26
|
+
const gcpProject = process.env.GOOGLE_CLOUD_PROJECT || '';
|
|
27
|
+
const aboutItem = {
|
|
28
|
+
type: MessageType.ABOUT,
|
|
29
|
+
cliVersion,
|
|
30
|
+
osVersion,
|
|
31
|
+
sandboxEnv,
|
|
32
|
+
modelVersion,
|
|
33
|
+
selectedAuthType,
|
|
34
|
+
gcpProject,
|
|
35
|
+
};
|
|
36
|
+
context.ui.addItem(aboutItem, Date.now());
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
//# 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;AACvD,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AACvD,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,IAAI,EAAE,WAAW,C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7
|
+
export const authCommand = {
|
|
8
|
+
name: 'auth',
|
|
9
|
+
description: 'change the auth method',
|
|
10
|
+
kind: CommandKind.BUILT_IN,
|
|
11
|
+
action: (_context, _args) => ({
|
|
12
|
+
type: 'dialog',
|
|
13
|
+
dialog: 'auth',
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=authCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/authCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAwC,MAAM,YAAY,CAAC;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,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,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import open from 'open';
|
|
7
|
+
import process from 'node:process';
|
|
8
|
+
import { CommandKind, } from './types.js';
|
|
9
|
+
import { MessageType } from '../types.js';
|
|
10
|
+
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
|
11
|
+
import { formatMemoryUsage } from '../utils/formatters.js';
|
|
12
|
+
import { getCliVersion } from '../../utils/version.js';
|
|
13
|
+
export const bugCommand = {
|
|
14
|
+
name: 'bug',
|
|
15
|
+
description: 'submit a bug report',
|
|
16
|
+
kind: CommandKind.BUILT_IN,
|
|
17
|
+
action: async (context, args) => {
|
|
18
|
+
const bugDescription = (args || '').trim();
|
|
19
|
+
const { config } = context.services;
|
|
20
|
+
const osVersion = `${process.platform} ${process.version}`;
|
|
21
|
+
let sandboxEnv = 'no sandbox';
|
|
22
|
+
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
|
|
23
|
+
sandboxEnv = process.env.SANDBOX.replace(/^gemini-(?:code-)?/, '');
|
|
24
|
+
}
|
|
25
|
+
else if (process.env.SANDBOX === 'sandbox-exec') {
|
|
26
|
+
sandboxEnv = `sandbox-exec (${process.env.SEATBELT_PROFILE || 'unknown'})`;
|
|
27
|
+
}
|
|
28
|
+
const modelVersion = config?.getModel() || 'Unknown';
|
|
29
|
+
const cliVersion = await getCliVersion();
|
|
30
|
+
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
|
|
31
|
+
const info = `
|
|
32
|
+
* **CLI Version:** ${cliVersion}
|
|
33
|
+
* **Git Commit:** ${GIT_COMMIT_INFO}
|
|
34
|
+
* **Operating System:** ${osVersion}
|
|
35
|
+
* **Sandbox Environment:** ${sandboxEnv}
|
|
36
|
+
* **Model Version:** ${modelVersion}
|
|
37
|
+
* **Memory Usage:** ${memoryUsage}
|
|
38
|
+
`;
|
|
39
|
+
let bugReportUrl = 'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title={title}&info={info}';
|
|
40
|
+
const bugCommandSettings = config?.getBugCommand();
|
|
41
|
+
if (bugCommandSettings?.urlTemplate) {
|
|
42
|
+
bugReportUrl = bugCommandSettings.urlTemplate;
|
|
43
|
+
}
|
|
44
|
+
bugReportUrl = bugReportUrl
|
|
45
|
+
.replace('{title}', encodeURIComponent(bugDescription))
|
|
46
|
+
.replace('{info}', encodeURIComponent(info));
|
|
47
|
+
context.ui.addItem({
|
|
48
|
+
type: MessageType.INFO,
|
|
49
|
+
text: `To submit your bug report, please open the following URL in your browser:\n${bugReportUrl}`,
|
|
50
|
+
}, Date.now());
|
|
51
|
+
try {
|
|
52
|
+
await open(bugReportUrl);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
56
|
+
context.ui.addItem({
|
|
57
|
+
type: MessageType.ERROR,
|
|
58
|
+
text: `Could not open URL in browser: ${errorMessage}`,
|
|
59
|
+
}, Date.now());
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=bugCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bugCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/bugCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAGL,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,CAAC,MAAM,UAAU,GAAiB;IACtC,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,qBAAqB;IAClC,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,KAAK,EAAE,OAAuB,EAAE,IAAa,EAAiB,EAAE;QACtE,MAAM,cAAc,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEpC,MAAM,SAAS,GAAG,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3D,IAAI,UAAU,GAAG,YAAY,CAAC;QAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAA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,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO,CAAC,EAAE,CAAC,OAAO,CAChB;gBACE,IAAI,EAAE,WAAW,CAAC,KAAK;gBACvB,IAAI,EAAE,kCAAkC,YAAY,EAAE;aACvD,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import * as fsPromises from 'fs/promises';
|
|
7
|
+
import { CommandKind, } from './types.js';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { MessageType } from '../types.js';
|
|
10
|
+
const getSavedChatTags = async (context, mtSortDesc) => {
|
|
11
|
+
const geminiDir = context.services.config?.getProjectTempDir();
|
|
12
|
+
if (!geminiDir) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const file_head = 'checkpoint-';
|
|
17
|
+
const file_tail = '.json';
|
|
18
|
+
const files = await fsPromises.readdir(geminiDir);
|
|
19
|
+
const chatDetails = [];
|
|
20
|
+
for (const file of files) {
|
|
21
|
+
if (file.startsWith(file_head) && file.endsWith(file_tail)) {
|
|
22
|
+
const filePath = path.join(geminiDir, file);
|
|
23
|
+
const stats = await fsPromises.stat(filePath);
|
|
24
|
+
chatDetails.push({
|
|
25
|
+
name: file.slice(file_head.length, -file_tail.length),
|
|
26
|
+
mtime: stats.mtime,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
chatDetails.sort((a, b) => mtSortDesc
|
|
31
|
+
? b.mtime.getTime() - a.mtime.getTime()
|
|
32
|
+
: a.mtime.getTime() - b.mtime.getTime());
|
|
33
|
+
return chatDetails;
|
|
34
|
+
}
|
|
35
|
+
catch (_err) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const listCommand = {
|
|
40
|
+
name: 'list',
|
|
41
|
+
description: 'List saved conversation checkpoints',
|
|
42
|
+
kind: CommandKind.BUILT_IN,
|
|
43
|
+
action: async (context) => {
|
|
44
|
+
const chatDetails = await getSavedChatTags(context, false);
|
|
45
|
+
if (chatDetails.length === 0) {
|
|
46
|
+
return {
|
|
47
|
+
type: 'message',
|
|
48
|
+
messageType: 'info',
|
|
49
|
+
content: 'No saved conversation checkpoints found.',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
let message = 'List of saved conversations:\n\n';
|
|
53
|
+
for (const chat of chatDetails) {
|
|
54
|
+
message += ` - \u001b[36m${chat.name}\u001b[0m\n`;
|
|
55
|
+
}
|
|
56
|
+
message += `\n\u001b[90mNote: Newest last, oldest first\u001b[0m`;
|
|
57
|
+
return {
|
|
58
|
+
type: 'message',
|
|
59
|
+
messageType: 'info',
|
|
60
|
+
content: message,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const saveCommand = {
|
|
65
|
+
name: 'save',
|
|
66
|
+
description: 'Save the current conversation as a checkpoint. Usage: /chat save <tag>',
|
|
67
|
+
kind: CommandKind.BUILT_IN,
|
|
68
|
+
action: async (context, args) => {
|
|
69
|
+
const tag = args.trim();
|
|
70
|
+
if (!tag) {
|
|
71
|
+
return {
|
|
72
|
+
type: 'message',
|
|
73
|
+
messageType: 'error',
|
|
74
|
+
content: 'Missing tag. Usage: /chat save <tag>',
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const { logger, config } = context.services;
|
|
78
|
+
await logger.initialize();
|
|
79
|
+
const chat = await config?.getGeminiClient()?.getChat();
|
|
80
|
+
if (!chat) {
|
|
81
|
+
return {
|
|
82
|
+
type: 'message',
|
|
83
|
+
messageType: 'error',
|
|
84
|
+
content: 'No chat client available to save conversation.',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const history = chat.getHistory();
|
|
88
|
+
if (history.length > 0) {
|
|
89
|
+
await logger.saveCheckpoint(history, tag);
|
|
90
|
+
return {
|
|
91
|
+
type: 'message',
|
|
92
|
+
messageType: 'info',
|
|
93
|
+
content: `Conversation checkpoint saved with tag: ${tag}.`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return {
|
|
98
|
+
type: 'message',
|
|
99
|
+
messageType: 'info',
|
|
100
|
+
content: 'No conversation found to save.',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
const resumeCommand = {
|
|
106
|
+
name: 'resume',
|
|
107
|
+
altNames: ['load'],
|
|
108
|
+
description: 'Resume a conversation from a checkpoint. Usage: /chat resume <tag>',
|
|
109
|
+
kind: CommandKind.BUILT_IN,
|
|
110
|
+
action: async (context, args) => {
|
|
111
|
+
const tag = args.trim();
|
|
112
|
+
if (!tag) {
|
|
113
|
+
return {
|
|
114
|
+
type: 'message',
|
|
115
|
+
messageType: 'error',
|
|
116
|
+
content: 'Missing tag. Usage: /chat resume <tag>',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const { logger } = context.services;
|
|
120
|
+
await logger.initialize();
|
|
121
|
+
const conversation = await logger.loadCheckpoint(tag);
|
|
122
|
+
if (conversation.length === 0) {
|
|
123
|
+
return {
|
|
124
|
+
type: 'message',
|
|
125
|
+
messageType: 'info',
|
|
126
|
+
content: `No saved checkpoint found with tag: ${tag}.`,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
const rolemap = {
|
|
130
|
+
user: MessageType.USER,
|
|
131
|
+
model: MessageType.GEMINI,
|
|
132
|
+
};
|
|
133
|
+
const uiHistory = [];
|
|
134
|
+
let hasSystemPrompt = false;
|
|
135
|
+
let i = 0;
|
|
136
|
+
for (const item of conversation) {
|
|
137
|
+
i += 1;
|
|
138
|
+
const text = item.parts
|
|
139
|
+
?.filter((m) => !!m.text)
|
|
140
|
+
.map((m) => m.text)
|
|
141
|
+
.join('') || '';
|
|
142
|
+
if (!text) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (i === 1 && text.match(/context for our chat/)) {
|
|
146
|
+
hasSystemPrompt = true;
|
|
147
|
+
}
|
|
148
|
+
if (i > 2 || !hasSystemPrompt) {
|
|
149
|
+
uiHistory.push({
|
|
150
|
+
type: (item.role && rolemap[item.role]) || MessageType.GEMINI,
|
|
151
|
+
text,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
type: 'load_history',
|
|
157
|
+
history: uiHistory,
|
|
158
|
+
clientHistory: conversation,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
completion: async (context, partialArg) => {
|
|
162
|
+
const chatDetails = await getSavedChatTags(context, true);
|
|
163
|
+
return chatDetails
|
|
164
|
+
.map((chat) => chat.name)
|
|
165
|
+
.filter((name) => name.startsWith(partialArg));
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
export const chatCommand = {
|
|
169
|
+
name: 'chat',
|
|
170
|
+
description: 'Manage conversation history.',
|
|
171
|
+
kind: CommandKind.BUILT_IN,
|
|
172
|
+
subCommands: [listCommand, saveCommand, resumeCommand],
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=chatCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/chatCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,EAIL,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAC;AAOhE,MAAM,gBAAgB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BACmB,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QACD,OAAO;YACL,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,SAAS;YAClB,aAAa,EAAE,YAAY;SAC5B,CAAC;IACJ,CAAC;IACD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE;QACxC,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,WAAW;aACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;aACxB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACnD,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,8BAA8B;IAC3C,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,WAAW,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC;CACvD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { uiTelemetryService } from '@google/gemini-cli-core';
|
|
7
|
+
import { CommandKind } from './types.js';
|
|
8
|
+
export const clearCommand = {
|
|
9
|
+
name: 'clear',
|
|
10
|
+
description: 'clear the screen and conversation history',
|
|
11
|
+
kind: CommandKind.BUILT_IN,
|
|
12
|
+
action: async (context, _args) => {
|
|
13
|
+
const geminiClient = context.services.config?.getGeminiClient();
|
|
14
|
+
if (geminiClient) {
|
|
15
|
+
context.ui.setDebugMessage('Clearing terminal and resetting chat.');
|
|
16
|
+
// If resetChat fails, the exception will propagate and halt the command,
|
|
17
|
+
// which is the correct behavior to signal a failure to the user.
|
|
18
|
+
await geminiClient.resetChat();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
context.ui.setDebugMessage('Clearing terminal.');
|
|
22
|
+
}
|
|
23
|
+
uiTelemetryService.resetLastPromptTokenCount();
|
|
24
|
+
context.ui.clear();
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=clearCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/clearCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,2CAA2C;IACxD,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC;QAEhE,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC,uCAAuC,CAAC,CAAC;YACpE,yEAAyE;YACzE,iEAAiE;YACjE,MAAM,YAAY,CAAC,SAAS,EAAE,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;QACnD,CAAC;QAED,kBAAkB,CAAC,yBAAyB,EAAE,CAAC;QAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { MessageType } from '../types.js';
|
|
7
|
+
import { CommandKind } from './types.js';
|
|
8
|
+
export const compressCommand = {
|
|
9
|
+
name: 'compress',
|
|
10
|
+
altNames: ['summarize'],
|
|
11
|
+
description: 'Compresses the context by replacing it with a summary.',
|
|
12
|
+
kind: CommandKind.BUILT_IN,
|
|
13
|
+
action: async (context) => {
|
|
14
|
+
const { ui } = context;
|
|
15
|
+
if (ui.pendingItem) {
|
|
16
|
+
ui.addItem({
|
|
17
|
+
type: MessageType.ERROR,
|
|
18
|
+
text: 'Already compressing, wait for previous request to complete',
|
|
19
|
+
}, Date.now());
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const pendingMessage = {
|
|
23
|
+
type: MessageType.COMPRESSION,
|
|
24
|
+
compression: {
|
|
25
|
+
isPending: true,
|
|
26
|
+
originalTokenCount: null,
|
|
27
|
+
newTokenCount: null,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
ui.setPendingItem(pendingMessage);
|
|
32
|
+
const promptId = `compress-${Date.now()}`;
|
|
33
|
+
const compressed = await context.services.config
|
|
34
|
+
?.getGeminiClient()
|
|
35
|
+
?.tryCompressChat(promptId, true);
|
|
36
|
+
if (compressed) {
|
|
37
|
+
ui.addItem({
|
|
38
|
+
type: MessageType.COMPRESSION,
|
|
39
|
+
compression: {
|
|
40
|
+
isPending: false,
|
|
41
|
+
originalTokenCount: compressed.originalTokenCount,
|
|
42
|
+
newTokenCount: compressed.newTokenCount,
|
|
43
|
+
},
|
|
44
|
+
}, Date.now());
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
ui.addItem({
|
|
48
|
+
type: MessageType.ERROR,
|
|
49
|
+
text: 'Failed to compress chat history.',
|
|
50
|
+
}, Date.now());
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
ui.addItem({
|
|
55
|
+
type: MessageType.ERROR,
|
|
56
|
+
text: `Failed to compress chat history: ${e instanceof Error ? e.message : String(e)}`,
|
|
57
|
+
}, Date.now());
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
ui.setPendingItem(null);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=compressCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compressCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/compressCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA0B,WAAW,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC3C,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,WAAW,EAAE,wDAAwD;IACrE,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACnB,EAAE,CAAC,OAAO,CACR;gBACE,IAAI,EAAE,WAAW,CAAC,KAAK;gBACvB,IAAI,EAAE,4DAA4D;aACnE,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,cAAc,GAA2B;YAC7C,IAAI,EAAE,WAAW,CAAC,WAAW;YAC7B,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI;gBACf,kBAAkB,EAAE,IAAI;gBACxB,aAAa,EAAE,IAAI;aACpB;SACF,CAAC;QAEF,IAAI,CAAC;YACH,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;YAClC,MAAM,QAAQ,GAAG,YAAY,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YAC1C,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAC9C,EAAE,eAAe,EAAE;gBACnB,EAAE,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACpC,IAAI,UAAU,EAAE,CAAC;gBACf,EAAE,CAAC,OAAO,CACR;oBACE,IAAI,EAAE,WAAW,CAAC,WAAW;oBAC7B,WAAW,EAAE;wBACX,SAAS,EAAE,KAAK;wBAChB,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;wBACjD,aAAa,EAAE,UAAU,CAAC,aAAa;qBACxC;iBACwB,EAC3B,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,EAAE,CAAC,OAAO,CACR;oBACE,IAAI,EAAE,WAAW,CAAC,KAAK;oBACvB,IAAI,EAAE,kCAAkC;iBACzC,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,EAAE,CAAC,OAAO,CACR;gBACE,IAAI,EAAE,WAAW,CAAC,KAAK;gBACvB,IAAI,EAAE,oCACJ,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAC3C,EAAE;aACH,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { copyToClipboard } from '../utils/commandUtils.js';
|
|
7
|
+
import { CommandKind, } from './types.js';
|
|
8
|
+
export const copyCommand = {
|
|
9
|
+
name: 'copy',
|
|
10
|
+
description: 'Copy the last result or code snippet to clipboard',
|
|
11
|
+
kind: CommandKind.BUILT_IN,
|
|
12
|
+
action: async (context, _args) => {
|
|
13
|
+
const chat = await context.services.config?.getGeminiClient()?.getChat();
|
|
14
|
+
const history = chat?.getHistory();
|
|
15
|
+
// Get the last message from the AI (model role)
|
|
16
|
+
const lastAiMessage = history
|
|
17
|
+
? history.filter((item) => item.role === 'model').pop()
|
|
18
|
+
: undefined;
|
|
19
|
+
if (!lastAiMessage) {
|
|
20
|
+
return {
|
|
21
|
+
type: 'message',
|
|
22
|
+
messageType: 'info',
|
|
23
|
+
content: 'No output in history',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// Extract text from the parts
|
|
27
|
+
const lastAiOutput = lastAiMessage.parts
|
|
28
|
+
?.filter((part) => part.text)
|
|
29
|
+
.map((part) => part.text)
|
|
30
|
+
.join('');
|
|
31
|
+
if (lastAiOutput) {
|
|
32
|
+
try {
|
|
33
|
+
await copyToClipboard(lastAiOutput);
|
|
34
|
+
return {
|
|
35
|
+
type: 'message',
|
|
36
|
+
messageType: 'info',
|
|
37
|
+
content: 'Last output copied to the clipboard',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
42
|
+
console.debug(message);
|
|
43
|
+
return {
|
|
44
|
+
type: 'message',
|
|
45
|
+
messageType: 'error',
|
|
46
|
+
content: 'Failed to copy to the clipboard.',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return {
|
|
52
|
+
type: 'message',
|
|
53
|
+
messageType: 'info',
|
|
54
|
+
content: 'Last AI output contains no text to copy.',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=copyCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyCommand.js","s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AE,SAAS;oBACf,WAAW,EAAE,MAAM;oBACnB,OAAO,EAAE,qCAAqC;iBAC/C,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAEvB,OAAO;oBACL,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,OAAO;oBACpB,OAAO,EAAE,kCAAkC;iBAC5C,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,MAAM;gBACnB,OAAO,EAAE,0CAA0C;aACpD,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CommandKind } from './types.js';
|
|
7
|
+
export const corgiCommand = {
|
|
8
|
+
name: 'corgi',
|
|
9
|
+
description: 'Toggles corgi mode.',
|
|
10
|
+
kind: CommandKind.BUILT_IN,
|
|
11
|
+
action: (context, _args) => {
|
|
12
|
+
context.ui.toggleCorgiMode();
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=corgiCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corgiCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/corgiCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAqB,MAAM,YAAY,CAAC;AAE5D,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,qBAAqB;IAClC,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACzB,OAAO,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import open from 'open';
|
|
7
|
+
import process from 'node:process';
|
|
8
|
+
import { CommandKind, } from './types.js';
|
|
9
|
+
import { MessageType } from '../types.js';
|
|
10
|
+
export const docsCommand = {
|
|
11
|
+
name: 'docs',
|
|
12
|
+
description: 'open full Gemini CLI documentation in your browser',
|
|
13
|
+
kind: CommandKind.BUILT_IN,
|
|
14
|
+
action: async (context) => {
|
|
15
|
+
const docsUrl = 'https://goo.gle/gemini-cli-docs';
|
|
16
|
+
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
|
|
17
|
+
context.ui.addItem({
|
|
18
|
+
type: MessageType.INFO,
|
|
19
|
+
text: `Please open the following URL in your browser to view the documentation:\n${docsUrl}`,
|
|
20
|
+
}, Date.now());
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
context.ui.addItem({
|
|
24
|
+
type: MessageType.INFO,
|
|
25
|
+
text: `Opening documentation in your browser: ${docsUrl}`,
|
|
26
|
+
}, Date.now());
|
|
27
|
+
await open(docsUrl);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=docsCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docsCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/docsCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAGL,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,KAAK,EAAE,OAAuB,EAAiB,EAAE;QACvD,MAAM,OAAO,GAAG,iCAAiC,CAAC;QAElD,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;YAClE,OAAO,CAAC,EAAE,CAAC,OAAO,CAChB;gBACE,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,IAAI,EAAE,6EAA6E,OAAO,EAAE;aAC7F,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,EAAE,CAAC,OAAO,CAChB;gBACE,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,IAAI,EAAE,0CAA0C,OAAO,EAAE;aAC1D,EACD,IAAI,CAAC,GAAG,EAAE,CACX,CAAC;YACF,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CommandKind, } from './types.js';
|
|
7
|
+
export const editorCommand = {
|
|
8
|
+
name: 'editor',
|
|
9
|
+
description: 'set external editor preference',
|
|
10
|
+
kind: CommandKind.BUILT_IN,
|
|
11
|
+
action: () => ({
|
|
12
|
+
type: 'dialog',
|
|
13
|
+
dialog: 'editor',
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=editorCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/editorCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,WAAW,GAGZ,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,gCAAgC;IAC7C,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,GAA2B,EAAE,CAAC,CAAC;QACrC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,QAAQ;KACjB,CAAC;CACH,CAAC"}
|