@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,212 @@
|
|
|
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 crypto from 'crypto';
|
|
5
|
+
import { colorizeCode } from '../../utils/CodeColorizer.js';
|
|
6
|
+
import { MaxSizedBox } from '../shared/MaxSizedBox.js';
|
|
7
|
+
function parseDiffWithLineNumbers(diffContent) {
|
|
8
|
+
const lines = diffContent.split('\n');
|
|
9
|
+
const result = [];
|
|
10
|
+
let currentOldLine = 0;
|
|
11
|
+
let currentNewLine = 0;
|
|
12
|
+
let inHunk = false;
|
|
13
|
+
const hunkHeaderRegex = /^@@ -(\d+),?\d* \+(\d+),?\d* @@/;
|
|
14
|
+
for (const line of lines) {
|
|
15
|
+
const hunkMatch = line.match(hunkHeaderRegex);
|
|
16
|
+
if (hunkMatch) {
|
|
17
|
+
currentOldLine = parseInt(hunkMatch[1], 10);
|
|
18
|
+
currentNewLine = parseInt(hunkMatch[2], 10);
|
|
19
|
+
inHunk = true;
|
|
20
|
+
result.push({ type: 'hunk', content: line });
|
|
21
|
+
// We need to adjust the starting point because the first line number applies to the *first* actual line change/context,
|
|
22
|
+
// but we increment *before* pushing that line. So decrement here.
|
|
23
|
+
currentOldLine--;
|
|
24
|
+
currentNewLine--;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (!inHunk) {
|
|
28
|
+
// Skip standard Git header lines more robustly
|
|
29
|
+
if (line.startsWith('--- ') ||
|
|
30
|
+
line.startsWith('+++ ') ||
|
|
31
|
+
line.startsWith('diff --git') ||
|
|
32
|
+
line.startsWith('index ') ||
|
|
33
|
+
line.startsWith('similarity index') ||
|
|
34
|
+
line.startsWith('rename from') ||
|
|
35
|
+
line.startsWith('rename to') ||
|
|
36
|
+
line.startsWith('new file mode') ||
|
|
37
|
+
line.startsWith('deleted file mode'))
|
|
38
|
+
continue;
|
|
39
|
+
// If it's not a hunk or header, skip (or handle as 'other' if needed)
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (line.startsWith('+')) {
|
|
43
|
+
currentNewLine++; // Increment before pushing
|
|
44
|
+
result.push({
|
|
45
|
+
type: 'add',
|
|
46
|
+
newLine: currentNewLine,
|
|
47
|
+
content: line.substring(1),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else if (line.startsWith('-')) {
|
|
51
|
+
currentOldLine++; // Increment before pushing
|
|
52
|
+
result.push({
|
|
53
|
+
type: 'del',
|
|
54
|
+
oldLine: currentOldLine,
|
|
55
|
+
content: line.substring(1),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else if (line.startsWith(' ')) {
|
|
59
|
+
currentOldLine++; // Increment before pushing
|
|
60
|
+
currentNewLine++;
|
|
61
|
+
result.push({
|
|
62
|
+
type: 'context',
|
|
63
|
+
oldLine: currentOldLine,
|
|
64
|
+
newLine: currentNewLine,
|
|
65
|
+
content: line.substring(1),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else if (line.startsWith('\\')) {
|
|
69
|
+
// Handle ""
|
|
70
|
+
result.push({ type: 'other', content: line });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
const DEFAULT_TAB_WIDTH = 4; // Spaces per tab for normalization
|
|
76
|
+
export const DiffRenderer = ({ diffContent, filename, tabWidth = DEFAULT_TAB_WIDTH, availableTerminalHeight, terminalWidth, theme, }) => {
|
|
77
|
+
if (!diffContent || typeof diffContent !== 'string') {
|
|
78
|
+
return _jsx(Text, { color: Colors.AccentYellow, children: "No diff content." });
|
|
79
|
+
}
|
|
80
|
+
const parsedLines = parseDiffWithLineNumbers(diffContent);
|
|
81
|
+
if (parsedLines.length === 0) {
|
|
82
|
+
return (_jsx(Box, { borderStyle: "round", borderColor: Colors.Gray, padding: 1, children: _jsx(Text, { dimColor: true, children: "No changes detected." }) }));
|
|
83
|
+
}
|
|
84
|
+
// Check if the diff represents a new file (only additions and header lines)
|
|
85
|
+
const isNewFile = parsedLines.every((line) => line.type === 'add' ||
|
|
86
|
+
line.type === 'hunk' ||
|
|
87
|
+
line.type === 'other' ||
|
|
88
|
+
line.content.startsWith('diff --git') ||
|
|
89
|
+
line.content.startsWith('new file mode'));
|
|
90
|
+
let renderedOutput;
|
|
91
|
+
if (isNewFile) {
|
|
92
|
+
// Extract only the added lines' content
|
|
93
|
+
const addedContent = parsedLines
|
|
94
|
+
.filter((line) => line.type === 'add')
|
|
95
|
+
.map((line) => line.content)
|
|
96
|
+
.join('\n');
|
|
97
|
+
// Attempt to infer language from filename, default to plain text if no filename
|
|
98
|
+
const fileExtension = filename?.split('.').pop() || null;
|
|
99
|
+
const language = fileExtension
|
|
100
|
+
? getLanguageFromExtension(fileExtension)
|
|
101
|
+
: null;
|
|
102
|
+
renderedOutput = colorizeCode(addedContent, language, availableTerminalHeight, terminalWidth, theme);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
renderedOutput = renderDiffContent(parsedLines, filename, tabWidth, availableTerminalHeight, terminalWidth, theme);
|
|
106
|
+
}
|
|
107
|
+
return renderedOutput;
|
|
108
|
+
};
|
|
109
|
+
const renderDiffContent = (parsedLines, filename, tabWidth = DEFAULT_TAB_WIDTH, availableTerminalHeight, terminalWidth, theme) => {
|
|
110
|
+
// 1. Normalize whitespace (replace tabs with spaces) *before* further processing
|
|
111
|
+
const normalizedLines = parsedLines.map((line) => ({
|
|
112
|
+
...line,
|
|
113
|
+
content: line.content.replace(/\t/g, ' '.repeat(tabWidth)),
|
|
114
|
+
}));
|
|
115
|
+
// Filter out non-displayable lines (hunks, potentially 'other') using the normalized list
|
|
116
|
+
const displayableLines = normalizedLines.filter((l) => l.type !== 'hunk' && l.type !== 'other');
|
|
117
|
+
if (displayableLines.length === 0) {
|
|
118
|
+
return (_jsx(Box, { borderStyle: "round", borderColor: Colors.Gray, padding: 1, children: _jsx(Text, { dimColor: true, children: "No changes detected." }) }));
|
|
119
|
+
}
|
|
120
|
+
// Calculate the minimum indentation across all displayable lines
|
|
121
|
+
let baseIndentation = Infinity; // Start high to find the minimum
|
|
122
|
+
for (const line of displayableLines) {
|
|
123
|
+
// Only consider lines with actual content for indentation calculation
|
|
124
|
+
if (line.content.trim() === '')
|
|
125
|
+
continue;
|
|
126
|
+
const firstCharIndex = line.content.search(/\S/); // Find index of first non-whitespace char
|
|
127
|
+
const currentIndent = firstCharIndex === -1 ? 0 : firstCharIndex; // Indent is 0 if no non-whitespace found
|
|
128
|
+
baseIndentation = Math.min(baseIndentation, currentIndent);
|
|
129
|
+
}
|
|
130
|
+
// If baseIndentation remained Infinity (e.g., no displayable lines with content), default to 0
|
|
131
|
+
if (!isFinite(baseIndentation)) {
|
|
132
|
+
baseIndentation = 0;
|
|
133
|
+
}
|
|
134
|
+
const key = filename
|
|
135
|
+
? `diff-box-${filename}`
|
|
136
|
+
: `diff-box-${crypto.createHash('sha1').update(JSON.stringify(parsedLines)).digest('hex')}`;
|
|
137
|
+
let lastLineNumber = null;
|
|
138
|
+
const MAX_CONTEXT_LINES_WITHOUT_GAP = 5;
|
|
139
|
+
return (_jsx(MaxSizedBox, { maxHeight: availableTerminalHeight, maxWidth: terminalWidth, children: displayableLines.reduce((acc, line, index) => {
|
|
140
|
+
// Determine the relevant line number for gap calculation based on type
|
|
141
|
+
let relevantLineNumberForGapCalc = null;
|
|
142
|
+
if (line.type === 'add' || line.type === 'context') {
|
|
143
|
+
relevantLineNumberForGapCalc = line.newLine ?? null;
|
|
144
|
+
}
|
|
145
|
+
else if (line.type === 'del') {
|
|
146
|
+
// For deletions, the gap is typically in relation to the original file's line numbering
|
|
147
|
+
relevantLineNumberForGapCalc = line.oldLine ?? null;
|
|
148
|
+
}
|
|
149
|
+
if (lastLineNumber !== null &&
|
|
150
|
+
relevantLineNumberForGapCalc !== null &&
|
|
151
|
+
relevantLineNumberForGapCalc >
|
|
152
|
+
lastLineNumber + MAX_CONTEXT_LINES_WITHOUT_GAP + 1) {
|
|
153
|
+
acc.push(_jsx(Box, { children: _jsx(Text, { wrap: "truncate", children: '═'.repeat(terminalWidth) }) }, `gap-${index}`));
|
|
154
|
+
}
|
|
155
|
+
const lineKey = `diff-line-${index}`;
|
|
156
|
+
let gutterNumStr = '';
|
|
157
|
+
let color = undefined;
|
|
158
|
+
let prefixSymbol = ' ';
|
|
159
|
+
let dim = false;
|
|
160
|
+
switch (line.type) {
|
|
161
|
+
case 'add':
|
|
162
|
+
gutterNumStr = (line.newLine ?? '').toString();
|
|
163
|
+
color = theme?.colors?.AccentGreen || 'green';
|
|
164
|
+
prefixSymbol = '+';
|
|
165
|
+
lastLineNumber = line.newLine ?? null;
|
|
166
|
+
break;
|
|
167
|
+
case 'del':
|
|
168
|
+
gutterNumStr = (line.oldLine ?? '').toString();
|
|
169
|
+
color = theme?.colors?.AccentRed || 'red';
|
|
170
|
+
prefixSymbol = '-';
|
|
171
|
+
// For deletions, update lastLineNumber based on oldLine if it's advancing.
|
|
172
|
+
// This helps manage gaps correctly if there are multiple consecutive deletions
|
|
173
|
+
// or if a deletion is followed by a context line far away in the original file.
|
|
174
|
+
if (line.oldLine !== undefined) {
|
|
175
|
+
lastLineNumber = line.oldLine;
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
case 'context':
|
|
179
|
+
gutterNumStr = (line.newLine ?? '').toString();
|
|
180
|
+
dim = true;
|
|
181
|
+
prefixSymbol = ' ';
|
|
182
|
+
lastLineNumber = line.newLine ?? null;
|
|
183
|
+
break;
|
|
184
|
+
default:
|
|
185
|
+
return acc;
|
|
186
|
+
}
|
|
187
|
+
const displayContent = line.content.substring(baseIndentation);
|
|
188
|
+
acc.push(_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: Colors.Gray, children: [gutterNumStr.padEnd(4), " "] }), _jsxs(Text, { color: color, dimColor: dim, children: [prefixSymbol, ' '] }), _jsx(Text, { color: color, dimColor: dim, wrap: "wrap", children: displayContent })] }, lineKey));
|
|
189
|
+
return acc;
|
|
190
|
+
}, []) }, key));
|
|
191
|
+
};
|
|
192
|
+
const getLanguageFromExtension = (extension) => {
|
|
193
|
+
const languageMap = {
|
|
194
|
+
js: 'javascript',
|
|
195
|
+
ts: 'typescript',
|
|
196
|
+
py: 'python',
|
|
197
|
+
json: 'json',
|
|
198
|
+
css: 'css',
|
|
199
|
+
html: 'html',
|
|
200
|
+
sh: 'bash',
|
|
201
|
+
md: 'markdown',
|
|
202
|
+
yaml: 'yaml',
|
|
203
|
+
yml: 'yaml',
|
|
204
|
+
txt: 'plaintext',
|
|
205
|
+
java: 'java',
|
|
206
|
+
c: 'c',
|
|
207
|
+
cpp: 'cpp',
|
|
208
|
+
rb: 'ruby',
|
|
209
|
+
};
|
|
210
|
+
return languageMap[extension] || null; // Return null if extension not found
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=DiffRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffRenderer.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/DiffRenderer.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASvD,SAAS,wBAAwB,CAAC,WAAmB;IACnD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,MAAM,eAAe,GAAG,iCAAiC,CAAC;IAE1D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC9C,IAAI,SAAS,EAAE,CAAC;YACd,cAAc,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,cAAc,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,MAAM,GAAG,IAAI,CAAC;YACd,M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AAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,aAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC1D,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,aAC9B,YAAY,EAAE,GAAG,IACb,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,YAC3C,cAAc,GACV,KAPC,OAAO,CAQX,CACP,CAAC;YACF,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,IAzED,GAAG,CA0EI,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,SAAiB,EAAiB,EAAE;IACpE,MAAM,WAAW,GAA8B;QAC7C,EAAE,EAAE,YAAY;QAChB,EAAE,EAAE,YAAY;QAChB,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,WAAW;QAChB,IAAI,EAAE,MAAM;QACZ,CAAC,EAAE,GAAG;QACN,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,MAAM;KACX,CAAC;IACF,OAAO,WAAW,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,CAAC,qCAAqC;AAC9E,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import { Colors } from '../../colors.js';
|
|
4
|
+
export const ErrorMessage = ({ text }) => {
|
|
5
|
+
const prefix = '✕ ';
|
|
6
|
+
const prefixWidth = prefix.length;
|
|
7
|
+
return (_jsxs(Box, { flexDirection: "row", marginBottom: 1, children: [_jsx(Box, { width: prefixWidth, children: _jsx(Text, { color: Colors.AccentRed, children: prefix }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { wrap: "wrap", color: Colors.AccentRed, children: text }) })] }));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=ErrorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ErrorMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAMzC,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACpE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAElC,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,YAAY,EAAE,CAAC,aACtC,KAAC,GAAG,IAAC,KAAK,EAAE,WAAW,YACrB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,YAAG,MAAM,GAAQ,GAC1C,EACN,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,MAAM,CAAC,SAAS,YACtC,IAAI,GACA,GACH,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
interface GeminiMessageProps {
|
|
8
|
+
text: string;
|
|
9
|
+
isPending: boolean;
|
|
10
|
+
availableTerminalHeight?: number;
|
|
11
|
+
terminalWidth: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const GeminiMessage: React.FC<GeminiMessageProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js';
|
|
4
|
+
import { Colors } from '../../colors.js';
|
|
5
|
+
export const GeminiMessage = ({ text, isPending, availableTerminalHeight, terminalWidth, }) => {
|
|
6
|
+
const prefix = '✦ ';
|
|
7
|
+
const prefixWidth = prefix.length;
|
|
8
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: prefixWidth, children: _jsx(Text, { color: Colors.AccentPurple, children: prefix }) }), _jsx(Box, { flexGrow: 1, flexDirection: "column", children: _jsx(MarkdownDisplay, { text: text, isPending: isPending, availableTerminalHeight: availableTerminalHeight, terminalWidth: terminalWidth }) })] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=GeminiMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeminiMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/GeminiMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AASzC,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,aAAa,GACd,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAElC,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,aACtB,KAAC,GAAG,IAAC,KAAK,EAAE,WAAW,YACrB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,YAAY,YAAG,MAAM,GAAQ,GAC7C,EACN,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,YACtC,KAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,uBAAuB,EAChD,aAAa,EAAE,aAAa,GAC5B,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
interface GeminiMessageContentProps {
|
|
8
|
+
text: string;
|
|
9
|
+
isPending: boolean;
|
|
10
|
+
availableTerminalHeight?: number;
|
|
11
|
+
terminalWidth: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const GeminiMessageContent: React.FC<GeminiMessageContentProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js';
|
|
4
|
+
/*
|
|
5
|
+
* Gemini message content is a semi-hacked component. The intention is to represent a partial
|
|
6
|
+
* of GeminiMessage and is only used when a response gets too long. In that instance messages
|
|
7
|
+
* are split into multiple GeminiMessageContent's to enable the root <Static> component in
|
|
8
|
+
* App.tsx to be as performant as humanly possible.
|
|
9
|
+
*/
|
|
10
|
+
export const GeminiMessageContent = ({ text, isPending, availableTerminalHeight, terminalWidth, }) => {
|
|
11
|
+
const originalPrefix = '✦ ';
|
|
12
|
+
const prefixWidth = originalPrefix.length;
|
|
13
|
+
return (_jsx(Box, { flexDirection: "column", paddingLeft: prefixWidth, children: _jsx(MarkdownDisplay, { text: text, isPending: isPending, availableTerminalHeight: availableTerminalHeight, terminalWidth: terminalWidth }) }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=GeminiMessageContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeminiMessageContent.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/GeminiMessageContent.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AASjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,EACxE,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,aAAa,GACd,EAAE,EAAE;IACH,MAAM,cAAc,GAAG,IAAI,CAAC;IAC5B,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC;IAE1C,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,WAAW,YAClD,KAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,uBAAuB,EAChD,aAAa,EAAE,aAAa,GAC5B,GACE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import { Colors } from '../../colors.js';
|
|
4
|
+
export const InfoMessage = ({ text }) => {
|
|
5
|
+
const prefix = 'ℹ ';
|
|
6
|
+
const prefixWidth = prefix.length;
|
|
7
|
+
return (_jsxs(Box, { flexDirection: "row", marginTop: 1, children: [_jsx(Box, { width: prefixWidth, children: _jsx(Text, { color: Colors.AccentYellow, children: prefix }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { wrap: "wrap", color: Colors.AccentYellow, children: text }) })] }));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=InfoMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/InfoMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAMzC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAElC,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,SAAS,EAAE,CAAC,aACnC,KAAC,GAAG,IAAC,KAAK,EAAE,WAAW,YACrB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,YAAY,YAAG,MAAM,GAAQ,GAC7C,EACN,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,MAAM,CAAC,YAAY,YACzC,IAAI,GACA,GACH,IACF,CACP,CAAC;AACJ,CAAC,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 { ToolCallConfirmationDetails, Config } from '@google/gemini-cli-core';
|
|
8
|
+
export interface ToolConfirmationMessageProps {
|
|
9
|
+
confirmationDetails: ToolCallConfirmationDetails;
|
|
10
|
+
config?: Config;
|
|
11
|
+
isFocused?: boolean;
|
|
12
|
+
availableTerminalHeight?: number;
|
|
13
|
+
terminalWidth: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const ToolConfirmationMessage: React.FC<ToolConfirmationMessageProps>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import { DiffRenderer } from './DiffRenderer.js';
|
|
4
|
+
import { Colors } from '../../colors.js';
|
|
5
|
+
import { ToolConfirmationOutcome, } from '@google/gemini-cli-core';
|
|
6
|
+
import { RadioButtonSelect, } from '../shared/RadioButtonSelect.js';
|
|
7
|
+
import { MaxSizedBox } from '../shared/MaxSizedBox.js';
|
|
8
|
+
export const ToolConfirmationMessage = ({ confirmationDetails, isFocused = true, availableTerminalHeight, terminalWidth, }) => {
|
|
9
|
+
const { onConfirm } = confirmationDetails;
|
|
10
|
+
const childWidth = terminalWidth - 2; // 2 for padding
|
|
11
|
+
useInput((_, key) => {
|
|
12
|
+
if (!isFocused)
|
|
13
|
+
return;
|
|
14
|
+
if (key.escape) {
|
|
15
|
+
onConfirm(ToolConfirmationOutcome.Cancel);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const handleSelect = (item) => onConfirm(item);
|
|
19
|
+
let bodyContent = null; // Removed contextDisplay here
|
|
20
|
+
let question;
|
|
21
|
+
const options = new Array();
|
|
22
|
+
// Body content is now the DiffRenderer, passing filename to it
|
|
23
|
+
// The bordered box is removed from here and handled within DiffRenderer
|
|
24
|
+
function availableBodyContentHeight() {
|
|
25
|
+
if (options.length === 0) {
|
|
26
|
+
// This should not happen in practice as options are always added before this is called.
|
|
27
|
+
throw new Error('Options not provided for confirmation message');
|
|
28
|
+
}
|
|
29
|
+
if (availableTerminalHeight === undefined) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
// Calculate the vertical space (in lines) consumed by UI elements
|
|
33
|
+
// surrounding the main body content.
|
|
34
|
+
const PADDING_OUTER_Y = 2; // Main container has `padding={1}` (top & bottom).
|
|
35
|
+
const MARGIN_BODY_BOTTOM = 1; // margin on the body container.
|
|
36
|
+
const HEIGHT_QUESTION = 1; // The question text is one line.
|
|
37
|
+
const MARGIN_QUESTION_BOTTOM = 1; // Margin on the question container.
|
|
38
|
+
const HEIGHT_OPTIONS = options.length; // Each option in the radio select takes one line.
|
|
39
|
+
const surroundingElementsHeight = PADDING_OUTER_Y +
|
|
40
|
+
MARGIN_BODY_BOTTOM +
|
|
41
|
+
HEIGHT_QUESTION +
|
|
42
|
+
MARGIN_QUESTION_BOTTOM +
|
|
43
|
+
HEIGHT_OPTIONS;
|
|
44
|
+
return Math.max(availableTerminalHeight - surroundingElementsHeight, 1);
|
|
45
|
+
}
|
|
46
|
+
if (confirmationDetails.type === 'edit') {
|
|
47
|
+
if (confirmationDetails.isModifying) {
|
|
48
|
+
return (_jsxs(Box, { minWidth: "90%", borderStyle: "round", borderColor: Colors.Gray, justifyContent: "space-around", padding: 1, overflow: "hidden", children: [_jsx(Text, { children: "Modify in progress: " }), _jsx(Text, { color: Colors.AccentGreen, children: "Save and close external editor to continue" })] }));
|
|
49
|
+
}
|
|
50
|
+
question = `Apply this change?`;
|
|
51
|
+
options.push({
|
|
52
|
+
label: 'Yes, allow once',
|
|
53
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
54
|
+
}, {
|
|
55
|
+
label: 'Yes, allow always',
|
|
56
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
57
|
+
}, {
|
|
58
|
+
label: 'Modify with external editor',
|
|
59
|
+
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
60
|
+
}, { label: 'No (esc)', value: ToolConfirmationOutcome.Cancel });
|
|
61
|
+
bodyContent = (_jsx(DiffRenderer, { diffContent: confirmationDetails.fileDiff, filename: confirmationDetails.fileName, availableTerminalHeight: availableBodyContentHeight(), terminalWidth: childWidth }));
|
|
62
|
+
}
|
|
63
|
+
else if (confirmationDetails.type === 'exec') {
|
|
64
|
+
const executionProps = confirmationDetails;
|
|
65
|
+
question = `Allow execution?`;
|
|
66
|
+
options.push({
|
|
67
|
+
label: 'Yes, allow once',
|
|
68
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
69
|
+
}, {
|
|
70
|
+
label: `Yes, allow always "${executionProps.rootCommand} ..."`,
|
|
71
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
72
|
+
}, { label: 'No (esc)', value: ToolConfirmationOutcome.Cancel });
|
|
73
|
+
let bodyContentHeight = availableBodyContentHeight();
|
|
74
|
+
if (bodyContentHeight !== undefined) {
|
|
75
|
+
bodyContentHeight -= 2; // Account for padding;
|
|
76
|
+
}
|
|
77
|
+
bodyContent = (_jsx(Box, { flexDirection: "column", children: _jsx(Box, { paddingX: 1, marginLeft: 1, children: _jsx(MaxSizedBox, { maxHeight: bodyContentHeight, maxWidth: Math.max(childWidth - 4, 1), children: _jsx(Box, { children: _jsx(Text, { color: Colors.AccentCyan, children: executionProps.command }) }) }) }) }));
|
|
78
|
+
}
|
|
79
|
+
else if (confirmationDetails.type === 'info') {
|
|
80
|
+
const infoProps = confirmationDetails;
|
|
81
|
+
const displayUrls = infoProps.urls &&
|
|
82
|
+
!(infoProps.urls.length === 1 && infoProps.urls[0] === infoProps.prompt);
|
|
83
|
+
question = `Do you want to proceed?`;
|
|
84
|
+
options.push({
|
|
85
|
+
label: 'Yes, allow once',
|
|
86
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
87
|
+
}, {
|
|
88
|
+
label: 'Yes, allow always',
|
|
89
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
90
|
+
}, { label: 'No (esc)', value: ToolConfirmationOutcome.Cancel });
|
|
91
|
+
bodyContent = (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginLeft: 1, children: [_jsx(Text, { color: Colors.AccentCyan, children: infoProps.prompt }), displayUrls && infoProps.urls && infoProps.urls.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { children: "URLs to fetch:" }), infoProps.urls.map((url) => (_jsxs(Text, { children: [" - ", url] }, url)))] }))] }));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// mcp tool confirmation
|
|
95
|
+
const mcpProps = confirmationDetails;
|
|
96
|
+
bodyContent = (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginLeft: 1, children: [_jsxs(Text, { color: Colors.AccentCyan, children: ["MCP Server: ", mcpProps.serverName] }), _jsxs(Text, { color: Colors.AccentCyan, children: ["Tool: ", mcpProps.toolName] })] }));
|
|
97
|
+
question = `Allow execution of MCP tool "${mcpProps.toolName}" from server "${mcpProps.serverName}"?`;
|
|
98
|
+
options.push({
|
|
99
|
+
label: 'Yes, allow once',
|
|
100
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
101
|
+
}, {
|
|
102
|
+
label: `Yes, always allow tool "${mcpProps.toolName}" from server "${mcpProps.serverName}"`,
|
|
103
|
+
value: ToolConfirmationOutcome.ProceedAlwaysTool, // Cast until types are updated
|
|
104
|
+
}, {
|
|
105
|
+
label: `Yes, always allow all tools from server "${mcpProps.serverName}"`,
|
|
106
|
+
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
107
|
+
}, { label: 'No (esc)', value: ToolConfirmationOutcome.Cancel });
|
|
108
|
+
}
|
|
109
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, width: childWidth, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, overflow: "hidden", marginBottom: 1, children: bodyContent }), _jsx(Box, { marginBottom: 1, flexShrink: 0, children: _jsx(Text, { wrap: "truncate", children: question }) }), _jsx(Box, { flexShrink: 0, children: _jsx(RadioButtonSelect, { items: options, onSelect: handleSelect, isFocused: isFocused }) })] }));
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=ToolConfirmationMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConfirmationMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolConfirmationMessage.tsx"],"names":[],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AAC,YAChB,KAAC,iBAAiB,IAChB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,GACpB,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { IndividualToolCallDisplay } from '../../types.js';
|
|
8
|
+
import { Config } from '@google/gemini-cli-core';
|
|
9
|
+
interface ToolGroupMessageProps {
|
|
10
|
+
groupId: number;
|
|
11
|
+
toolCalls: IndividualToolCallDisplay[];
|
|
12
|
+
availableTerminalHeight?: number;
|
|
13
|
+
terminalWidth: number;
|
|
14
|
+
config?: Config;
|
|
15
|
+
isFocused?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const ToolGroupMessage: React.FC<ToolGroupMessageProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { useMemo } from 'react';
|
|
8
|
+
import { Box } from 'ink';
|
|
9
|
+
import { ToolCallStatus } from '../../types.js';
|
|
10
|
+
import { ToolMessage } from './ToolMessage.js';
|
|
11
|
+
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
|
|
12
|
+
import { Colors } from '../../colors.js';
|
|
13
|
+
import { SHELL_COMMAND_NAME } from '../../constants.js';
|
|
14
|
+
// Main component renders the border and maps the tools using ToolMessage
|
|
15
|
+
export const ToolGroupMessage = ({ toolCalls, availableTerminalHeight, terminalWidth, config, isFocused = true, }) => {
|
|
16
|
+
const hasPending = !toolCalls.every((t) => t.status === ToolCallStatus.Success);
|
|
17
|
+
const isShellCommand = toolCalls.some((t) => t.name === SHELL_COMMAND_NAME);
|
|
18
|
+
const borderColor = hasPending || isShellCommand ? Colors.AccentYellow : Colors.Gray;
|
|
19
|
+
const staticHeight = /* border */ 2 + /* marginBottom */ 1;
|
|
20
|
+
// This is a bit of a magic number, but it accounts for the border and
|
|
21
|
+
// marginLeft.
|
|
22
|
+
const innerWidth = terminalWidth - 4;
|
|
23
|
+
// only prompt for tool approval on the first 'confirming' tool in the list
|
|
24
|
+
// note, after the CTA, this automatically moves over to the next 'confirming' tool
|
|
25
|
+
const toolAwaitingApproval = useMemo(() => toolCalls.find((tc) => tc.status === ToolCallStatus.Confirming), [toolCalls]);
|
|
26
|
+
let countToolCallsWithResults = 0;
|
|
27
|
+
for (const tool of toolCalls) {
|
|
28
|
+
if (tool.resultDisplay !== undefined && tool.resultDisplay !== '') {
|
|
29
|
+
countToolCallsWithResults++;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const countOneLineToolCalls = toolCalls.length - countToolCallsWithResults;
|
|
33
|
+
const availableTerminalHeightPerToolMessage = availableTerminalHeight
|
|
34
|
+
? Math.max(Math.floor((availableTerminalHeight - staticHeight - countOneLineToolCalls) /
|
|
35
|
+
Math.max(1, countToolCallsWithResults)), 1)
|
|
36
|
+
: undefined;
|
|
37
|
+
return (_jsx(Box, { flexDirection: "column", borderStyle: "round",
|
|
38
|
+
/*
|
|
39
|
+
This width constraint is highly important and protects us from an Ink rendering bug.
|
|
40
|
+
Since the ToolGroup can typically change rendering states frequently, it can cause
|
|
41
|
+
Ink to render the border of the box incorrectly and span multiple lines and even
|
|
42
|
+
cause tearing.
|
|
43
|
+
*/
|
|
44
|
+
width: "100%", marginLeft: 1, borderDimColor: hasPending, borderColor: borderColor, children: toolCalls.map((tool) => {
|
|
45
|
+
const isConfirming = toolAwaitingApproval?.callId === tool.callId;
|
|
46
|
+
return (_jsxs(Box, { flexDirection: "column", minHeight: 1, children: [_jsx(Box, { flexDirection: "row", alignItems: "center", children: _jsx(ToolMessage, { callId: tool.callId, name: tool.name, description: tool.description, resultDisplay: tool.resultDisplay, status: tool.status, confirmationDetails: tool.confirmationDetails, availableTerminalHeight: availableTerminalHeightPerToolMessage, terminalWidth: innerWidth, emphasis: isConfirming
|
|
47
|
+
? 'high'
|
|
48
|
+
: toolAwaitingApproval
|
|
49
|
+
? 'low'
|
|
50
|
+
: 'medium', renderOutputAsMarkdown: tool.renderOutputAsMarkdown }) }), tool.status === ToolCallStatus.Confirming &&
|
|
51
|
+
isConfirming &&
|
|
52
|
+
tool.confirmationDetails && (_jsx(ToolConfirmationMessage, { confirmationDetails: tool.confirmationDetails, config: config, isFocused: isFocused, availableTerminalHeight: availableTerminalHeightPerToolMessage, terminalWidth: innerWidth }))] }, tool.callId));
|
|
53
|
+
}) }));
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=ToolGroupMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolGroupMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolGroupMessage.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAA6B,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAWxD,yEAAyE;AACzE,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAChE,SAAS,EACT,uBAAuB,EACvB,aAAa,EACb,MAAM,EACN,SAAS,GAAG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,SAAS,EACpB,uBAAuB,EACrB,qCAAqC,EAEvC,aAAa,EAAE,UAAU,GACzB,CACH,KAjCK,IAAI,CAAC,MAAM,CAkCf,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC,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 { IndividualToolCallDisplay } from '../../types.js';
|
|
8
|
+
export type TextEmphasis = 'high' | 'medium' | 'low';
|
|
9
|
+
export interface ToolMessageProps extends IndividualToolCallDisplay {
|
|
10
|
+
availableTerminalHeight?: number;
|
|
11
|
+
terminalWidth: number;
|
|
12
|
+
emphasis?: TextEmphasis;
|
|
13
|
+
renderOutputAsMarkdown?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ToolMessage: React.FC<ToolMessageProps>;
|