mpd-llm-cli 0.1.24 → 0.1.25
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/LICENSE +202 -0
- package/README.md +203 -0
- package/README.zh-CN.md +206 -0
- package/bundle/api.cjs +166773 -0
- package/bundle/api.js +166768 -0
- package/bundle/gemini.js +281183 -0
- package/package.json +79 -66
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -83
- package/dist/src/api/index.d.ts +0 -17
- package/dist/src/api/index.js +0 -192
- package/dist/src/api/index.js.map +0 -1
- package/dist/src/api/types.d.ts +0 -32
- package/dist/src/api/types.js +0 -2
- package/dist/src/api/types.js.map +0 -1
- package/dist/src/api/util.d.ts +0 -4
- package/dist/src/api/util.js +0 -67
- package/dist/src/api/util.js.map +0 -1
- package/dist/src/config/auth.d.ts +0 -6
- package/dist/src/config/auth.js +0 -42
- package/dist/src/config/auth.js.map +0 -1
- package/dist/src/config/config.d.ts +0 -13
- package/dist/src/config/config.js +0 -248
- package/dist/src/config/config.js.map +0 -1
- package/dist/src/config/extension.d.ts +0 -21
- package/dist/src/config/extension.js +0 -109
- package/dist/src/config/extension.js.map +0 -1
- package/dist/src/config/mpdaiConfig.d.ts +0 -28
- package/dist/src/config/mpdaiConfig.js +0 -84
- package/dist/src/config/mpdaiConfig.js.map +0 -1
- package/dist/src/config/sandboxConfig.d.ts +0 -13
- package/dist/src/config/sandboxConfig.js +0 -75
- package/dist/src/config/sandboxConfig.js.map +0 -1
- package/dist/src/config/settings.d.ts +0 -72
- package/dist/src/config/settings.js +0 -227
- package/dist/src/config/settings.js.map +0 -1
- package/dist/src/config/startup.d.ts +0 -21
- package/dist/src/config/startup.js +0 -118
- package/dist/src/config/startup.js.map +0 -1
- package/dist/src/gemini.d.ts +0 -6
- package/dist/src/gemini.js +0 -300
- package/dist/src/gemini.js.map +0 -1
- package/dist/src/generated/git-commit.d.ts +0 -6
- package/dist/src/generated/git-commit.js +0 -9
- package/dist/src/generated/git-commit.js.map +0 -1
- package/dist/src/nonInteractiveCli.d.ts +0 -7
- package/dist/src/nonInteractiveCli.js +0 -115
- package/dist/src/nonInteractiveCli.js.map +0 -1
- package/dist/src/services/AuthService.d.ts +0 -110
- package/dist/src/services/AuthService.js +0 -258
- package/dist/src/services/AuthService.js.map +0 -1
- package/dist/src/services/CommandService.d.ts +0 -13
- package/dist/src/services/CommandService.js +0 -34
- package/dist/src/services/CommandService.js.map +0 -1
- package/dist/src/services/EnvConfigManager.d.ts +0 -34
- package/dist/src/services/EnvConfigManager.js +0 -141
- package/dist/src/services/EnvConfigManager.js.map +0 -1
- package/dist/src/services/README.md +0 -114
- package/dist/src/services/debug-auth.d.ts +0 -10
- package/dist/src/services/debug-auth.js +0 -104
- package/dist/src/services/debug-auth.js.map +0 -1
- package/dist/src/services/demo.d.ts +0 -10
- package/dist/src/services/demo.js +0 -96
- package/dist/src/services/demo.js.map +0 -1
- package/dist/src/services/test-auth.d.ts +0 -10
- package/dist/src/services/test-auth.js +0 -104
- package/dist/src/services/test-auth.js.map +0 -1
- package/dist/src/services/test-readline.d.ts +0 -6
- package/dist/src/services/test-readline.js +0 -32
- package/dist/src/services/test-readline.js.map +0 -1
- package/dist/src/telemetry/README.md +0 -135
- package/dist/src/telemetry/costCalculator.d.ts +0 -401
- package/dist/src/telemetry/costCalculator.js +0 -555
- package/dist/src/telemetry/costCalculator.js.map +0 -1
- package/dist/src/telemetry/dataCollector.d.ts +0 -83
- package/dist/src/telemetry/dataCollector.js +0 -392
- package/dist/src/telemetry/dataCollector.js.map +0 -1
- package/dist/src/telemetry/langfuseClient.d.ts +0 -96
- package/dist/src/telemetry/langfuseClient.js +0 -485
- package/dist/src/telemetry/langfuseClient.js.map +0 -1
- package/dist/src/telemetry/langfuseConfig.d.ts +0 -21
- package/dist/src/telemetry/langfuseConfig.js +0 -64
- package/dist/src/telemetry/langfuseConfig.js.map +0 -1
- package/dist/src/telemetry/langfuseIntegration.d.ts +0 -66
- package/dist/src/telemetry/langfuseIntegration.js +0 -238
- package/dist/src/telemetry/langfuseIntegration.js.map +0 -1
- package/dist/src/telemetry/toolExecutionInterceptor.d.ts +0 -29
- package/dist/src/telemetry/toolExecutionInterceptor.js +0 -122
- package/dist/src/telemetry/toolExecutionInterceptor.js.map +0 -1
- package/dist/src/ui/App.d.ts +0 -14
- package/dist/src/ui/App.js +0 -466
- package/dist/src/ui/App.js.map +0 -1
- package/dist/src/ui/colors.d.ts +0 -7
- package/dist/src/ui/colors.js +0 -48
- package/dist/src/ui/colors.js.map +0 -1
- package/dist/src/ui/commands/clearCommand.d.ts +0 -7
- package/dist/src/ui/commands/clearCommand.js +0 -15
- package/dist/src/ui/commands/clearCommand.js.map +0 -1
- package/dist/src/ui/commands/helpCommand.d.ts +0 -7
- package/dist/src/ui/commands/helpCommand.js +0 -18
- package/dist/src/ui/commands/helpCommand.js.map +0 -1
- package/dist/src/ui/commands/logoutCommand.d.ts +0 -7
- package/dist/src/ui/commands/logoutCommand.js +0 -77
- package/dist/src/ui/commands/logoutCommand.js.map +0 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +0 -7
- package/dist/src/ui/commands/memoryCommand.js +0 -81
- package/dist/src/ui/commands/memoryCommand.js.map +0 -1
- package/dist/src/ui/commands/modelCommand.d.ts +0 -14
- package/dist/src/ui/commands/modelCommand.js +0 -58
- package/dist/src/ui/commands/modelCommand.js.map +0 -1
- package/dist/src/ui/commands/types.d.ts +0 -63
- package/dist/src/ui/commands/types.js +0 -7
- package/dist/src/ui/commands/types.js.map +0 -1
- package/dist/src/ui/components/AboutBox.d.ts +0 -16
- package/dist/src/ui/components/AboutBox.js +0 -6
- package/dist/src/ui/components/AboutBox.js.map +0 -1
- package/dist/src/ui/components/AsciiArt.d.ts +0 -7
- package/dist/src/ui/components/AsciiArt.js +0 -25
- package/dist/src/ui/components/AsciiArt.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.d.ts +0 -15
- package/dist/src/ui/components/AuthDialog.js +0 -75
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.d.ts +0 -11
- package/dist/src/ui/components/AuthInProgress.js +0 -27
- package/dist/src/ui/components/AuthInProgress.js.map +0 -1
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +0 -12
- package/dist/src/ui/components/AutoAcceptIndicator.js +0 -26
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/components/ConsolePatcher.d.ts +0 -12
- package/dist/src/ui/components/ConsolePatcher.js +0 -38
- package/dist/src/ui/components/ConsolePatcher.js.map +0 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +0 -11
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +0 -11
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -15
- package/dist/src/ui/components/ContextSummaryDisplay.js +0 -41
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -14
- package/dist/src/ui/components/DetailedMessagesDisplay.js +0 -34
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +0 -1
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +0 -15
- package/dist/src/ui/components/EditorSettingsDialog.js +0 -73
- package/dist/src/ui/components/EditorSettingsDialog.js.map +0 -1
- package/dist/src/ui/components/Footer.d.ts +0 -20
- package/dist/src/ui/components/Footer.js +0 -19
- package/dist/src/ui/components/Footer.js.map +0 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +0 -17
- package/dist/src/ui/components/GeminiRespondingSpinner.js +0 -16
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +0 -1
- package/dist/src/ui/components/Header.d.ts +0 -12
- package/dist/src/ui/components/Header.js +0 -20
- package/dist/src/ui/components/Header.js.map +0 -1
- package/dist/src/ui/components/Help.d.ts +0 -12
- package/dist/src/ui/components/Help.js +0 -10
- package/dist/src/ui/components/Help.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +0 -18
- package/dist/src/ui/components/HistoryItemDisplay.js +0 -17
- package/dist/src/ui/components/HistoryItemDisplay.js.map +0 -1
- package/dist/src/ui/components/InputPrompt.d.ts +0 -25
- package/dist/src/ui/components/InputPrompt.js +0 -280
- package/dist/src/ui/components/InputPrompt.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +0 -15
- package/dist/src/ui/components/LoadingIndicator.js +0 -20
- package/dist/src/ui/components/LoadingIndicator.js.map +0 -1
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +0 -7
- package/dist/src/ui/components/MemoryUsageDisplay.js +0 -27
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +0 -1
- package/dist/src/ui/components/ModelDialog.d.ts +0 -14
- package/dist/src/ui/components/ModelDialog.js +0 -34
- package/dist/src/ui/components/ModelDialog.js.map +0 -1
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +0 -7
- package/dist/src/ui/components/ModelStatsDisplay.js +0 -33
- package/dist/src/ui/components/ModelStatsDisplay.js.map +0 -1
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +0 -11
- package/dist/src/ui/components/SessionSummaryDisplay.js +0 -4
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/ShellModeIndicator.d.ts +0 -7
- package/dist/src/ui/components/ShellModeIndicator.js +0 -5
- package/dist/src/ui/components/ShellModeIndicator.js.map +0 -1
- package/dist/src/ui/components/ShowMoreLines.d.ts +0 -10
- package/dist/src/ui/components/ShowMoreLines.js +0 -24
- package/dist/src/ui/components/ShowMoreLines.js.map +0 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +0 -12
- package/dist/src/ui/components/StatsDisplay.js +0 -42
- package/dist/src/ui/components/StatsDisplay.js.map +0 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +0 -21
- package/dist/src/ui/components/SuggestionsDisplay.js +0 -32
- package/dist/src/ui/components/SuggestionsDisplay.js.map +0 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +0 -19
- package/dist/src/ui/components/ThemeDialog.js +0 -126
- package/dist/src/ui/components/ThemeDialog.js.map +0 -1
- package/dist/src/ui/components/Tips.d.ts +0 -12
- package/dist/src/ui/components/Tips.js +0 -8
- package/dist/src/ui/components/Tips.js.map +0 -1
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +0 -7
- package/dist/src/ui/components/ToolStatsDisplay.js +0 -41
- package/dist/src/ui/components/ToolStatsDisplay.js.map +0 -1
- package/dist/src/ui/components/UpdateNotification.d.ts +0 -10
- package/dist/src/ui/components/UpdateNotification.js +0 -10
- package/dist/src/ui/components/UpdateNotification.js.map +0 -1
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/CompressionMessage.js +0 -16
- package/dist/src/ui/components/messages/CompressionMessage.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +0 -15
- package/dist/src/ui/components/messages/DiffRenderer.js +0 -212
- package/dist/src/ui/components/messages/DiffRenderer.js.map +0 -1
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/ErrorMessage.js +0 -9
- package/dist/src/ui/components/messages/ErrorMessage.js.map +0 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +0 -14
- package/dist/src/ui/components/messages/GeminiMessage.js +0 -10
- package/dist/src/ui/components/messages/GeminiMessage.js.map +0 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +0 -14
- package/dist/src/ui/components/messages/GeminiMessageContent.js +0 -15
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +0 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/InfoMessage.js +0 -9
- package/dist/src/ui/components/messages/InfoMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +0 -18
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +0 -307
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +0 -18
- package/dist/src/ui/components/messages/ToolGroupMessage.js +0 -53
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +0 -15
- package/dist/src/ui/components/messages/ToolMessage.js +0 -61
- package/dist/src/ui/components/messages/ToolMessage.js.map +0 -1
- package/dist/src/ui/components/messages/UserMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/UserMessage.js +0 -9
- package/dist/src/ui/components/messages/UserMessage.js.map +0 -1
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/UserShellMessage.js +0 -9
- package/dist/src/ui/components/messages/UserShellMessage.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +0 -61
- package/dist/src/ui/components/shared/MaxSizedBox.js +0 -384
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +0 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +0 -41
- package/dist/src/ui/components/shared/RadioButtonSelect.js +0 -52
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +0 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +0 -184
- package/dist/src/ui/components/shared/text-buffer.js +0 -1010
- package/dist/src/ui/components/shared/text-buffer.js.map +0 -1
- package/dist/src/ui/constants.d.ts +0 -8
- package/dist/src/ui/constants.js +0 -12
- package/dist/src/ui/constants.js.map +0 -1
- package/dist/src/ui/contexts/OverflowContext.d.ts +0 -19
- package/dist/src/ui/contexts/OverflowContext.js +0 -43
- package/dist/src/ui/contexts/OverflowContext.js.map +0 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +0 -33
- package/dist/src/ui/contexts/SessionContext.js +0 -49
- package/dist/src/ui/contexts/SessionContext.js.map +0 -1
- package/dist/src/ui/contexts/StreamingContext.d.ts +0 -9
- package/dist/src/ui/contexts/StreamingContext.js +0 -15
- package/dist/src/ui/contexts/StreamingContext.js.map +0 -1
- package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -19
- package/dist/src/ui/editors/editorSettingsManager.js +0 -54
- package/dist/src/ui/editors/editorSettingsManager.js.map +0 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +0 -31
- package/dist/src/ui/hooks/atCommandProcessor.js +0 -310
- package/dist/src/ui/hooks/atCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -16
- package/dist/src/ui/hooks/shellCommandProcessor.js +0 -261
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +0 -27
- package/dist/src/ui/hooks/slashCommandProcessor.js +0 -1129
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
- package/dist/src/ui/hooks/useAuthCommand.js +0 -63
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +0 -10
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +0 -37
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
- package/dist/src/ui/hooks/useBracketedPaste.js +0 -32
- package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +0 -21
- package/dist/src/ui/hooks/useCompletion.js +0 -372
- package/dist/src/ui/hooks/useCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -12
- package/dist/src/ui/hooks/useConsoleMessages.js +0 -60
- package/dist/src/ui/hooks/useConsoleMessages.js.map +0 -1
- package/dist/src/ui/hooks/useEditorSettings.d.ts +0 -16
- package/dist/src/ui/hooks/useEditorSettings.js +0 -43
- package/dist/src/ui/hooks/useEditorSettings.js.map +0 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +0 -23
- package/dist/src/ui/hooks/useGeminiStream.js +0 -603
- package/dist/src/ui/hooks/useGeminiStream.js.map +0 -1
- package/dist/src/ui/hooks/useGitBranchName.d.ts +0 -6
- package/dist/src/ui/hooks/useGitBranchName.js +0 -61
- package/dist/src/ui/hooks/useGitBranchName.js.map +0 -1
- package/dist/src/ui/hooks/useHistoryManager.d.ts +0 -22
- package/dist/src/ui/hooks/useHistoryManager.js +0 -72
- package/dist/src/ui/hooks/useHistoryManager.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistory.d.ts +0 -19
- package/dist/src/ui/hooks/useInputHistory.js +0 -84
- package/dist/src/ui/hooks/useInputHistory.js.map +0 -1
- package/dist/src/ui/hooks/useKeypress.d.ts +0 -29
- package/dist/src/ui/hooks/useKeypress.js +0 -86
- package/dist/src/ui/hooks/useKeypress.js.map +0 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +0 -10
- package/dist/src/ui/hooks/useLoadingIndicator.js +0 -44
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useLogger.d.ts +0 -10
- package/dist/src/ui/hooks/useLogger.js +0 -29
- package/dist/src/ui/hooks/useLogger.js.map +0 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -14
- package/dist/src/ui/hooks/usePhraseCycler.js +0 -189
- package/dist/src/ui/hooks/usePhraseCycler.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
- package/dist/src/ui/hooks/usePrivacySettings.js +0 -115
- package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -33
- package/dist/src/ui/hooks/useReactToolScheduler.js +0 -186
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
- package/dist/src/ui/hooks/useShellHistory.d.ts +0 -11
- package/dist/src/ui/hooks/useShellHistory.js +0 -89
- package/dist/src/ui/hooks/useShellHistory.js.map +0 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
- package/dist/src/ui/hooks/useShowMemoryCommand.js +0 -58
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
- package/dist/src/ui/hooks/useStateAndRef.d.ts +0 -7
- package/dist/src/ui/hooks/useStateAndRef.js +0 -26
- package/dist/src/ui/hooks/useStateAndRef.js.map +0 -1
- package/dist/src/ui/hooks/useTerminalSize.d.ts +0 -9
- package/dist/src/ui/hooks/useTerminalSize.js +0 -27
- package/dist/src/ui/hooks/useTerminalSize.js.map +0 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +0 -15
- package/dist/src/ui/hooks/useThemeCommand.js +0 -78
- package/dist/src/ui/hooks/useThemeCommand.js.map +0 -1
- package/dist/src/ui/hooks/useTimer.d.ts +0 -12
- package/dist/src/ui/hooks/useTimer.js +0 -58
- package/dist/src/ui/hooks/useTimer.js.map +0 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -40
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -17
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -17
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
- package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
- package/dist/src/ui/themes/ansi-light.d.ts +0 -7
- package/dist/src/ui/themes/ansi-light.js +0 -139
- package/dist/src/ui/themes/ansi-light.js.map +0 -1
- package/dist/src/ui/themes/ansi.d.ts +0 -7
- package/dist/src/ui/themes/ansi.js +0 -149
- package/dist/src/ui/themes/ansi.js.map +0 -1
- package/dist/src/ui/themes/atom-one-dark.d.ts +0 -7
- package/dist/src/ui/themes/atom-one-dark.js +0 -136
- package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
- package/dist/src/ui/themes/ayu-light.d.ts +0 -7
- package/dist/src/ui/themes/ayu-light.js +0 -128
- package/dist/src/ui/themes/ayu-light.js.map +0 -1
- package/dist/src/ui/themes/ayu.d.ts +0 -7
- package/dist/src/ui/themes/ayu.js +0 -102
- package/dist/src/ui/themes/ayu.js.map +0 -1
- package/dist/src/ui/themes/default-light.d.ts +0 -7
- package/dist/src/ui/themes/default-light.js +0 -100
- package/dist/src/ui/themes/default-light.js.map +0 -1
- package/dist/src/ui/themes/default.d.ts +0 -7
- package/dist/src/ui/themes/default.js +0 -143
- package/dist/src/ui/themes/default.js.map +0 -1
- package/dist/src/ui/themes/dracula.d.ts +0 -7
- package/dist/src/ui/themes/dracula.js +0 -113
- package/dist/src/ui/themes/dracula.js.map +0 -1
- package/dist/src/ui/themes/github-dark.d.ts +0 -7
- package/dist/src/ui/themes/github-dark.js +0 -136
- package/dist/src/ui/themes/github-dark.js.map +0 -1
- package/dist/src/ui/themes/github-light.d.ts +0 -7
- package/dist/src/ui/themes/github-light.js +0 -138
- package/dist/src/ui/themes/github-light.js.map +0 -1
- package/dist/src/ui/themes/googlecode.d.ts +0 -7
- package/dist/src/ui/themes/googlecode.js +0 -135
- package/dist/src/ui/themes/googlecode.js.map +0 -1
- package/dist/src/ui/themes/no-color.d.ts +0 -7
- package/dist/src/ui/themes/no-color.js +0 -84
- package/dist/src/ui/themes/no-color.js.map +0 -1
- package/dist/src/ui/themes/shades-of-purple.d.ts +0 -11
- package/dist/src/ui/themes/shades-of-purple.js +0 -302
- package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
- package/dist/src/ui/themes/theme-manager.d.ts +0 -33
- package/dist/src/ui/themes/theme-manager.js +0 -109
- package/dist/src/ui/themes/theme-manager.js.map +0 -1
- package/dist/src/ui/themes/theme.d.ts +0 -67
- package/dist/src/ui/themes/theme.js +0 -304
- package/dist/src/ui/themes/theme.js.map +0 -1
- package/dist/src/ui/themes/xcode.d.ts +0 -7
- package/dist/src/ui/themes/xcode.js +0 -143
- package/dist/src/ui/themes/xcode.js.map +0 -1
- package/dist/src/ui/types.d.ts +0 -172
- package/dist/src/ui/types.js +0 -43
- package/dist/src/ui/types.js.map +0 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +0 -14
- package/dist/src/ui/utils/CodeColorizer.js +0 -97
- package/dist/src/ui/utils/CodeColorizer.js.map +0 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -16
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +0 -104
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +0 -14
- package/dist/src/ui/utils/MarkdownDisplay.js +0 -197
- package/dist/src/ui/utils/MarkdownDisplay.js.map +0 -1
- package/dist/src/ui/utils/TableRenderer.d.ts +0 -17
- package/dist/src/ui/utils/TableRenderer.js +0 -84
- package/dist/src/ui/utils/TableRenderer.js.map +0 -1
- package/dist/src/ui/utils/commandUtils.d.ts +0 -22
- package/dist/src/ui/utils/commandUtils.js +0 -25
- package/dist/src/ui/utils/commandUtils.js.map +0 -1
- package/dist/src/ui/utils/computeStats.d.ts +0 -10
- package/dist/src/ui/utils/computeStats.js +0 -55
- package/dist/src/ui/utils/computeStats.js.map +0 -1
- package/dist/src/ui/utils/displayUtils.d.ts +0 -17
- package/dist/src/ui/utils/displayUtils.js +0 -24
- package/dist/src/ui/utils/displayUtils.js.map +0 -1
- package/dist/src/ui/utils/errorParsing.d.ts +0 -15
- package/dist/src/ui/utils/errorParsing.js +0 -79
- package/dist/src/ui/utils/errorParsing.js.map +0 -1
- package/dist/src/ui/utils/formatters.d.ts +0 -13
- package/dist/src/ui/utils/formatters.js +0 -56
- package/dist/src/ui/utils/formatters.js.map +0 -1
- package/dist/src/ui/utils/markdownUtilities.d.ts +0 -6
- package/dist/src/ui/utils/markdownUtilities.js +0 -110
- package/dist/src/ui/utils/markdownUtilities.js.map +0 -1
- package/dist/src/ui/utils/textUtils.d.ts +0 -22
- package/dist/src/ui/utils/textUtils.js +0 -58
- package/dist/src/ui/utils/textUtils.js.map +0 -1
- package/dist/src/ui/utils/updateCheck.d.ts +0 -6
- package/dist/src/ui/utils/updateCheck.js +0 -36
- package/dist/src/ui/utils/updateCheck.js.map +0 -1
- package/dist/src/utils/cleanup.d.ts +0 -6
- package/dist/src/utils/cleanup.js +0 -19
- package/dist/src/utils/cleanup.js.map +0 -1
- package/dist/src/utils/package.d.ts +0 -12
- package/dist/src/utils/package.js +0 -24
- package/dist/src/utils/package.js.map +0 -1
- package/dist/src/utils/readStdin.d.ts +0 -6
- package/dist/src/utils/readStdin.js +0 -34
- package/dist/src/utils/readStdin.js.map +0 -1
- package/dist/src/utils/sandbox.d.ts +0 -7
- package/dist/src/utils/sandbox.js +0 -680
- package/dist/src/utils/sandbox.js.map +0 -1
- package/dist/src/utils/startupWarnings.d.ts +0 -6
- package/dist/src/utils/startupWarnings.js +0 -40
- package/dist/src/utils/startupWarnings.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.d.ts +0 -6
- package/dist/src/utils/userStartupWarnings.js +0 -33
- package/dist/src/utils/userStartupWarnings.js.map +0 -1
- package/dist/src/utils/version.d.ts +0 -6
- package/dist/src/utils/version.js +0 -11
- package/dist/src/utils/version.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vitest.config.d.ts +0 -7
- package/dist/vitest.config.js +0 -35
- package/dist/vitest.config.js.map +0 -1
- /package/{dist/src/utils → bundle}/sandbox-macos-permissive-closed.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-permissive-open.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-permissive-proxied.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-closed.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-open.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-proxied.sb +0 -0
package/package.json
CHANGED
|
@@ -1,83 +1,96 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mpd-llm-cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.1.25",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=20.0.0"
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"workspaces": [
|
|
9
|
+
"packages/*"
|
|
10
|
+
],
|
|
5
11
|
"repository": {
|
|
6
12
|
"type": "git",
|
|
7
|
-
"url": "git+https://
|
|
13
|
+
"url": "git+https://git.rakuten-it.com/scm/mpd-ai/mpd-llm-cli.git"
|
|
8
14
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"bin": {
|
|
12
|
-
"gemini": "dist/index.js"
|
|
15
|
+
"config": {
|
|
16
|
+
"sandboxImageUri": "xx:0.1.23"
|
|
13
17
|
},
|
|
14
18
|
"scripts": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
+
"start": "node scripts/start.js",
|
|
20
|
+
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
|
|
21
|
+
"generate": "node scripts/generate-git-commit-info.js",
|
|
22
|
+
"build": "node scripts/build.js",
|
|
23
|
+
"build:all": "npm run build && npm run build:sandbox",
|
|
24
|
+
"build:packages": "npm run build --workspaces",
|
|
25
|
+
"build:sandbox": "node scripts/build_sandbox.js --skip-npm-install-build",
|
|
26
|
+
"bundle": "npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
27
|
+
"dist": "node scripts/create-distribution.js",
|
|
28
|
+
"dist:clean": "rm -rf dist && npm run dist",
|
|
29
|
+
"release": "node scripts/release.js",
|
|
30
|
+
"test": "npm run test --workspaces",
|
|
31
|
+
"test:ci": "npm run test:ci --workspaces --if-present && npm run test:scripts",
|
|
32
|
+
"test:scripts": "vitest run --config ./scripts/tests/vitest.config.ts",
|
|
33
|
+
"test:e2e": "npm run test:integration:sandbox:none -- --verbose --keep-output",
|
|
34
|
+
"test:integration:all": "npm run test:integration:sandbox:none && npm run test:integration:sandbox:docker && npm run test:integration:sandbox:podman",
|
|
35
|
+
"test:integration:sandbox:none": "GEMINI_SANDBOX=false node integration-tests/run-tests.js",
|
|
36
|
+
"test:integration:sandbox:docker": "GEMINI_SANDBOX=docker node integration-tests/run-tests.js",
|
|
37
|
+
"test:integration:sandbox:podman": "GEMINI_SANDBOX=podman node integration-tests/run-tests.js",
|
|
38
|
+
"lint": "eslint . --ext .ts,.tsx && eslint integration-tests",
|
|
39
|
+
"lint:fix": "eslint . --fix && eslint integration-tests --fix",
|
|
40
|
+
"lint:ci": "eslint . --ext .ts,.tsx --max-warnings 0 && eslint integration-tests --max-warnings 0",
|
|
19
41
|
"format": "prettier --write .",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
42
|
+
"typecheck": "npm run typecheck --workspaces --if-present",
|
|
43
|
+
"preflight": "npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci",
|
|
44
|
+
"prepare": "npm run bundle",
|
|
45
|
+
"prepare:package": "node scripts/prepare-package.js",
|
|
46
|
+
"release:version": "node scripts/version.js",
|
|
47
|
+
"telemetry": "node scripts/telemetry.js",
|
|
48
|
+
"clean": "node scripts/clean.js"
|
|
49
|
+
},
|
|
50
|
+
"bin": {
|
|
51
|
+
"mpdai": "bundle/gemini.js"
|
|
23
52
|
},
|
|
24
53
|
"files": [
|
|
25
|
-
"
|
|
54
|
+
"bundle/",
|
|
55
|
+
"README.md",
|
|
56
|
+
"LICENSE"
|
|
26
57
|
],
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"diff": "^7.0.0",
|
|
36
|
-
"dotenv": "^16.6.1",
|
|
37
|
-
"gaxios": "^6.1.1",
|
|
38
|
-
"glob": "^10.4.1",
|
|
39
|
-
"highlight.js": "^11.11.1",
|
|
40
|
-
"ink": "^6.0.1",
|
|
41
|
-
"ink-big-text": "^2.0.0",
|
|
42
|
-
"ink-gradient": "^3.0.0",
|
|
43
|
-
"ink-link": "^4.1.0",
|
|
44
|
-
"ink-select-input": "^6.2.0",
|
|
45
|
-
"ink-spinner": "^5.0.0",
|
|
46
|
-
"ink-text-input": "^6.0.0",
|
|
47
|
-
"langfuse": "^3.38.5",
|
|
48
|
-
"lowlight": "^3.3.0",
|
|
49
|
-
"mime-types": "^2.1.4",
|
|
50
|
-
"open": "^10.1.2",
|
|
51
|
-
"react": "^19.1.0",
|
|
52
|
-
"read-package-up": "^11.0.0",
|
|
53
|
-
"readline-sync": "^1.4.10",
|
|
54
|
-
"shell-quote": "^1.8.3",
|
|
55
|
-
"string-width": "^7.1.0",
|
|
56
|
-
"strip-ansi": "^7.1.0",
|
|
57
|
-
"strip-json-comments": "^3.1.1",
|
|
58
|
-
"update-notifier": "^7.3.1",
|
|
59
|
-
"yargs": "^17.7.2"
|
|
58
|
+
"main": "bundle/api.js",
|
|
59
|
+
"types": "index.ts",
|
|
60
|
+
"exports": {
|
|
61
|
+
".": {
|
|
62
|
+
"import": "./bundle/api.js",
|
|
63
|
+
"require": "./bundle/api.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./package.json": "./package.json"
|
|
60
66
|
},
|
|
61
67
|
"devDependencies": {
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"@types/
|
|
65
|
-
"@types/diff": "^7.0.2",
|
|
66
|
-
"@types/dotenv": "^6.1.1",
|
|
67
|
-
"@types/node": "^20.11.24",
|
|
68
|
-
"@types/react": "^19.1.8",
|
|
69
|
-
"@types/react-dom": "^19.1.6",
|
|
70
|
-
"@types/semver": "^7.7.0",
|
|
68
|
+
"@types/micromatch": "^4.0.9",
|
|
69
|
+
"@types/mime-types": "^2.1.4",
|
|
70
|
+
"@types/minimatch": "^5.1.2",
|
|
71
71
|
"@types/shell-quote": "^1.7.5",
|
|
72
|
-
"@
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
72
|
+
"@vitest/coverage-v8": "^3.1.1",
|
|
73
|
+
"concurrently": "^9.2.0",
|
|
74
|
+
"cross-env": "^7.0.3",
|
|
75
|
+
"esbuild": "^0.25.0",
|
|
76
|
+
"eslint": "^9.24.0",
|
|
77
|
+
"eslint-config-prettier": "^10.1.2",
|
|
78
|
+
"eslint-plugin-import": "^2.31.0",
|
|
79
|
+
"eslint-plugin-license-header": "^0.8.0",
|
|
80
|
+
"eslint-plugin-react": "^7.37.5",
|
|
81
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
82
|
+
"glob": "^10.4.5",
|
|
83
|
+
"globals": "^16.0.0",
|
|
84
|
+
"json": "^11.0.0",
|
|
85
|
+
"lodash": "^4.17.21",
|
|
86
|
+
"memfs": "^4.17.2",
|
|
87
|
+
"prettier": "^3.5.3",
|
|
88
|
+
"react-devtools-core": "^4.28.5",
|
|
89
|
+
"typescript-eslint": "^8.30.1",
|
|
90
|
+
"vitest": "^3.2.4",
|
|
91
|
+
"yargs": "^17.7.2"
|
|
79
92
|
},
|
|
80
|
-
"
|
|
81
|
-
"
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"@google/genai": "^1.9.0"
|
|
82
95
|
}
|
|
83
96
|
}
|
package/dist/.last_build
DELETED
|
File without changes
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import './src/gemini.js';
|
|
8
|
-
import { main } from './src/gemini.js';
|
|
9
|
-
// --- Global Entry Point ---
|
|
10
|
-
main().catch((error) => {
|
|
11
|
-
console.error('An unexpected critical error occurred:');
|
|
12
|
-
if (error instanceof Error) {
|
|
13
|
-
console.error(error.stack);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
console.error(String(error));
|
|
17
|
-
}
|
|
18
|
-
process.exit(1);
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAEH,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,6BAA6B;AAC7B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;IACxD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/package.json
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mpd-llm-cli",
|
|
3
|
-
"version": "0.1.24",
|
|
4
|
-
"description": "Gemini CLI",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/ConardLi/easy-llm-cli.git"
|
|
8
|
-
},
|
|
9
|
-
"type": "module",
|
|
10
|
-
"main": "dist/index.js",
|
|
11
|
-
"bin": {
|
|
12
|
-
"gemini": "dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "node ../../scripts/build_package.js",
|
|
16
|
-
"start": "node dist/index.js",
|
|
17
|
-
"debug": "node --inspect-brk dist/index.js",
|
|
18
|
-
"lint": "eslint . --ext .ts,.tsx",
|
|
19
|
-
"format": "prettier --write .",
|
|
20
|
-
"test": "vitest run",
|
|
21
|
-
"test:ci": "vitest run --coverage",
|
|
22
|
-
"typecheck": "tsc --noEmit"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
|
-
"config": {
|
|
28
|
-
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.23"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@google/gemini-cli-core": "file:../core",
|
|
32
|
-
"@types/readline-sync": "^1.4.8",
|
|
33
|
-
"@types/update-notifier": "^6.0.8",
|
|
34
|
-
"command-exists": "^1.2.9",
|
|
35
|
-
"diff": "^7.0.0",
|
|
36
|
-
"dotenv": "^16.6.1",
|
|
37
|
-
"gaxios": "^6.1.1",
|
|
38
|
-
"glob": "^10.4.1",
|
|
39
|
-
"highlight.js": "^11.11.1",
|
|
40
|
-
"ink": "^6.0.1",
|
|
41
|
-
"ink-big-text": "^2.0.0",
|
|
42
|
-
"ink-gradient": "^3.0.0",
|
|
43
|
-
"ink-link": "^4.1.0",
|
|
44
|
-
"ink-select-input": "^6.2.0",
|
|
45
|
-
"ink-spinner": "^5.0.0",
|
|
46
|
-
"ink-text-input": "^6.0.0",
|
|
47
|
-
"langfuse": "^3.38.5",
|
|
48
|
-
"lowlight": "^3.3.0",
|
|
49
|
-
"mime-types": "^2.1.4",
|
|
50
|
-
"open": "^10.1.2",
|
|
51
|
-
"react": "^19.1.0",
|
|
52
|
-
"read-package-up": "^11.0.0",
|
|
53
|
-
"readline-sync": "^1.4.10",
|
|
54
|
-
"shell-quote": "^1.8.3",
|
|
55
|
-
"string-width": "^7.1.0",
|
|
56
|
-
"strip-ansi": "^7.1.0",
|
|
57
|
-
"strip-json-comments": "^3.1.1",
|
|
58
|
-
"update-notifier": "^7.3.1",
|
|
59
|
-
"yargs": "^17.7.2"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@babel/runtime": "^7.27.6",
|
|
63
|
-
"@testing-library/react": "^16.3.0",
|
|
64
|
-
"@types/command-exists": "^1.2.3",
|
|
65
|
-
"@types/diff": "^7.0.2",
|
|
66
|
-
"@types/dotenv": "^6.1.1",
|
|
67
|
-
"@types/node": "^20.11.24",
|
|
68
|
-
"@types/react": "^19.1.8",
|
|
69
|
-
"@types/react-dom": "^19.1.6",
|
|
70
|
-
"@types/semver": "^7.7.0",
|
|
71
|
-
"@types/shell-quote": "^1.7.5",
|
|
72
|
-
"@types/yargs": "^17.0.32",
|
|
73
|
-
"ink-testing-library": "^4.0.0",
|
|
74
|
-
"jsdom": "^26.1.0",
|
|
75
|
-
"pretty-format": "^30.0.2",
|
|
76
|
-
"react-dom": "^19.1.0",
|
|
77
|
-
"typescript": "^5.3.3",
|
|
78
|
-
"vitest": "^3.1.1"
|
|
79
|
-
},
|
|
80
|
-
"engines": {
|
|
81
|
-
"node": ">=20"
|
|
82
|
-
}
|
|
83
|
-
}
|
package/dist/src/api/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Config, GeminiClient, ToolCallRequestInfo } from '@google/gemini-cli-core';
|
|
2
|
-
import { type Part } from '@google/genai';
|
|
3
|
-
import { AgentConfig, AgentResult } from './types.js';
|
|
4
|
-
export declare class ElcAgent {
|
|
5
|
-
results: AgentResult[];
|
|
6
|
-
abortController: AbortController;
|
|
7
|
-
showLog: boolean;
|
|
8
|
-
rootPath?: string;
|
|
9
|
-
extension?: any;
|
|
10
|
-
disableReadArgs: boolean;
|
|
11
|
-
constructor(agentConfig: AgentConfig);
|
|
12
|
-
run(userInput: string): Promise<string>;
|
|
13
|
-
processConversationRound(config: Config, geminiClient: GeminiClient, messageParts: Part[]): Promise<void>;
|
|
14
|
-
executeToolCalls(config: Config, toolCallRequests: ToolCallRequestInfo[]): Promise<Part[]>;
|
|
15
|
-
getAllResults(): any;
|
|
16
|
-
getLastResult(): string;
|
|
17
|
-
}
|
package/dist/src/api/index.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { loadCliConfig } from '../config/config.js';
|
|
2
|
-
import { loadSettings, SettingScope } from '../config/settings.js';
|
|
3
|
-
import { loadExtensions } from '../config/extension.js';
|
|
4
|
-
import { cleanupCheckpoints } from '../utils/cleanup.js';
|
|
5
|
-
import { sessionId, AuthType, GeminiEventType, CoreToolScheduler, ApprovalMode, closeAllMCPConnections } from '@google/gemini-cli-core';
|
|
6
|
-
import { logStream, processStreamEvent } from './util.js';
|
|
7
|
-
export class ElcAgent {
|
|
8
|
-
results = [];
|
|
9
|
-
abortController = new AbortController();
|
|
10
|
-
showLog = false;
|
|
11
|
-
rootPath;
|
|
12
|
-
extension;
|
|
13
|
-
disableReadArgs = false;
|
|
14
|
-
constructor(agentConfig) {
|
|
15
|
-
const { authType, model, endpoint, provider, apiKey, temperature, topP, maxTokens, readonly, log, rootPath, extension, systemPrompt, disableReadArgs } = agentConfig;
|
|
16
|
-
this.showLog = log || false;
|
|
17
|
-
this.extension = extension;
|
|
18
|
-
this.disableReadArgs = disableReadArgs || false;
|
|
19
|
-
if (!authType || authType === AuthType.CUSTOM_LLM_API) {
|
|
20
|
-
process.env.USE_CUSTOM_LLM = 'true';
|
|
21
|
-
if (!model || !apiKey || !endpoint) {
|
|
22
|
-
throw new Error('AgentConfig must include a model, apiKey and endpoint');
|
|
23
|
-
}
|
|
24
|
-
process.env.CUSTOM_LLM_MODEL_NAME = model;
|
|
25
|
-
process.env.CUSTOM_LLM_ENDPOINT = endpoint;
|
|
26
|
-
process.env.CUSTOM_LLM_API_KEY = apiKey;
|
|
27
|
-
process.env.CUSTOM_LLM_PROVIDER = provider;
|
|
28
|
-
process.env.CUSTOM_LLM_TEMPERATURE = String(temperature || 0);
|
|
29
|
-
process.env.CUSTOM_LLM_TOP_P = String(topP || 1);
|
|
30
|
-
process.env.CUSTOM_LLM_MAX_TOKENS = String(maxTokens || 8096);
|
|
31
|
-
}
|
|
32
|
-
if (readonly) {
|
|
33
|
-
process.env.READ_ONLY = 'true';
|
|
34
|
-
}
|
|
35
|
-
if (rootPath) {
|
|
36
|
-
this.rootPath = rootPath;
|
|
37
|
-
try {
|
|
38
|
-
process.chdir(rootPath);
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
// ignore chdir error in worker
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (systemPrompt) {
|
|
45
|
-
process.env.SYSTEM_PROMPT = systemPrompt;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
async run(userInput) {
|
|
49
|
-
const workspaceRoot = process.cwd();
|
|
50
|
-
const settings = loadSettings(process.cwd());
|
|
51
|
-
await cleanupCheckpoints();
|
|
52
|
-
const extensions = this.extension
|
|
53
|
-
? [{ config: this.extension }]
|
|
54
|
-
: loadExtensions(workspaceRoot);
|
|
55
|
-
const config = await loadCliConfig(settings.merged, extensions, sessionId, this.disableReadArgs);
|
|
56
|
-
settings.setValue(SettingScope.User, 'selectedAuthType', process.env.USE_CUSTOM_LLM
|
|
57
|
-
? AuthType.CUSTOM_LLM_API
|
|
58
|
-
: AuthType.LOGIN_WITH_GOOGLE);
|
|
59
|
-
await config.initialize();
|
|
60
|
-
const selectedAuthType = settings.merged.selectedAuthType || AuthType.CUSTOM_LLM_API;
|
|
61
|
-
await config.refreshAuth(selectedAuthType);
|
|
62
|
-
const geminiClient = config.getGeminiClient();
|
|
63
|
-
await this.processConversationRound(config, geminiClient, [
|
|
64
|
-
{ text: userInput },
|
|
65
|
-
]);
|
|
66
|
-
//close mcp connection
|
|
67
|
-
await closeAllMCPConnections();
|
|
68
|
-
return this.getLastResult();
|
|
69
|
-
}
|
|
70
|
-
async processConversationRound(config, geminiClient, messageParts) {
|
|
71
|
-
const stream = geminiClient.sendMessageStream(messageParts, this.abortController.signal);
|
|
72
|
-
const toolCallRequests = [];
|
|
73
|
-
for await (const event of stream) {
|
|
74
|
-
const result = processStreamEvent(event);
|
|
75
|
-
if (result) {
|
|
76
|
-
this.showLog && logStream(result);
|
|
77
|
-
this.results.push(result);
|
|
78
|
-
}
|
|
79
|
-
if (event.type === GeminiEventType.ToolCallRequest) {
|
|
80
|
-
toolCallRequests.push(event.value);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (toolCallRequests.length > 0) {
|
|
84
|
-
const responseParts = await this.executeToolCalls(config, toolCallRequests);
|
|
85
|
-
if (responseParts.length > 0) {
|
|
86
|
-
await this.processConversationRound(config, geminiClient, responseParts);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
async executeToolCalls(config, toolCallRequests) {
|
|
91
|
-
return new Promise((resolve, reject) => {
|
|
92
|
-
const responseParts = [];
|
|
93
|
-
const scheduler = new CoreToolScheduler({
|
|
94
|
-
toolRegistry: config.getToolRegistry(),
|
|
95
|
-
approvalMode: ApprovalMode.YOLO,
|
|
96
|
-
getPreferredEditor: () => undefined,
|
|
97
|
-
config,
|
|
98
|
-
onAllToolCallsComplete: (completedToolCalls) => {
|
|
99
|
-
for (const toolCall of completedToolCalls) {
|
|
100
|
-
this.showLog &&
|
|
101
|
-
console.log('=== excute tool ===', toolCall.request.name, toolCall.status);
|
|
102
|
-
this.showLog && console.log('');
|
|
103
|
-
if (toolCall.status === 'success') {
|
|
104
|
-
// 添加成功的工具响应
|
|
105
|
-
const responsePartsArray = Array.isArray(toolCall.response.responseParts)
|
|
106
|
-
? toolCall.response.responseParts
|
|
107
|
-
: [toolCall.response.responseParts];
|
|
108
|
-
responseParts.push(...responsePartsArray.map((part) => typeof part === 'string' ? { text: part } : part));
|
|
109
|
-
// 将工具执行结果添加到结果中
|
|
110
|
-
this.results.push({
|
|
111
|
-
type: 'tool_call',
|
|
112
|
-
toolCall: {
|
|
113
|
-
name: toolCall.request.name,
|
|
114
|
-
args: toolCall.request.args || {},
|
|
115
|
-
result: {
|
|
116
|
-
llmContent: toolCall.response.responseParts,
|
|
117
|
-
returnDisplay: toolCall.response.resultDisplay,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
timestamp: Date.now(),
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
else if (toolCall.status === 'error') {
|
|
124
|
-
// 添加错误响应
|
|
125
|
-
const responsePartsArray = Array.isArray(toolCall.response.responseParts)
|
|
126
|
-
? toolCall.response.responseParts
|
|
127
|
-
: [toolCall.response.responseParts];
|
|
128
|
-
responseParts.push(...responsePartsArray.map((part) => typeof part === 'string' ? { text: part } : part));
|
|
129
|
-
this.results.push({
|
|
130
|
-
type: 'error',
|
|
131
|
-
error: `Tool '${toolCall.request.name}' failed: ${toolCall.response.error?.message || 'Unknown error'}`,
|
|
132
|
-
timestamp: Date.now(),
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
else if (toolCall.status === 'cancelled') {
|
|
136
|
-
// 添加取消响应
|
|
137
|
-
const responsePartsArray = Array.isArray(toolCall.response.responseParts)
|
|
138
|
-
? toolCall.response.responseParts
|
|
139
|
-
: [toolCall.response.responseParts];
|
|
140
|
-
responseParts.push(...responsePartsArray.map((part) => typeof part === 'string' ? { text: part } : part));
|
|
141
|
-
this.results.push({
|
|
142
|
-
type: 'error',
|
|
143
|
-
error: `Tool '${toolCall.request.name}' was cancelled`,
|
|
144
|
-
timestamp: Date.now(),
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
resolve(responseParts);
|
|
149
|
-
},
|
|
150
|
-
});
|
|
151
|
-
scheduler
|
|
152
|
-
.schedule(toolCallRequests, this.abortController.signal)
|
|
153
|
-
.catch((error) => {
|
|
154
|
-
reject(error);
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
getAllResults() {
|
|
159
|
-
const result = [];
|
|
160
|
-
for (let i = 0; i < this.results.length; i++) {
|
|
161
|
-
const { type, content } = this.results[i];
|
|
162
|
-
if (type === 'content') {
|
|
163
|
-
const latestIndex = result.length - 1;
|
|
164
|
-
if (typeof result[latestIndex] === 'string') {
|
|
165
|
-
result[latestIndex] += content;
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
result[latestIndex] = content;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
result.push(this.results[i]);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return result;
|
|
176
|
-
}
|
|
177
|
-
getLastResult() {
|
|
178
|
-
const reverse = [...this.results].reverse();
|
|
179
|
-
const texts = [];
|
|
180
|
-
for (let i = 0; i < reverse.length; i++) {
|
|
181
|
-
const { type, content } = reverse[i];
|
|
182
|
-
if (type === 'content') {
|
|
183
|
-
texts.push(content);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return texts.reverse().join('');
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,M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AK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,CAAC;iBAAM,CAAC;gBACN,MAAM;YACR,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;CACF"}
|
package/dist/src/api/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AuthType } from '@google/gemini-cli-core';
|
|
2
|
-
export interface AgentResult {
|
|
3
|
-
type: 'content' | 'thought' | 'tool_call' | 'error' | 'user_cancelled';
|
|
4
|
-
content?: string;
|
|
5
|
-
thought?: {
|
|
6
|
-
summary: string;
|
|
7
|
-
details?: string;
|
|
8
|
-
};
|
|
9
|
-
toolCall?: {
|
|
10
|
-
name: string;
|
|
11
|
-
args: Record<string, unknown>;
|
|
12
|
-
result?: unknown;
|
|
13
|
-
};
|
|
14
|
-
error?: string;
|
|
15
|
-
timestamp: number;
|
|
16
|
-
}
|
|
17
|
-
export interface AgentConfig {
|
|
18
|
-
model?: string;
|
|
19
|
-
endpoint?: string;
|
|
20
|
-
apiKey?: string;
|
|
21
|
-
authType?: AuthType;
|
|
22
|
-
provider?: string;
|
|
23
|
-
temperature?: number;
|
|
24
|
-
topP?: number;
|
|
25
|
-
maxTokens?: number;
|
|
26
|
-
log?: boolean;
|
|
27
|
-
readonly?: boolean;
|
|
28
|
-
systemPrompt?: string;
|
|
29
|
-
rootPath?: string;
|
|
30
|
-
extension?: any;
|
|
31
|
-
disableReadArgs?: boolean;
|
|
32
|
-
}
|
package/dist/src/api/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":""}
|
package/dist/src/api/util.d.ts
DELETED
package/dist/src/api/util.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { GeminiEventType, } from '@google/gemini-cli-core';
|
|
2
|
-
export function logStream(chunk) {
|
|
3
|
-
if (!chunk) {
|
|
4
|
-
return;
|
|
5
|
-
}
|
|
6
|
-
if (chunk.type === 'content') {
|
|
7
|
-
process.stdout.write(chunk.content || '');
|
|
8
|
-
}
|
|
9
|
-
if (chunk.type === 'tool_call') {
|
|
10
|
-
console.log('=== excute tool ===');
|
|
11
|
-
console.log(JSON.stringify(chunk.toolCall, null, 2));
|
|
12
|
-
console.log('');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function processStreamEvent(event) {
|
|
16
|
-
const timestamp = Date.now();
|
|
17
|
-
switch (event.type) {
|
|
18
|
-
case GeminiEventType.Content:
|
|
19
|
-
return {
|
|
20
|
-
type: 'content',
|
|
21
|
-
content: event.value,
|
|
22
|
-
timestamp,
|
|
23
|
-
};
|
|
24
|
-
case GeminiEventType.ToolCallRequest:
|
|
25
|
-
return {
|
|
26
|
-
type: 'tool_call',
|
|
27
|
-
toolCall: {
|
|
28
|
-
name: event.value.name,
|
|
29
|
-
args: event.value.args,
|
|
30
|
-
},
|
|
31
|
-
timestamp,
|
|
32
|
-
};
|
|
33
|
-
case GeminiEventType.ToolCallResponse:
|
|
34
|
-
return {
|
|
35
|
-
type: 'tool_call',
|
|
36
|
-
toolCall: {
|
|
37
|
-
name: 'response',
|
|
38
|
-
args: {},
|
|
39
|
-
result: event.value.responseParts,
|
|
40
|
-
},
|
|
41
|
-
timestamp,
|
|
42
|
-
};
|
|
43
|
-
case GeminiEventType.Thought:
|
|
44
|
-
return {
|
|
45
|
-
type: 'thought',
|
|
46
|
-
thought: {
|
|
47
|
-
summary: event.value.subject,
|
|
48
|
-
details: event.value.description,
|
|
49
|
-
},
|
|
50
|
-
timestamp,
|
|
51
|
-
};
|
|
52
|
-
case GeminiEventType.Error:
|
|
53
|
-
return {
|
|
54
|
-
type: 'error',
|
|
55
|
-
error: event.value.error.message,
|
|
56
|
-
timestamp,
|
|
57
|
-
};
|
|
58
|
-
case GeminiEventType.UserCancelled:
|
|
59
|
-
return {
|
|
60
|
-
type: 'user_cancelled',
|
|
61
|
-
timestamp,
|
|
62
|
-
};
|
|
63
|
-
default:
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=util.js.map
|
package/dist/src/api/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/api/util.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,SAAS,CAAC,KAAkB;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;IACT,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,KAA8B;IAE9B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,eAAe,CAAC,OAAO;YAC1B,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK,CAAC,KAAK;gBACpB,SAAS;aACV,CAAC;QAEJ,KAAK,eAAe,CAAC,eAAe;YAClC,OAAO;gBACL,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE;oBACR,IAAI,EAAE,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