@umsai/ums-code 0.3.0-v2 → 0.6.0-v1
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/package.json +6 -6
- package/dist/src/{zed-integration → acp-integration}/acp.d.ts +13 -0
- package/dist/src/{zed-integration → acp-integration}/acp.js +32 -0
- package/dist/src/acp-integration/acp.js.map +1 -0
- package/dist/src/acp-integration/acpAgent.d.ts +10 -0
- package/dist/src/acp-integration/acpAgent.js +264 -0
- package/dist/src/acp-integration/acpAgent.js.map +1 -0
- package/dist/src/{zed-integration → acp-integration}/schema.d.ts +2235 -905
- package/dist/src/{zed-integration → acp-integration}/schema.js +100 -2
- package/dist/src/acp-integration/schema.js.map +1 -0
- package/dist/src/{zed-integration/fileSystemService.d.ts → acp-integration/service/filesystem.d.ts} +1 -1
- package/dist/src/{zed-integration/fileSystemService.js → acp-integration/service/filesystem.js} +14 -1
- package/dist/src/acp-integration/service/filesystem.js.map +1 -0
- package/dist/src/{ui/hooks/useQuotaAndFallback.test.d.ts → acp-integration/service/filesystem.test.d.ts} +1 -1
- package/dist/src/acp-integration/service/filesystem.test.js +39 -0
- package/dist/src/acp-integration/service/filesystem.test.js.map +1 -0
- package/dist/src/acp-integration/session/HistoryReplayer.d.ts +51 -0
- package/dist/src/acp-integration/session/HistoryReplayer.js +164 -0
- package/dist/src/acp-integration/session/HistoryReplayer.js.map +1 -0
- package/dist/src/acp-integration/session/HistoryReplayer.test.d.ts +6 -0
- package/dist/src/acp-integration/session/HistoryReplayer.test.js +374 -0
- package/dist/src/acp-integration/session/HistoryReplayer.test.js.map +1 -0
- package/dist/src/acp-integration/session/Session.d.ts +61 -0
- package/dist/src/acp-integration/session/Session.js +839 -0
- package/dist/src/acp-integration/session/Session.js.map +1 -0
- package/dist/src/acp-integration/session/SubAgentTracker.d.ts +51 -0
- package/dist/src/acp-integration/session/SubAgentTracker.js +257 -0
- package/dist/src/acp-integration/session/SubAgentTracker.js.map +1 -0
- package/dist/src/acp-integration/session/SubAgentTracker.test.d.ts +6 -0
- package/dist/src/acp-integration/session/SubAgentTracker.test.js +369 -0
- package/dist/src/acp-integration/session/SubAgentTracker.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/BaseEmitter.d.ts +27 -0
- package/dist/src/acp-integration/session/emitters/BaseEmitter.js +34 -0
- package/dist/src/acp-integration/session/emitters/BaseEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.d.ts +41 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.js +77 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.test.js +174 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.d.ts +39 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.js +83 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.test.js +176 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.d.ts +80 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.js +248 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.js +561 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/index.d.ts +9 -0
- package/dist/src/acp-integration/session/emitters/index.js +10 -0
- package/dist/src/acp-integration/session/emitters/index.js.map +1 -0
- package/dist/src/acp-integration/session/index.d.ts +24 -0
- package/dist/src/acp-integration/session/index.js +16 -0
- package/dist/src/acp-integration/session/index.js.map +1 -0
- package/dist/src/acp-integration/session/types.d.ts +71 -0
- package/dist/src/acp-integration/session/types.js +7 -0
- package/dist/src/acp-integration/session/types.js.map +1 -0
- package/dist/src/commandMode.d.ts +11 -0
- package/dist/src/commandMode.js +238 -0
- package/dist/src/commandMode.js.map +1 -0
- package/dist/src/config/auth.d.ts +1 -0
- package/dist/src/config/auth.js +29 -0
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +19 -3
- package/dist/src/config/config.js +175 -24
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.js +0 -2
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/update.test.js +9 -0
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +53 -2
- package/dist/src/config/settingsSchema.js +46 -2
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/core/auth.d.ts +1 -1
- package/dist/src/core/auth.js +3 -2
- package/dist/src/core/auth.js.map +1 -1
- package/dist/src/core/initializer.js +3 -0
- package/dist/src/core/initializer.js.map +1 -1
- package/dist/src/gemini.js +75 -35
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +37 -4
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +3 -3
- package/dist/src/generated/git-commit.js +3 -3
- package/dist/src/i18n/index.d.ts +10 -2
- package/dist/src/i18n/index.js +26 -1
- package/dist/src/i18n/index.js.map +1 -1
- package/dist/src/i18n/languages.d.ts +20 -0
- package/dist/src/i18n/languages.js +36 -0
- package/dist/src/i18n/languages.js.map +1 -0
- package/dist/src/i18n/locales/de.js +1073 -0
- package/dist/src/i18n/locales/en.js +121 -175
- package/dist/src/i18n/locales/ru.js +1095 -0
- package/dist/src/i18n/locales/zh.js +52 -174
- package/dist/src/nonInteractive/control/ControlDispatcher.d.ts +24 -1
- package/dist/src/nonInteractive/control/ControlDispatcher.js +46 -17
- package/dist/src/nonInteractive/control/ControlDispatcher.js.map +1 -1
- package/dist/src/nonInteractive/control/ControlService.d.ts +2 -1
- package/dist/src/nonInteractive/control/ControlService.js +22 -37
- package/dist/src/nonInteractive/control/ControlService.js.map +1 -1
- package/dist/src/nonInteractive/control/controllers/baseController.d.ts +2 -1
- package/dist/src/nonInteractive/control/controllers/baseController.js +38 -5
- package/dist/src/nonInteractive/control/controllers/baseController.js.map +1 -1
- package/dist/src/nonInteractive/control/controllers/permissionController.d.ts +1 -22
- package/dist/src/nonInteractive/control/controllers/permissionController.js +38 -38
- package/dist/src/nonInteractive/control/controllers/permissionController.js.map +1 -1
- package/dist/src/nonInteractive/control/controllers/sdkMcpController.d.ts +54 -0
- package/dist/src/nonInteractive/control/controllers/sdkMcpController.js +84 -0
- package/dist/src/nonInteractive/control/controllers/sdkMcpController.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/systemController.d.ts +16 -6
- package/dist/src/nonInteractive/control/controllers/systemController.js +184 -44
- package/dist/src/nonInteractive/control/controllers/systemController.js.map +1 -1
- package/dist/src/nonInteractive/control/types/serviceAPIs.d.ts +1 -16
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.d.ts +11 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js +64 -5
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js.map +1 -1
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js +40 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js.map +1 -1
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js +50 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js.map +1 -1
- package/dist/src/nonInteractive/session.d.ts +0 -16
- package/dist/src/nonInteractive/session.js +317 -321
- package/dist/src/nonInteractive/session.js.map +1 -1
- package/dist/src/nonInteractive/session.test.js +6 -0
- package/dist/src/nonInteractive/session.test.js.map +1 -1
- package/dist/src/nonInteractive/types.d.ts +57 -3
- package/dist/src/nonInteractive/types.js +0 -1
- package/dist/src/nonInteractive/types.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +121 -56
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.d.ts +48 -9
- package/dist/src/nonInteractiveCliCommands.js +180 -64
- package/dist/src/nonInteractiveCliCommands.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.test.d.ts +6 -0
- package/dist/src/nonInteractiveCliCommands.test.js +157 -0
- package/dist/src/nonInteractiveCliCommands.test.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +7 -6
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +0 -3
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +4 -2
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +1 -1
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +11 -2
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/ui/AppContainer.js +62 -56
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +0 -46
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +4 -4
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/useAuth.js +31 -4
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/commands/approvalModeCommand.js +53 -4
- package/dist/src/ui/commands/approvalModeCommand.js.map +1 -1
- package/dist/src/ui/commands/approvalModeCommand.test.js +72 -10
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +22 -10
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.js +86 -16
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/languageCommand.d.ts +6 -1
- package/dist/src/ui/commands/languageCommand.js +162 -183
- package/dist/src/ui/commands/languageCommand.js.map +1 -1
- package/dist/src/ui/commands/languageCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/languageCommand.test.js +558 -0
- package/dist/src/ui/commands/languageCommand.test.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.js +4 -2
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.d.ts +0 -1
- package/dist/src/ui/commands/quitCommand.js +0 -27
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.js +1 -1
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
- package/dist/src/ui/commands/resumeCommand.js +19 -0
- package/dist/src/ui/commands/resumeCommand.js.map +1 -0
- package/dist/src/ui/commands/resumeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/resumeCommand.test.js +32 -0
- package/dist/src/ui/commands/resumeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/reviewCommand.d.ts +9 -0
- package/dist/src/ui/commands/reviewCommand.js +2046 -0
- package/dist/src/ui/commands/reviewCommand.js.map +1 -0
- package/dist/src/ui/commands/reviewCommand.test.js +600 -0
- package/dist/src/ui/commands/reviewCommand.test.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js +11 -10
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js +14 -14
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.js +129 -42
- package/dist/src/ui/commands/summaryCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +24 -10
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/ums/unittestCommand.d.ts +9 -0
- package/dist/src/ui/commands/ums/unittestCommand.js +387 -0
- package/dist/src/ui/commands/ums/unittestCommand.js.map +1 -0
- package/dist/src/ui/components/Composer.test.js +1 -2
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +3 -2
- package/dist/src/ui/components/ContextUsageDisplay.js +8 -2
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +7 -23
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/Footer.js +2 -3
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Help.js +13 -2
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/Help.test.js +6 -0
- package/dist/src/ui/components/Help.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +3 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +5 -2
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +6 -4
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.d.ts +3 -1
- package/dist/src/ui/components/ModelDialog.js +25 -5
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +3 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/SessionPicker.d.ts +18 -0
- package/dist/src/ui/components/SessionPicker.js +69 -0
- package/dist/src/ui/components/SessionPicker.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +14 -2
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +2 -2
- package/dist/src/ui/components/StandaloneSessionPicker.d.ts +10 -0
- package/dist/src/ui/components/StandaloneSessionPicker.js +78 -0
- package/dist/src/ui/components/StandaloneSessionPicker.js.map +1 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.d.ts +6 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.js +410 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +3 -2
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiThoughtMessage.d.ts +18 -0
- package/dist/src/ui/components/messages/GeminiThoughtMessage.js +14 -0
- package/dist/src/ui/components/messages/GeminiThoughtMessage.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiThoughtMessageContent.d.ts +18 -0
- package/dist/src/ui/components/messages/GeminiThoughtMessageContent.js +14 -0
- package/dist/src/ui/components/messages/GeminiThoughtMessageContent.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +4 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +2 -2
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.d.ts +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +24 -4
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/ums/umsStartupWarnings.d.ts +6 -0
- package/dist/src/ui/components/ums/umsStartupWarnings.js +47 -0
- package/dist/src/ui/components/ums/umsStartupWarnings.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.d.ts +2 -0
- package/dist/src/ui/contexts/SessionContext.js +18 -10
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +3 -1
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +3 -11
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +3 -8
- package/dist/src/ui/hooks/slashCommandProcessor.js +77 -101
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAttentionNotifications.d.ts +3 -1
- package/dist/src/ui/hooks/useAttentionNotifications.js +10 -5
- package/dist/src/ui/hooks/useAttentionNotifications.js.map +1 -1
- package/dist/src/ui/hooks/useAttentionNotifications.test.js +39 -2
- package/dist/src/ui/hooks/useAttentionNotifications.test.js.map +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +0 -3
- package/dist/src/ui/hooks/useDialogClose.js +0 -2
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +87 -12
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +11 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useLogger.d.ts +1 -1
- package/dist/src/ui/hooks/useLogger.js +6 -3
- package/dist/src/ui/hooks/useLogger.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +12 -136
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.js +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +2 -2
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useResumeCommand.d.ts +20 -0
- package/dist/src/ui/hooks/useResumeCommand.js +49 -0
- package/dist/src/ui/hooks/useResumeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useResumeCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useResumeCommand.test.js +144 -0
- package/dist/src/ui/hooks/useResumeCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useSessionPicker.d.ts +36 -0
- package/dist/src/ui/hooks/useSessionPicker.js +189 -0
- package/dist/src/ui/hooks/useSessionPicker.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +9 -1
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +36 -31
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +2 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/models/availableModels.d.ts +9 -2
- package/dist/src/ui/models/availableModels.js +32 -35
- package/dist/src/ui/models/availableModels.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +0 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -1
- package/dist/src/ui/types.d.ts +9 -14
- package/dist/src/ui/types.js +0 -1
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +2 -2
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +13 -13
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/formatters.d.ts +6 -0
- package/dist/src/ui/utils/formatters.js +31 -0
- package/dist/src/ui/utils/formatters.js.map +1 -1
- package/dist/src/ui/utils/formatters.test.js +51 -2
- package/dist/src/ui/utils/formatters.test.js.map +1 -1
- package/dist/src/ui/utils/resumeHistoryUtils.d.ts +19 -0
- package/dist/src/ui/utils/resumeHistoryUtils.js +267 -0
- package/dist/src/ui/utils/resumeHistoryUtils.js.map +1 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.js +253 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.js.map +1 -0
- package/dist/src/ui/utils/sessionPickerUtils.d.ts +30 -0
- package/dist/src/ui/utils/sessionPickerUtils.js +41 -0
- package/dist/src/ui/utils/sessionPickerUtils.js.map +1 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.js +38 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.js.map +1 -0
- package/dist/src/utils/attentionNotification.d.ts +1 -0
- package/dist/src/utils/attentionNotification.js +4 -0
- package/dist/src/utils/attentionNotification.js.map +1 -1
- package/dist/src/utils/errors.d.ts +1 -1
- package/dist/src/utils/errors.js +14 -3
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.js +43 -1
- package/dist/src/utils/errors.test.js.map +1 -1
- package/dist/src/utils/gitUtils.js +25 -8
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.test.js +59 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -1
- package/dist/src/utils/nonInteractiveHelpers.d.ts +3 -1
- package/dist/src/utils/nonInteractiveHelpers.js +14 -15
- package/dist/src/utils/nonInteractiveHelpers.js.map +1 -1
- package/dist/src/utils/nonInteractiveHelpers.test.js +36 -21
- package/dist/src/utils/nonInteractiveHelpers.test.js.map +1 -1
- package/dist/src/utils/relaunch.js +2 -2
- package/dist/src/utils/relaunch.js.map +1 -1
- package/dist/src/utils/relaunch.test.js +5 -5
- package/dist/src/utils/relaunch.test.js.map +1 -1
- package/dist/src/utils/systemInfo.js +2 -1
- package/dist/src/utils/systemInfo.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +10 -1
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/dist/src/nonInteractive/control/controllers/mcpController.d.ts +0 -42
- package/dist/src/nonInteractive/control/controllers/mcpController.js +0 -205
- package/dist/src/nonInteractive/control/controllers/mcpController.js.map +0 -1
- package/dist/src/ui/commands/chatCommand.d.ts +0 -9
- package/dist/src/ui/commands/chatCommand.js +0 -351
- package/dist/src/ui/commands/chatCommand.js.map +0 -1
- package/dist/src/ui/commands/corgiCommand.d.ts +0 -7
- package/dist/src/ui/commands/corgiCommand.js +0 -16
- package/dist/src/ui/commands/corgiCommand.js.map +0 -1
- package/dist/src/ui/components/ProQuotaDialog.d.ts +0 -13
- package/dist/src/ui/components/ProQuotaDialog.js +0 -24
- package/dist/src/ui/components/ProQuotaDialog.js.map +0 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +0 -58
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +0 -1
- package/dist/src/ui/components/QuitConfirmationDialog.d.ts +0 -17
- package/dist/src/ui/components/QuitConfirmationDialog.js +0 -49
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +0 -1
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +0 -23
- package/dist/src/ui/hooks/usePromptCompletion.js +0 -177
- package/dist/src/ui/hooks/usePromptCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useQuitConfirmation.d.ts +0 -14
- package/dist/src/ui/hooks/useQuitConfirmation.js +0 -36
- package/dist/src/ui/hooks/useQuitConfirmation.js.map +0 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +0 -21
- package/dist/src/ui/hooks/useQuotaAndFallback.js +0 -122
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +0 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +0 -269
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +0 -1
- package/dist/src/zed-integration/acp.js.map +0 -1
- package/dist/src/zed-integration/fileSystemService.js.map +0 -1
- package/dist/src/zed-integration/schema.js.map +0 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +0 -17
- package/dist/src/zed-integration/zedIntegration.js +0 -1135
- package/dist/src/zed-integration/zedIntegration.js.map +0 -1
- /package/dist/src/ui/{components/ProQuotaDialog.test.d.ts → commands/reviewCommand.test.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umsai/ums-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-v1",
|
|
4
4
|
"description": "UMS Code CLI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"config": {
|
|
39
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.
|
|
39
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.6.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@google/genai": "1.
|
|
42
|
+
"@google/genai": "1.30.0",
|
|
43
43
|
"@iarna/toml": "^2.2.5",
|
|
44
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
45
45
|
"@types/update-notifier": "^6.0.8",
|
|
46
|
-
"@umsai/ums-code-core": "0.
|
|
46
|
+
"@umsai/ums-code-core": "0.6.0-v1",
|
|
47
47
|
"ansi-regex": "^6.2.2",
|
|
48
48
|
"command-exists": "^1.2.9",
|
|
49
49
|
"comment-json": "^4.2.5",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dotenv": "^17.1.0",
|
|
52
52
|
"extract-zip": "^2.0.1",
|
|
53
53
|
"fzf": "^0.5.2",
|
|
54
|
-
"glob": "^10.
|
|
54
|
+
"glob": "^10.5.0",
|
|
55
55
|
"highlight.js": "^11.11.1",
|
|
56
56
|
"ink": "^6.4.0",
|
|
57
57
|
"ink-gradient": "^3.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"string-width": "^7.1.0",
|
|
68
68
|
"strip-ansi": "^7.1.0",
|
|
69
69
|
"strip-json-comments": "^3.1.1",
|
|
70
|
-
"tar": "^7.5.
|
|
70
|
+
"tar": "^7.5.2",
|
|
71
71
|
"undici": "^7.10.0",
|
|
72
72
|
"update-notifier": "^7.3.1",
|
|
73
73
|
"wrap-ansi": "9.0.2",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Qwen Team
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* MCP Controller
|
|
8
|
-
*
|
|
9
|
-
* Handles MCP-related control requests:
|
|
10
|
-
* - mcp_message: Route MCP messages
|
|
11
|
-
* - mcp_server_status: Return MCP server status
|
|
12
|
-
*/
|
|
13
|
-
import { BaseController } from './baseController.js';
|
|
14
|
-
import type { ControlRequestPayload } from '../../types.js';
|
|
15
|
-
export declare class MCPController extends BaseController {
|
|
16
|
-
/**
|
|
17
|
-
* Handle MCP control requests
|
|
18
|
-
*/
|
|
19
|
-
protected handleRequestPayload(payload: ControlRequestPayload, _signal: AbortSignal): Promise<Record<string, unknown>>;
|
|
20
|
-
/**
|
|
21
|
-
* Handle mcp_message request
|
|
22
|
-
*
|
|
23
|
-
* Routes JSON-RPC messages to MCP servers
|
|
24
|
-
*/
|
|
25
|
-
private handleMcpMessage;
|
|
26
|
-
/**
|
|
27
|
-
* Handle mcp_server_status request
|
|
28
|
-
*
|
|
29
|
-
* Returns status of registered MCP servers
|
|
30
|
-
*/
|
|
31
|
-
private handleMcpStatus;
|
|
32
|
-
/**
|
|
33
|
-
* Get or create MCP client for a server
|
|
34
|
-
*
|
|
35
|
-
* Implements lazy connection and caching
|
|
36
|
-
*/
|
|
37
|
-
private getOrCreateMcpClient;
|
|
38
|
-
/**
|
|
39
|
-
* Cleanup MCP clients
|
|
40
|
-
*/
|
|
41
|
-
cleanup(): void;
|
|
42
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Qwen Team
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* MCP Controller
|
|
8
|
-
*
|
|
9
|
-
* Handles MCP-related control requests:
|
|
10
|
-
* - mcp_message: Route MCP messages
|
|
11
|
-
* - mcp_server_status: Return MCP server status
|
|
12
|
-
*/
|
|
13
|
-
import { BaseController } from './baseController.js';
|
|
14
|
-
import { ResultSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
15
|
-
import { connectToMcpServer, MCP_DEFAULT_TIMEOUT_MSEC, } from '@umsai/ums-code-core';
|
|
16
|
-
export class MCPController extends BaseController {
|
|
17
|
-
/**
|
|
18
|
-
* Handle MCP control requests
|
|
19
|
-
*/
|
|
20
|
-
async handleRequestPayload(payload, _signal) {
|
|
21
|
-
switch (payload.subtype) {
|
|
22
|
-
case 'mcp_message':
|
|
23
|
-
return this.handleMcpMessage(payload);
|
|
24
|
-
case 'mcp_server_status':
|
|
25
|
-
return this.handleMcpStatus();
|
|
26
|
-
default:
|
|
27
|
-
throw new Error(`Unsupported request subtype in MCPController`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Handle mcp_message request
|
|
32
|
-
*
|
|
33
|
-
* Routes JSON-RPC messages to MCP servers
|
|
34
|
-
*/
|
|
35
|
-
async handleMcpMessage(payload) {
|
|
36
|
-
const serverNameRaw = payload.server_name;
|
|
37
|
-
if (typeof serverNameRaw !== 'string' ||
|
|
38
|
-
serverNameRaw.trim().length === 0) {
|
|
39
|
-
throw new Error('Missing server_name in mcp_message request');
|
|
40
|
-
}
|
|
41
|
-
const message = payload.message;
|
|
42
|
-
if (!message || typeof message !== 'object') {
|
|
43
|
-
throw new Error('Missing or invalid message payload for mcp_message request');
|
|
44
|
-
}
|
|
45
|
-
// Get or create MCP client
|
|
46
|
-
let clientEntry;
|
|
47
|
-
try {
|
|
48
|
-
clientEntry = await this.getOrCreateMcpClient(serverNameRaw.trim());
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
throw new Error(error instanceof Error
|
|
52
|
-
? error.message
|
|
53
|
-
: 'Failed to connect to MCP server');
|
|
54
|
-
}
|
|
55
|
-
const method = message.method;
|
|
56
|
-
if (typeof method !== 'string' || method.trim().length === 0) {
|
|
57
|
-
throw new Error('Invalid MCP message: missing method');
|
|
58
|
-
}
|
|
59
|
-
const jsonrpcVersion = typeof message.jsonrpc === 'string' ? message.jsonrpc : '2.0';
|
|
60
|
-
const messageId = message.id;
|
|
61
|
-
const params = message.params;
|
|
62
|
-
const timeout = typeof clientEntry.config.timeout === 'number'
|
|
63
|
-
? clientEntry.config.timeout
|
|
64
|
-
: MCP_DEFAULT_TIMEOUT_MSEC;
|
|
65
|
-
try {
|
|
66
|
-
// Handle notification (no id)
|
|
67
|
-
if (messageId === undefined) {
|
|
68
|
-
await clientEntry.client.notification({
|
|
69
|
-
method,
|
|
70
|
-
params,
|
|
71
|
-
});
|
|
72
|
-
return {
|
|
73
|
-
subtype: 'mcp_message',
|
|
74
|
-
mcp_response: {
|
|
75
|
-
jsonrpc: jsonrpcVersion,
|
|
76
|
-
id: null,
|
|
77
|
-
result: { success: true, acknowledged: true },
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
// Handle request (with id)
|
|
82
|
-
const result = await clientEntry.client.request({
|
|
83
|
-
method,
|
|
84
|
-
params,
|
|
85
|
-
}, ResultSchema, { timeout });
|
|
86
|
-
return {
|
|
87
|
-
subtype: 'mcp_message',
|
|
88
|
-
mcp_response: {
|
|
89
|
-
jsonrpc: jsonrpcVersion,
|
|
90
|
-
id: messageId,
|
|
91
|
-
result,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
// If connection closed, remove from cache
|
|
97
|
-
if (error instanceof Error && /closed/i.test(error.message)) {
|
|
98
|
-
this.context.mcpClients.delete(serverNameRaw.trim());
|
|
99
|
-
}
|
|
100
|
-
const errorCode = typeof error?.code === 'number'
|
|
101
|
-
? error.code
|
|
102
|
-
: -32603;
|
|
103
|
-
const errorMessage = error instanceof Error
|
|
104
|
-
? error.message
|
|
105
|
-
: 'Failed to execute MCP request';
|
|
106
|
-
const errorData = error?.data;
|
|
107
|
-
const errorBody = {
|
|
108
|
-
code: errorCode,
|
|
109
|
-
message: errorMessage,
|
|
110
|
-
};
|
|
111
|
-
if (errorData !== undefined) {
|
|
112
|
-
errorBody['data'] = errorData;
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
subtype: 'mcp_message',
|
|
116
|
-
mcp_response: {
|
|
117
|
-
jsonrpc: jsonrpcVersion,
|
|
118
|
-
id: messageId ?? null,
|
|
119
|
-
error: errorBody,
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Handle mcp_server_status request
|
|
126
|
-
*
|
|
127
|
-
* Returns status of registered MCP servers
|
|
128
|
-
*/
|
|
129
|
-
async handleMcpStatus() {
|
|
130
|
-
const status = {};
|
|
131
|
-
// Include SDK MCP servers
|
|
132
|
-
for (const serverName of this.context.sdkMcpServers) {
|
|
133
|
-
status[serverName] = 'connected';
|
|
134
|
-
}
|
|
135
|
-
// Include CLI-managed MCP clients
|
|
136
|
-
for (const serverName of this.context.mcpClients.keys()) {
|
|
137
|
-
status[serverName] = 'connected';
|
|
138
|
-
}
|
|
139
|
-
if (this.context.debugMode) {
|
|
140
|
-
console.error(`[MCPController] MCP status: ${Object.keys(status).length} servers`);
|
|
141
|
-
}
|
|
142
|
-
return status;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Get or create MCP client for a server
|
|
146
|
-
*
|
|
147
|
-
* Implements lazy connection and caching
|
|
148
|
-
*/
|
|
149
|
-
async getOrCreateMcpClient(serverName) {
|
|
150
|
-
// Check cache first
|
|
151
|
-
const cached = this.context.mcpClients.get(serverName);
|
|
152
|
-
if (cached) {
|
|
153
|
-
return cached;
|
|
154
|
-
}
|
|
155
|
-
// Get server configuration
|
|
156
|
-
const provider = this.context.config;
|
|
157
|
-
if (typeof provider.getMcpServers !== 'function') {
|
|
158
|
-
throw new Error(`MCP server "${serverName}" is not configured`);
|
|
159
|
-
}
|
|
160
|
-
const servers = provider.getMcpServers() ?? {};
|
|
161
|
-
const serverConfig = servers[serverName];
|
|
162
|
-
if (!serverConfig) {
|
|
163
|
-
throw new Error(`MCP server "${serverName}" is not configured`);
|
|
164
|
-
}
|
|
165
|
-
const debugMode = typeof provider.getDebugMode === 'function'
|
|
166
|
-
? provider.getDebugMode()
|
|
167
|
-
: false;
|
|
168
|
-
const workspaceContext = typeof provider.getWorkspaceContext === 'function'
|
|
169
|
-
? provider.getWorkspaceContext()
|
|
170
|
-
: undefined;
|
|
171
|
-
if (!workspaceContext) {
|
|
172
|
-
throw new Error('Workspace context is not available for MCP connection');
|
|
173
|
-
}
|
|
174
|
-
// Connect to MCP server
|
|
175
|
-
const client = await connectToMcpServer(serverName, serverConfig, debugMode, workspaceContext);
|
|
176
|
-
// Cache the client
|
|
177
|
-
const entry = { client, config: serverConfig };
|
|
178
|
-
this.context.mcpClients.set(serverName, entry);
|
|
179
|
-
if (this.context.debugMode) {
|
|
180
|
-
console.error(`[MCPController] Connected to MCP server: ${serverName}`);
|
|
181
|
-
}
|
|
182
|
-
return entry;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Cleanup MCP clients
|
|
186
|
-
*/
|
|
187
|
-
cleanup() {
|
|
188
|
-
if (this.context.debugMode) {
|
|
189
|
-
console.error(`[MCPController] Cleaning up ${this.context.mcpClients.size} MCP clients`);
|
|
190
|
-
}
|
|
191
|
-
// Close all MCP clients
|
|
192
|
-
for (const [serverName, { client }] of this.context.mcpClients.entries()) {
|
|
193
|
-
try {
|
|
194
|
-
client.close();
|
|
195
|
-
}
|
|
196
|
-
catch (error) {
|
|
197
|
-
if (this.context.debugMode) {
|
|
198
|
-
console.error(`[MCPController] Failed to close MCP client ${serverName}:`, error);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
this.context.mcpClients.clear();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
//# sourceMappingURL=mcpController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcpController.js","sourceRoot":"","sources":["../../../../../src/nonInteractive/control/controllers/mcpController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AASlE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,aAAc,SAAQ,cAAc;IAC/C;;OAEG;IACO,KAAK,CAAC,oBAAoB,CAClC,OAA8B,EAC9B,OAAoB;QAEpB,QAAQ,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,KAAK,aAAa;gBAChB,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAsC,CAAC,CAAC;YAEvE,KAAK,mBAAmB;gBACtB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;YAEhC;gBACE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,gBAAgB,CAC5B,OAAoC;QAEpC,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC;QAC1C,IACE,OAAO,aAAa,KAAK,QAAQ;YACjC,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACjC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAA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;QAED,wBAAwB;QACxB,KAAK,MAAM,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YACzE,IAAI,CAAC;gBACH,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;oBAC3B,OAAO,CAAC,KAAK,CACX,8CAA8C,UAAU,GAAG,EAC3D,KAAK,CACN,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { SlashCommand } from './types.js';
|
|
7
|
-
import type { Content } from '@google/genai';
|
|
8
|
-
export declare function serializeHistoryToMarkdown(history: Content[]): string;
|
|
9
|
-
export declare const chatCommand: SlashCommand;
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import * as fsPromises from 'fs/promises';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { Text } from 'ink';
|
|
9
|
-
import { CommandKind } from './types.js';
|
|
10
|
-
import { decodeTagName } from '@umsai/ums-code-core';
|
|
11
|
-
import path from 'node:path';
|
|
12
|
-
import { MessageType } from '../types.js';
|
|
13
|
-
import { t } from '../../i18n/index.js';
|
|
14
|
-
const getSavedChatTags = async (context, mtSortDesc) => {
|
|
15
|
-
const cfg = context.services.config;
|
|
16
|
-
const geminiDir = cfg?.storage?.getProjectTempDir();
|
|
17
|
-
if (!geminiDir) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
const file_head = 'checkpoint-';
|
|
22
|
-
const file_tail = '.json';
|
|
23
|
-
const files = await fsPromises.readdir(geminiDir);
|
|
24
|
-
const chatDetails = [];
|
|
25
|
-
for (const file of files) {
|
|
26
|
-
if (file.startsWith(file_head) && file.endsWith(file_tail)) {
|
|
27
|
-
const filePath = path.join(geminiDir, file);
|
|
28
|
-
const stats = await fsPromises.stat(filePath);
|
|
29
|
-
const tagName = file.slice(file_head.length, -file_tail.length);
|
|
30
|
-
chatDetails.push({
|
|
31
|
-
name: decodeTagName(tagName),
|
|
32
|
-
mtime: stats.mtime,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
chatDetails.sort((a, b) => mtSortDesc
|
|
37
|
-
? b.mtime.getTime() - a.mtime.getTime()
|
|
38
|
-
: a.mtime.getTime() - b.mtime.getTime());
|
|
39
|
-
return chatDetails;
|
|
40
|
-
}
|
|
41
|
-
catch (_err) {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const listCommand = {
|
|
46
|
-
name: 'list',
|
|
47
|
-
get description() {
|
|
48
|
-
return t('List saved conversation checkpoints');
|
|
49
|
-
},
|
|
50
|
-
kind: CommandKind.BUILT_IN,
|
|
51
|
-
action: async (context) => {
|
|
52
|
-
const chatDetails = await getSavedChatTags(context, false);
|
|
53
|
-
if (chatDetails.length === 0) {
|
|
54
|
-
return {
|
|
55
|
-
type: 'message',
|
|
56
|
-
messageType: 'info',
|
|
57
|
-
content: t('No saved conversation checkpoints found.'),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const maxNameLength = Math.max(...chatDetails.map((chat) => chat.name.length));
|
|
61
|
-
let message = t('List of saved conversations:') + '\n\n';
|
|
62
|
-
for (const chat of chatDetails) {
|
|
63
|
-
const paddedName = chat.name.padEnd(maxNameLength, ' ');
|
|
64
|
-
const isoString = chat.mtime.toISOString();
|
|
65
|
-
const match = isoString.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
|
|
66
|
-
const formattedDate = match ? `${match[1]} ${match[2]}` : 'Invalid Date';
|
|
67
|
-
message += ` - ${paddedName} (saved on ${formattedDate})\n`;
|
|
68
|
-
}
|
|
69
|
-
message += `\n${t('Note: Newest last, oldest first')}`;
|
|
70
|
-
return {
|
|
71
|
-
type: 'message',
|
|
72
|
-
messageType: 'info',
|
|
73
|
-
content: message,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
const saveCommand = {
|
|
78
|
-
name: 'save',
|
|
79
|
-
get description() {
|
|
80
|
-
return t('Save the current conversation as a checkpoint. Usage: /chat save <tag>');
|
|
81
|
-
},
|
|
82
|
-
kind: CommandKind.BUILT_IN,
|
|
83
|
-
action: async (context, args) => {
|
|
84
|
-
const tag = args.trim();
|
|
85
|
-
if (!tag) {
|
|
86
|
-
return {
|
|
87
|
-
type: 'message',
|
|
88
|
-
messageType: 'error',
|
|
89
|
-
content: t('Missing tag. Usage: /chat save <tag>'),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
const { logger, config } = context.services;
|
|
93
|
-
await logger.initialize();
|
|
94
|
-
if (!context.overwriteConfirmed) {
|
|
95
|
-
const exists = await logger.checkpointExists(tag);
|
|
96
|
-
if (exists) {
|
|
97
|
-
return {
|
|
98
|
-
type: 'confirm_action',
|
|
99
|
-
prompt: React.createElement(Text, null, t('A checkpoint with the tag {{tag}} already exists. Do you want to overwrite it?', {
|
|
100
|
-
tag,
|
|
101
|
-
})),
|
|
102
|
-
originalInvocation: {
|
|
103
|
-
raw: context.invocation?.raw || `/chat save ${tag}`,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const chat = await config?.getGeminiClient()?.getChat();
|
|
109
|
-
if (!chat) {
|
|
110
|
-
return {
|
|
111
|
-
type: 'message',
|
|
112
|
-
messageType: 'error',
|
|
113
|
-
content: t('No chat client available to save conversation.'),
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
const history = chat.getHistory();
|
|
117
|
-
if (history.length > 2) {
|
|
118
|
-
await logger.saveCheckpoint(history, tag);
|
|
119
|
-
return {
|
|
120
|
-
type: 'message',
|
|
121
|
-
messageType: 'info',
|
|
122
|
-
content: t('Conversation checkpoint saved with tag: {{tag}}.', {
|
|
123
|
-
tag: decodeTagName(tag),
|
|
124
|
-
}),
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return {
|
|
129
|
-
type: 'message',
|
|
130
|
-
messageType: 'info',
|
|
131
|
-
content: t('No conversation found to save.'),
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
const resumeCommand = {
|
|
137
|
-
name: 'resume',
|
|
138
|
-
altNames: ['load'],
|
|
139
|
-
get description() {
|
|
140
|
-
return t('Resume a conversation from a checkpoint. Usage: /chat resume <tag>');
|
|
141
|
-
},
|
|
142
|
-
kind: CommandKind.BUILT_IN,
|
|
143
|
-
action: async (context, args) => {
|
|
144
|
-
const tag = args.trim();
|
|
145
|
-
if (!tag) {
|
|
146
|
-
return {
|
|
147
|
-
type: 'message',
|
|
148
|
-
messageType: 'error',
|
|
149
|
-
content: t('Missing tag. Usage: /chat resume <tag>'),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
const { logger } = context.services;
|
|
153
|
-
await logger.initialize();
|
|
154
|
-
const conversation = await logger.loadCheckpoint(tag);
|
|
155
|
-
if (conversation.length === 0) {
|
|
156
|
-
return {
|
|
157
|
-
type: 'message',
|
|
158
|
-
messageType: 'info',
|
|
159
|
-
content: t('No saved checkpoint found with tag: {{tag}}.', {
|
|
160
|
-
tag: decodeTagName(tag),
|
|
161
|
-
}),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
const rolemap = {
|
|
165
|
-
user: MessageType.USER,
|
|
166
|
-
model: MessageType.GEMINI,
|
|
167
|
-
};
|
|
168
|
-
const uiHistory = [];
|
|
169
|
-
let hasSystemPrompt = false;
|
|
170
|
-
let i = 0;
|
|
171
|
-
for (const item of conversation) {
|
|
172
|
-
i += 1;
|
|
173
|
-
const text = item.parts
|
|
174
|
-
?.filter((m) => !!m.text)
|
|
175
|
-
.map((m) => m.text)
|
|
176
|
-
.join('') || '';
|
|
177
|
-
if (!text) {
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
if (i === 1 && text.match(/context for our chat/)) {
|
|
181
|
-
hasSystemPrompt = true;
|
|
182
|
-
}
|
|
183
|
-
if (i > 2 || !hasSystemPrompt) {
|
|
184
|
-
uiHistory.push({
|
|
185
|
-
type: (item.role && rolemap[item.role]) || MessageType.GEMINI,
|
|
186
|
-
text,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
type: 'load_history',
|
|
192
|
-
history: uiHistory,
|
|
193
|
-
clientHistory: conversation,
|
|
194
|
-
};
|
|
195
|
-
},
|
|
196
|
-
completion: async (context, partialArg) => {
|
|
197
|
-
const chatDetails = await getSavedChatTags(context, true);
|
|
198
|
-
return chatDetails
|
|
199
|
-
.map((chat) => chat.name)
|
|
200
|
-
.filter((name) => name.startsWith(partialArg));
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
const deleteCommand = {
|
|
204
|
-
name: 'delete',
|
|
205
|
-
get description() {
|
|
206
|
-
return t('Delete a conversation checkpoint. Usage: /chat delete <tag>');
|
|
207
|
-
},
|
|
208
|
-
kind: CommandKind.BUILT_IN,
|
|
209
|
-
action: async (context, args) => {
|
|
210
|
-
const tag = args.trim();
|
|
211
|
-
if (!tag) {
|
|
212
|
-
return {
|
|
213
|
-
type: 'message',
|
|
214
|
-
messageType: 'error',
|
|
215
|
-
content: t('Missing tag. Usage: /chat delete <tag>'),
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
const { logger } = context.services;
|
|
219
|
-
await logger.initialize();
|
|
220
|
-
const deleted = await logger.deleteCheckpoint(tag);
|
|
221
|
-
if (deleted) {
|
|
222
|
-
return {
|
|
223
|
-
type: 'message',
|
|
224
|
-
messageType: 'info',
|
|
225
|
-
content: t("Conversation checkpoint '{{tag}}' has been deleted.", {
|
|
226
|
-
tag: decodeTagName(tag),
|
|
227
|
-
}),
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
return {
|
|
232
|
-
type: 'message',
|
|
233
|
-
messageType: 'error',
|
|
234
|
-
content: t("Error: No checkpoint found with tag '{{tag}}'.", {
|
|
235
|
-
tag: decodeTagName(tag),
|
|
236
|
-
}),
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
completion: async (context, partialArg) => {
|
|
241
|
-
const chatDetails = await getSavedChatTags(context, true);
|
|
242
|
-
return chatDetails
|
|
243
|
-
.map((chat) => chat.name)
|
|
244
|
-
.filter((name) => name.startsWith(partialArg));
|
|
245
|
-
},
|
|
246
|
-
};
|
|
247
|
-
export function serializeHistoryToMarkdown(history) {
|
|
248
|
-
return history
|
|
249
|
-
.map((item) => {
|
|
250
|
-
const text = item.parts
|
|
251
|
-
?.map((part) => {
|
|
252
|
-
if (part.text) {
|
|
253
|
-
return part.text;
|
|
254
|
-
}
|
|
255
|
-
if (part.functionCall) {
|
|
256
|
-
return `**Tool Command**:\n\`\`\`json\n${JSON.stringify(part.functionCall, null, 2)}\n\`\`\``;
|
|
257
|
-
}
|
|
258
|
-
if (part.functionResponse) {
|
|
259
|
-
return `**Tool Response**:\n\`\`\`json\n${JSON.stringify(part.functionResponse, null, 2)}\n\`\`\``;
|
|
260
|
-
}
|
|
261
|
-
return '';
|
|
262
|
-
})
|
|
263
|
-
.join('') || '';
|
|
264
|
-
const roleIcon = item.role === 'user' ? '🧑💻' : '✨';
|
|
265
|
-
return `${roleIcon} ## ${(item.role || 'model').toUpperCase()}\n\n${text}`;
|
|
266
|
-
})
|
|
267
|
-
.join('\n\n---\n\n');
|
|
268
|
-
}
|
|
269
|
-
const shareCommand = {
|
|
270
|
-
name: 'share',
|
|
271
|
-
get description() {
|
|
272
|
-
return t('Share the current conversation to a markdown or json file. Usage: /chat share <file>');
|
|
273
|
-
},
|
|
274
|
-
kind: CommandKind.BUILT_IN,
|
|
275
|
-
action: async (context, args) => {
|
|
276
|
-
let filePathArg = args.trim();
|
|
277
|
-
if (!filePathArg) {
|
|
278
|
-
filePathArg = `gemini-conversation-${Date.now()}.json`;
|
|
279
|
-
}
|
|
280
|
-
const filePath = path.resolve(filePathArg);
|
|
281
|
-
const extension = path.extname(filePath);
|
|
282
|
-
if (extension !== '.md' && extension !== '.json') {
|
|
283
|
-
return {
|
|
284
|
-
type: 'message',
|
|
285
|
-
messageType: 'error',
|
|
286
|
-
content: t('Invalid file format. Only .md and .json are supported.'),
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
const chat = await context.services.config?.getGeminiClient()?.getChat();
|
|
290
|
-
if (!chat) {
|
|
291
|
-
return {
|
|
292
|
-
type: 'message',
|
|
293
|
-
messageType: 'error',
|
|
294
|
-
content: t('No chat client available to share conversation.'),
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
const history = chat.getHistory();
|
|
298
|
-
// An empty conversation has two hidden messages that setup the context for
|
|
299
|
-
// the chat. Thus, to check whether a conversation has been started, we
|
|
300
|
-
// can't check for length 0.
|
|
301
|
-
if (history.length <= 2) {
|
|
302
|
-
return {
|
|
303
|
-
type: 'message',
|
|
304
|
-
messageType: 'info',
|
|
305
|
-
content: t('No conversation found to share.'),
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
let content = '';
|
|
309
|
-
if (extension === '.json') {
|
|
310
|
-
content = JSON.stringify(history, null, 2);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
content = serializeHistoryToMarkdown(history);
|
|
314
|
-
}
|
|
315
|
-
try {
|
|
316
|
-
await fsPromises.writeFile(filePath, content);
|
|
317
|
-
return {
|
|
318
|
-
type: 'message',
|
|
319
|
-
messageType: 'info',
|
|
320
|
-
content: t('Conversation shared to {{filePath}}', {
|
|
321
|
-
filePath,
|
|
322
|
-
}),
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
catch (err) {
|
|
326
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
327
|
-
return {
|
|
328
|
-
type: 'message',
|
|
329
|
-
messageType: 'error',
|
|
330
|
-
content: t('Error sharing conversation: {{error}}', {
|
|
331
|
-
error: errorMessage,
|
|
332
|
-
}),
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
};
|
|
337
|
-
export const chatCommand = {
|
|
338
|
-
name: 'chat',
|
|
339
|
-
get description() {
|
|
340
|
-
return t('Manage conversation history.');
|
|
341
|
-
},
|
|
342
|
-
kind: CommandKind.BUILT_IN,
|
|
343
|
-
subCommands: [
|
|
344
|
-
listCommand,
|
|
345
|
-
saveCommand,
|
|
346
|
-
resumeCommand,
|
|
347
|
-
deleteCommand,
|
|
348
|
-
shareCommand,
|
|
349
|
-
],
|
|
350
|
-
};
|
|
351
|
-
//# sourceMappingURL=chatCommand.js.map
|