@umsai/ums-code 0.0.14-v1 → 0.0.14-v2
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/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +10 -7
- package/dist/src/commands/extensions/disable.d.ts +14 -0
- package/dist/src/commands/extensions/disable.js +42 -0
- package/dist/src/commands/extensions/disable.js.map +1 -0
- package/dist/src/commands/extensions/enable.d.ts +14 -0
- package/dist/src/commands/extensions/enable.js +48 -0
- package/dist/src/commands/extensions/enable.js.map +1 -0
- package/dist/src/commands/extensions/install.d.ts +13 -0
- package/dist/src/commands/extensions/install.js +48 -0
- package/dist/src/commands/extensions/install.js.map +1 -0
- package/dist/src/commands/extensions/install.test.d.ts +6 -0
- package/dist/src/commands/extensions/install.test.js +25 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -0
- package/dist/src/commands/extensions/list.d.ts +8 -0
- package/dist/src/commands/extensions/list.js +32 -0
- package/dist/src/commands/extensions/list.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.d.ts +12 -0
- package/dist/src/commands/extensions/uninstall.js +38 -0
- package/dist/src/commands/extensions/uninstall.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
- package/dist/src/commands/extensions/uninstall.test.js +18 -0
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
- package/dist/src/commands/extensions/update.d.ts +12 -0
- package/dist/src/commands/extensions/update.js +38 -0
- package/dist/src/commands/extensions/update.js.map +1 -0
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +29 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +167 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +110 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +44 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +23 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/config/auth.js +13 -12
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.d.ts +6 -0
- package/dist/src/config/auth.test.js +57 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/config.d.ts +11 -9
- package/dist/src/config/config.js +257 -133
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +41 -3
- package/dist/src/config/extension.js +277 -18
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/variableSchema.d.ts +28 -0
- package/dist/src/config/extensions/variableSchema.js +18 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -0
- package/dist/src/config/extensions/variables.d.ts +17 -0
- package/dist/src/config/extensions/variables.js +40 -0
- package/dist/src/config/extensions/variables.js.map +1 -0
- package/dist/src/config/extensions/variables.test.d.ts +6 -0
- package/dist/src/config/extensions/variables.test.js +17 -0
- package/dist/src/config/extensions/variables.test.js.map +1 -0
- package/dist/src/config/keyBindings.d.ts +66 -0
- package/dist/src/config/keyBindings.js +141 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/keyBindings.test.d.ts +6 -0
- package/dist/src/config/keyBindings.test.js +51 -0
- package/dist/src/config/keyBindings.test.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +2 -2
- package/dist/src/config/sandboxConfig.js +8 -10
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +14 -69
- package/dist/src/config/settings.js +425 -94
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +884 -0
- package/dist/src/config/settingsSchema.js +857 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/config/settingsSchema.test.d.ts +6 -0
- package/dist/src/config/settingsSchema.test.js +194 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +37 -0
- package/dist/src/config/trustedFolders.js +118 -0
- package/dist/src/config/trustedFolders.js.map +1 -0
- package/dist/src/config/trustedFolders.test.d.ts +6 -0
- package/dist/src/config/trustedFolders.test.js +164 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- package/dist/src/gemini.d.ts +3 -1
- package/dist/src/gemini.js +118 -99
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +247 -0
- package/dist/src/gemini.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +2 -1
- package/dist/src/generated/git-commit.js +2 -1
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +1 -1
- package/dist/src/nonInteractiveCli.js +26 -42
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +3 -4
- package/dist/src/services/BuiltinCommandLoader.js +15 -4
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
- package/dist/src/services/BuiltinCommandLoader.test.js +130 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +2 -2
- package/dist/src/services/CommandService.test.d.ts +6 -0
- package/dist/src/services/CommandService.test.js +233 -0
- package/dist/src/services/CommandService.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +3 -3
- package/dist/src/services/FileCommandLoader.js +31 -19
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.d.ts +14 -4
- package/dist/src/services/McpPromptLoader.js +46 -20
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
- package/dist/src/services/McpPromptLoader.test.js +114 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +5 -10
- package/dist/src/services/prompt-processors/argumentProcessor.js +5 -12
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +62 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
- package/dist/src/services/prompt-processors/injectionParser.js +60 -0
- package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +11 -16
- package/dist/src/services/prompt-processors/shellProcessor.js +85 -41
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/types.d.ts +15 -8
- package/dist/src/services/prompt-processors/types.js +6 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -1
- package/dist/src/services/types.d.ts +1 -1
- package/dist/src/test-utils/customMatchers.d.ts +14 -0
- package/dist/src/test-utils/customMatchers.js +40 -0
- package/dist/src/test-utils/customMatchers.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
- package/dist/src/test-utils/mockCommandContext.js +90 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
- package/dist/src/test-utils/mockCommandContext.test.js +51 -0
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +8 -0
- package/dist/src/test-utils/render.js +10 -0
- package/dist/src/test-utils/render.js.map +1 -0
- package/dist/src/ui/App.d.ts +2 -2
- package/dist/src/ui/App.js +342 -70
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +52 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/colors.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.js +10 -6
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
- package/dist/src/ui/commands/agentsCommand.js +32 -0
- package/dist/src/ui/commands/agentsCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.d.ts +7 -0
- package/dist/src/ui/commands/approvalModeCommand.js +340 -0
- package/dist/src/ui/commands/approvalModeCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js +293 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +1 -1
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +13 -5
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +1 -1
- package/dist/src/ui/commands/chatCommand.js +27 -9
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.d.ts +1 -1
- package/dist/src/ui/commands/clearCommand.js +0 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +1 -1
- package/dist/src/ui/commands/compressCommand.js +2 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.d.ts +1 -1
- package/dist/src/ui/commands/copyCommand.js +2 -2
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/directoryCommand.js +7 -8
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/docsCommand.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.d.ts +1 -1
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +2 -2
- package/dist/src/ui/commands/ideCommand.js +92 -22
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.d.ts +2 -2
- package/dist/src/ui/commands/initCommand.js +20 -10
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.d.ts +1 -1
- package/dist/src/ui/commands/mcpCommand.js +12 -8
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/memoryCommand.js +143 -9
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +68 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/modelCommand.test.js +138 -0
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
- package/dist/src/ui/commands/privacyCommand.d.ts +1 -1
- package/dist/src/ui/commands/privacyCommand.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.d.ts +1 -0
- package/dist/src/ui/commands/quitCommand.js +25 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +1 -1
- package/dist/src/ui/commands/restoreCommand.js +4 -8
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +16 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.d.ts +3 -1
- package/dist/src/ui/commands/setupGithubCommand.js +133 -27
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js +167 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.d.ts +7 -0
- package/dist/src/ui/commands/summaryCommand.js +149 -0
- package/dist/src/ui/commands/summaryCommand.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
- package/dist/src/ui/commands/terminalSetupCommand.js +41 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +1 -1
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +1 -1
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +26 -11
- package/dist/src/ui/commands/types.js +1 -0
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.d.ts +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.js +54 -20
- package/dist/src/ui/commands/ums/umsInitCommand.js.map +1 -1
- package/dist/src/ui/commands/vimCommand.d.ts +1 -1
- package/dist/src/ui/commands/vimCommand.js.map +1 -1
- package/dist/src/ui/components/AboutBox.d.ts +2 -1
- package/dist/src/ui/components/AboutBox.js +1 -1
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +1 -0
- package/dist/src/ui/components/AsciiArt.js +8 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.d.ts +2 -2
- package/dist/src/ui/components/AuthDialog.js +23 -22
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/components/AuthDialog.test.js +280 -0
- package/dist/src/ui/components/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/components/AuthInProgress.d.ts +1 -1
- package/dist/src/ui/components/AuthInProgress.js +6 -10
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.js +8 -3
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +23 -25
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +9 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +14 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.js +5 -4
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +2 -2
- package/dist/src/ui/components/DetailedMessagesDisplay.js +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +4 -3
- package/dist/src/ui/components/EditorSettingsDialog.js +14 -16
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
- package/dist/src/ui/components/FolderTrustDialog.js +45 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js +63 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +2 -1
- package/dist/src/ui/components/Footer.js +16 -6
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.js +5 -3
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +1 -2
- package/dist/src/ui/components/Header.js +13 -5
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Header.test.d.ts +6 -0
- package/dist/src/ui/components/Header.test.js +37 -0
- package/dist/src/ui/components/Header.test.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +2 -2
- package/dist/src/ui/components/Help.js +2 -2
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -5
- package/dist/src/ui/components/HistoryItemDisplay.js +5 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js +93 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +6 -5
- package/dist/src/ui/components/InputPrompt.js +238 -53
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +2 -2
- package/dist/src/ui/components/LoadingIndicator.js +10 -5
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/LoadingIndicator.test.js +190 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.js +0 -5
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSelectionDialog.d.ts +14 -0
- package/dist/src/ui/components/ModelSelectionDialog.js +26 -0
- package/dist/src/ui/components/ModelSelectionDialog.js.map +1 -0
- package/dist/src/ui/components/ModelSelectionDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelSelectionDialog.test.js +124 -0
- package/dist/src/ui/components/ModelSelectionDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.d.ts +15 -0
- package/dist/src/ui/components/ModelSwitchDialog.js +37 -0
- package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js +125 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.js +0 -5
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +44 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -0
- package/dist/src/ui/components/PlanSummaryDisplay.d.ts +14 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js +9 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +1 -1
- package/dist/src/ui/components/QuitConfirmationDialog.d.ts +17 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js +44 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/QwenOAuthProgress.d.ts +2 -2
- package/dist/src/ui/components/QwenOAuthProgress.js +0 -5
- package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
- package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +6 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js +292 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +15 -0
- package/dist/src/ui/components/SettingsDialog.js +550 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsDialog.test.js +646 -0
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +8 -6
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +40 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.js +9 -8
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +12 -4
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +3 -2
- package/dist/src/ui/components/ThemeDialog.js +14 -29
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/Tips.d.ts +1 -1
- package/dist/src/ui/components/Tips.js +1 -0
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/TodoDisplay.d.ts +16 -0
- package/dist/src/ui/components/TodoDisplay.js +27 -0
- package/dist/src/ui/components/TodoDisplay.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/TodoDisplay.test.js +77 -0
- package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +13 -0
- package/dist/src/ui/components/WelcomeBackDialog.js +32 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +11 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +42 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +2 -2
- package/dist/src/ui/components/messages/CompressionMessage.js +2 -1
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +16 -3
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js +239 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +2 -1
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +1 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +6 -1
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/SummaryMessage.js +35 -0
- package/dist/src/ui/components/messages/SummaryMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +4 -3
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +111 -35
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +137 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +4 -4
- package/dist/src/ui/components/messages/ToolGroupMessage.js +2 -7
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +259 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +3 -1
- package/dist/src/ui/components/messages/ToolMessage.js +88 -11
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js +149 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +4 -2
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +12 -15
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +111 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.d.ts +16 -0
- package/dist/src/ui/components/shared/TextInput.js +127 -0
- package/dist/src/ui/components/shared/TextInput.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +17 -4
- package/dist/src/ui/components/shared/text-buffer.js +235 -97
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.js +139 -152
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/components/subagents/constants.d.ts +23 -0
- package/dist/src/ui/components/subagents/constants.js +67 -0
- package/dist/src/ui/components/subagents/constants.js.map +1 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +174 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js +42 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js +163 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +105 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +33 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js +33 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +26 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +28 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +16 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js +143 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/index.d.ts +8 -0
- package/dist/src/ui/components/subagents/index.js +12 -0
- package/dist/src/ui/components/subagents/index.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +46 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +33 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +63 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +12 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +225 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +11 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +19 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +212 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/components/subagents/reducers.d.ts +14 -0
- package/dist/src/ui/components/subagents/reducers.js +162 -0
- package/dist/src/ui/components/subagents/reducers.js.map +1 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +20 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +194 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -0
- package/dist/src/ui/components/subagents/types.d.ts +137 -0
- package/dist/src/ui/components/subagents/types.js +15 -0
- package/dist/src/ui/components/subagents/types.js.map +1 -0
- package/dist/src/ui/components/subagents/utils.d.ts +15 -0
- package/dist/src/ui/components/subagents/utils.js +79 -0
- package/dist/src/ui/components/subagents/utils.js.map +1 -0
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +4 -4
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.d.ts +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.js +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.js.map +1 -1
- package/dist/src/ui/constants.d.ts +8 -0
- package/dist/src/ui/constants.js +9 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +32 -0
- package/dist/src/ui/contexts/KeypressContext.js +371 -0
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js +894 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
- package/dist/src/ui/contexts/OverflowContext.d.ts +1 -1
- package/dist/src/ui/contexts/OverflowContext.js +0 -5
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +5 -3
- package/dist/src/ui/contexts/SessionContext.js +3 -16
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/contexts/StreamingContext.d.ts +1 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +1 -1
- package/dist/src/ui/contexts/VimModeContext.js +4 -4
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +3 -3
- package/dist/src/ui/hooks/atCommandProcessor.js +20 -20
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +832 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +3 -3
- package/dist/src/ui/hooks/shellCommandProcessor.js +15 -19
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +329 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +14 -6
- package/dist/src/ui/hooks/slashCommandProcessor.js +243 -65
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js +21 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js +6 -4
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +2 -2
- package/dist/src/ui/hooks/useAuthCommand.js +5 -4
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +4 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +20 -19
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +263 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +8 -5
- package/dist/src/ui/hooks/useCommandCompletion.js +30 -9
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCompletion.js +1 -1
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +34 -0
- package/dist/src/ui/hooks/useDialogClose.js +62 -0
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.d.ts +2 -2
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +4 -0
- package/dist/src/ui/hooks/useFocus.js +4 -4
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +13 -0
- package/dist/src/ui/hooks/useFolderTrust.js +64 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +10 -5
- package/dist/src/ui/hooks/useGeminiStream.js +118 -71
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js +175 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js +171 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +4 -16
- package/dist/src/ui/hooks/useKeypress.js +8 -140
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
- package/dist/src/ui/hooks/useLaunchEditor.d.ts +10 -0
- package/dist/src/ui/hooks/useLaunchEditor.js +70 -0
- package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +91 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useLogger.d.ts +2 -1
- package/dist/src/ui/hooks/useLogger.js +3 -3
- package/dist/src/ui/hooks/useLogger.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +22 -0
- package/dist/src/ui/hooks/useMessageQueue.js +49 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js +158 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +6 -2
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js +154 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -0
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/usePromptCompletion.js +177 -0
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useQuitConfirmation.d.ts +14 -0
- package/dist/src/ui/hooks/useQuitConfirmation.js +36 -0
- package/dist/src/ui/hooks/useQuitConfirmation.js.map +1 -0
- package/dist/src/ui/hooks/useQwenAuth.d.ts +1 -1
- package/dist/src/ui/hooks/useQwenAuth.js +1 -1
- package/dist/src/ui/hooks/useQwenAuth.js.map +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js +292 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -3
- package/dist/src/ui/hooks/useReactToolScheduler.js +17 -18
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +2 -1
- package/dist/src/ui/hooks/useShellHistory.js +9 -10
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +187 -0
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +3 -3
- package/dist/src/ui/hooks/useShowMemoryCommand.js +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +272 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +10 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js +21 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +9 -9
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTimer.test.js +90 -0
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +850 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +47 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.js +262 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +1 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.d.ts +6 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +515 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +1 -0
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +23 -0
- package/dist/src/ui/hooks/useWelcomeBack.js +79 -0
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +13 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.js +53 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +27 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/keyMatchers.test.js +276 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- package/dist/src/ui/models/availableModels.d.ts +29 -0
- package/dist/src/ui/models/availableModels.js +40 -0
- package/dist/src/ui/models/availableModels.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/textConstants.d.ts +9 -0
- package/dist/src/ui/textConstants.js +10 -0
- package/dist/src/ui/textConstants.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.js +2 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
- package/dist/src/ui/themes/color-utils.test.js +197 -0
- package/dist/src/ui/themes/color-utils.test.js.map +1 -0
- package/dist/src/ui/themes/googlecode.js +1 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +30 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/qwen-dark.js +2 -1
- package/dist/src/ui/themes/qwen-dark.js.map +1 -1
- package/dist/src/ui/themes/qwen-light.js +2 -1
- package/dist/src/ui/themes/qwen-light.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
- package/dist/src/ui/themes/semantic-tokens.js +94 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +9 -1
- package/dist/src/ui/themes/theme-manager.js +81 -7
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.test.js +142 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +45 -2
- package/dist/src/ui/themes/theme.js +120 -107
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +34 -6
- package/dist/src/ui/types.js +2 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +3 -2
- package/dist/src/ui/utils/CodeColorizer.js +5 -4
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +2 -1
- package/dist/src/ui/utils/ConsolePatcher.js +4 -1
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +8 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +5 -3
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js +161 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.js +4 -4
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.test.js +65 -0
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +2 -1
- package/dist/src/ui/utils/commandUtils.js +74 -15
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/commandUtils.test.js +349 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +1 -1
- package/dist/src/ui/utils/computeStats.js +3 -1
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +42 -0
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
- package/dist/src/ui/utils/formatters.test.d.ts +6 -0
- package/dist/src/ui/utils/formatters.test.js +56 -0
- package/dist/src/ui/utils/formatters.test.js.map +1 -0
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +13 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +88 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
- package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
- package/dist/src/ui/utils/platformConstants.d.ts +52 -0
- package/dist/src/ui/utils/platformConstants.js +53 -0
- package/dist/src/ui/utils/platformConstants.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
- package/dist/src/ui/utils/terminalSetup.js +281 -0
- package/dist/src/ui/utils/terminalSetup.js.map +1 -0
- package/dist/src/ui/utils/textUtils.d.ts +18 -0
- package/dist/src/ui/utils/textUtils.js +44 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.d.ts +2 -2
- package/dist/src/ui/utils/updateCheck.js +2 -2
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.test.js +145 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
- package/dist/src/utils/checks.d.ts +19 -0
- package/dist/src/utils/checks.js +24 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +7 -6
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +32 -0
- package/dist/src/utils/dialogScopeUtils.js +48 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/errors.d.ts +6 -0
- package/dist/src/utils/errors.js +12 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/events.d.ts +1 -1
- package/dist/src/utils/events.js +1 -1
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/gitUtils.d.ts +21 -1
- package/dist/src/utils/gitUtils.js +69 -4
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.test.d.ts +6 -0
- package/dist/src/utils/gitUtils.test.js +113 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.d.ts +4 -4
- package/dist/src/utils/handleAutoUpdate.js +4 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/installationInfo.js +3 -3
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.d.ts +6 -0
- package/dist/src/utils/installationInfo.test.js +242 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -0
- package/dist/src/utils/package.js +2 -2
- package/dist/src/utils/package.js.map +1 -1
- package/dist/src/utils/readStdin.js +25 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/readStdin.test.d.ts +6 -0
- package/dist/src/utils/readStdin.test.js +88 -0
- package/dist/src/utils/readStdin.test.js.map +1 -0
- package/dist/src/utils/resolvePath.js +2 -2
- package/dist/src/utils/resolvePath.js.map +1 -1
- package/dist/src/utils/sandbox.d.ts +2 -2
- package/dist/src/utils/sandbox.js +460 -444
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +134 -0
- package/dist/src/utils/settingsUtils.js +330 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/src/utils/settingsUtils.test.d.ts +6 -0
- package/dist/src/utils/settingsUtils.test.js +511 -0
- package/dist/src/utils/settingsUtils.test.js.map +1 -0
- package/dist/src/utils/spawnWrapper.d.ts +1 -1
- package/dist/src/utils/spawnWrapper.js +1 -1
- package/dist/src/utils/spawnWrapper.js.map +1 -1
- package/dist/src/utils/startupWarnings.js +2 -2
- package/dist/src/utils/startupWarnings.js.map +1 -1
- package/dist/src/utils/updateEventEmitter.d.ts +1 -1
- package/dist/src/utils/updateEventEmitter.js +1 -1
- package/dist/src/utils/updateEventEmitter.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +3 -3
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.test.js +67 -0
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.js +1 -1
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +1 -1
- package/dist/src/validateNonInterActiveAuth.js +4 -7
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.d.ts +63 -0
- package/dist/src/{acp → zed-integration}/acp.js +78 -45
- package/dist/src/zed-integration/acp.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.d.ts +19 -0
- package/dist/src/zed-integration/fileSystemService.js +43 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -0
- package/dist/src/zed-integration/schema.d.ts +11782 -0
- package/dist/src/zed-integration/schema.js +311 -0
- package/dist/src/zed-integration/schema.js.map +1 -0
- package/dist/src/zed-integration/zedIntegration.d.ts +10 -0
- package/dist/src/zed-integration/zedIntegration.js +787 -0
- package/dist/src/zed-integration/zedIntegration.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -7
- package/dist/src/acp/acp.d.ts +0 -208
- package/dist/src/acp/acp.js.map +0 -1
- package/dist/src/acp/acpPeer.d.ts +0 -8
- package/dist/src/acp/acpPeer.js +0 -537
- package/dist/src/acp/acpPeer.js.map +0 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +0 -1
- package/dist/src/ui/utils/errorParsing.d.ts +0 -7
- package/dist/src/ui/utils/errorParsing.js +0 -90
- package/dist/src/ui/utils/errorParsing.js.map +0 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
7
|
+
import { CommandService } from './CommandService.js';
|
|
8
|
+
import {} from './types.js';
|
|
9
|
+
import { CommandKind } from '../ui/commands/types.js';
|
|
10
|
+
const createMockCommand = (name, kind) => ({
|
|
11
|
+
name,
|
|
12
|
+
description: `Description for ${name}`,
|
|
13
|
+
kind,
|
|
14
|
+
action: vi.fn(),
|
|
15
|
+
});
|
|
16
|
+
const mockCommandA = createMockCommand('command-a', CommandKind.BUILT_IN);
|
|
17
|
+
const mockCommandB = createMockCommand('command-b', CommandKind.BUILT_IN);
|
|
18
|
+
const mockCommandC = createMockCommand('command-c', CommandKind.FILE);
|
|
19
|
+
const mockCommandB_Override = createMockCommand('command-b', CommandKind.FILE);
|
|
20
|
+
class MockCommandLoader {
|
|
21
|
+
commandsToLoad;
|
|
22
|
+
constructor(commandsToLoad) {
|
|
23
|
+
this.commandsToLoad = commandsToLoad;
|
|
24
|
+
}
|
|
25
|
+
loadCommands = vi.fn(async () => Promise.resolve(this.commandsToLoad));
|
|
26
|
+
}
|
|
27
|
+
describe('CommandService', () => {
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
vi.spyOn(console, 'debug').mockImplementation(() => { });
|
|
30
|
+
});
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
vi.restoreAllMocks();
|
|
33
|
+
});
|
|
34
|
+
it('should load commands from a single loader', async () => {
|
|
35
|
+
const mockLoader = new MockCommandLoader([mockCommandA, mockCommandB]);
|
|
36
|
+
const service = await CommandService.create([mockLoader], new AbortController().signal);
|
|
37
|
+
const commands = service.getCommands();
|
|
38
|
+
expect(mockLoader.loadCommands).toHaveBeenCalledTimes(1);
|
|
39
|
+
expect(commands).toHaveLength(2);
|
|
40
|
+
expect(commands).toEqual(expect.arrayContaining([mockCommandA, mockCommandB]));
|
|
41
|
+
});
|
|
42
|
+
it('should aggregate commands from multiple loaders', async () => {
|
|
43
|
+
const loader1 = new MockCommandLoader([mockCommandA]);
|
|
44
|
+
const loader2 = new MockCommandLoader([mockCommandC]);
|
|
45
|
+
const service = await CommandService.create([loader1, loader2], new AbortController().signal);
|
|
46
|
+
const commands = service.getCommands();
|
|
47
|
+
expect(loader1.loadCommands).toHaveBeenCalledTimes(1);
|
|
48
|
+
expect(loader2.loadCommands).toHaveBeenCalledTimes(1);
|
|
49
|
+
expect(commands).toHaveLength(2);
|
|
50
|
+
expect(commands).toEqual(expect.arrayContaining([mockCommandA, mockCommandC]));
|
|
51
|
+
});
|
|
52
|
+
it('should override commands from earlier loaders with those from later loaders', async () => {
|
|
53
|
+
const loader1 = new MockCommandLoader([mockCommandA, mockCommandB]);
|
|
54
|
+
const loader2 = new MockCommandLoader([
|
|
55
|
+
mockCommandB_Override,
|
|
56
|
+
mockCommandC,
|
|
57
|
+
]);
|
|
58
|
+
const service = await CommandService.create([loader1, loader2], new AbortController().signal);
|
|
59
|
+
const commands = service.getCommands();
|
|
60
|
+
expect(commands).toHaveLength(3); // Should be A, C, and the overridden B.
|
|
61
|
+
// The final list should contain the override from the *last* loader.
|
|
62
|
+
const commandB = commands.find((cmd) => cmd.name === 'command-b');
|
|
63
|
+
expect(commandB).toBeDefined();
|
|
64
|
+
expect(commandB?.kind).toBe(CommandKind.FILE); // Verify it's the overridden version.
|
|
65
|
+
expect(commandB).toEqual(mockCommandB_Override);
|
|
66
|
+
// Ensure the other commands are still present.
|
|
67
|
+
expect(commands).toEqual(expect.arrayContaining([
|
|
68
|
+
mockCommandA,
|
|
69
|
+
mockCommandC,
|
|
70
|
+
mockCommandB_Override,
|
|
71
|
+
]));
|
|
72
|
+
});
|
|
73
|
+
it('should handle loaders that return an empty array of commands gracefully', async () => {
|
|
74
|
+
const loader1 = new MockCommandLoader([mockCommandA]);
|
|
75
|
+
const emptyLoader = new MockCommandLoader([]);
|
|
76
|
+
const loader3 = new MockCommandLoader([mockCommandB]);
|
|
77
|
+
const service = await CommandService.create([loader1, emptyLoader, loader3], new AbortController().signal);
|
|
78
|
+
const commands = service.getCommands();
|
|
79
|
+
expect(emptyLoader.loadCommands).toHaveBeenCalledTimes(1);
|
|
80
|
+
expect(commands).toHaveLength(2);
|
|
81
|
+
expect(commands).toEqual(expect.arrayContaining([mockCommandA, mockCommandB]));
|
|
82
|
+
});
|
|
83
|
+
it('should load commands from successful loaders even if one fails', async () => {
|
|
84
|
+
const successfulLoader = new MockCommandLoader([mockCommandA]);
|
|
85
|
+
const failingLoader = new MockCommandLoader([]);
|
|
86
|
+
const error = new Error('Loader failed');
|
|
87
|
+
vi.spyOn(failingLoader, 'loadCommands').mockRejectedValue(error);
|
|
88
|
+
const service = await CommandService.create([successfulLoader, failingLoader], new AbortController().signal);
|
|
89
|
+
const commands = service.getCommands();
|
|
90
|
+
expect(commands).toHaveLength(1);
|
|
91
|
+
expect(commands).toEqual([mockCommandA]);
|
|
92
|
+
expect(console.debug).toHaveBeenCalledWith('A command loader failed:', error);
|
|
93
|
+
});
|
|
94
|
+
it('getCommands should return a readonly array that cannot be mutated', async () => {
|
|
95
|
+
const service = await CommandService.create([new MockCommandLoader([mockCommandA])], new AbortController().signal);
|
|
96
|
+
const commands = service.getCommands();
|
|
97
|
+
// Expect it to throw a TypeError at runtime because the array is frozen.
|
|
98
|
+
expect(() => {
|
|
99
|
+
// @ts-expect-error - Testing immutability is intentional here.
|
|
100
|
+
commands.push(mockCommandB);
|
|
101
|
+
}).toThrow();
|
|
102
|
+
// Verify the original array was not mutated.
|
|
103
|
+
expect(service.getCommands()).toHaveLength(1);
|
|
104
|
+
});
|
|
105
|
+
it('should pass the abort signal to all loaders', async () => {
|
|
106
|
+
const controller = new AbortController();
|
|
107
|
+
const signal = controller.signal;
|
|
108
|
+
const loader1 = new MockCommandLoader([mockCommandA]);
|
|
109
|
+
const loader2 = new MockCommandLoader([mockCommandB]);
|
|
110
|
+
await CommandService.create([loader1, loader2], signal);
|
|
111
|
+
expect(loader1.loadCommands).toHaveBeenCalledTimes(1);
|
|
112
|
+
expect(loader1.loadCommands).toHaveBeenCalledWith(signal);
|
|
113
|
+
expect(loader2.loadCommands).toHaveBeenCalledTimes(1);
|
|
114
|
+
expect(loader2.loadCommands).toHaveBeenCalledWith(signal);
|
|
115
|
+
});
|
|
116
|
+
it('should rename extension commands when they conflict', async () => {
|
|
117
|
+
const builtinCommand = createMockCommand('deploy', CommandKind.BUILT_IN);
|
|
118
|
+
const userCommand = createMockCommand('sync', CommandKind.FILE);
|
|
119
|
+
const extensionCommand1 = {
|
|
120
|
+
...createMockCommand('deploy', CommandKind.FILE),
|
|
121
|
+
extensionName: 'firebase',
|
|
122
|
+
description: '[firebase] Deploy to Firebase',
|
|
123
|
+
};
|
|
124
|
+
const extensionCommand2 = {
|
|
125
|
+
...createMockCommand('sync', CommandKind.FILE),
|
|
126
|
+
extensionName: 'git-helper',
|
|
127
|
+
description: '[git-helper] Sync with remote',
|
|
128
|
+
};
|
|
129
|
+
const mockLoader1 = new MockCommandLoader([builtinCommand]);
|
|
130
|
+
const mockLoader2 = new MockCommandLoader([
|
|
131
|
+
userCommand,
|
|
132
|
+
extensionCommand1,
|
|
133
|
+
extensionCommand2,
|
|
134
|
+
]);
|
|
135
|
+
const service = await CommandService.create([mockLoader1, mockLoader2], new AbortController().signal);
|
|
136
|
+
const commands = service.getCommands();
|
|
137
|
+
expect(commands).toHaveLength(4);
|
|
138
|
+
// Built-in command keeps original name
|
|
139
|
+
const deployBuiltin = commands.find((cmd) => cmd.name === 'deploy' && !cmd.extensionName);
|
|
140
|
+
expect(deployBuiltin).toBeDefined();
|
|
141
|
+
expect(deployBuiltin?.kind).toBe(CommandKind.BUILT_IN);
|
|
142
|
+
// Extension command conflicting with built-in gets renamed
|
|
143
|
+
const deployExtension = commands.find((cmd) => cmd.name === 'firebase.deploy');
|
|
144
|
+
expect(deployExtension).toBeDefined();
|
|
145
|
+
expect(deployExtension?.extensionName).toBe('firebase');
|
|
146
|
+
// User command keeps original name
|
|
147
|
+
const syncUser = commands.find((cmd) => cmd.name === 'sync' && !cmd.extensionName);
|
|
148
|
+
expect(syncUser).toBeDefined();
|
|
149
|
+
expect(syncUser?.kind).toBe(CommandKind.FILE);
|
|
150
|
+
// Extension command conflicting with user command gets renamed
|
|
151
|
+
const syncExtension = commands.find((cmd) => cmd.name === 'git-helper.sync');
|
|
152
|
+
expect(syncExtension).toBeDefined();
|
|
153
|
+
expect(syncExtension?.extensionName).toBe('git-helper');
|
|
154
|
+
});
|
|
155
|
+
it('should handle user/project command override correctly', async () => {
|
|
156
|
+
const builtinCommand = createMockCommand('help', CommandKind.BUILT_IN);
|
|
157
|
+
const userCommand = createMockCommand('help', CommandKind.FILE);
|
|
158
|
+
const projectCommand = createMockCommand('deploy', CommandKind.FILE);
|
|
159
|
+
const userDeployCommand = createMockCommand('deploy', CommandKind.FILE);
|
|
160
|
+
const mockLoader1 = new MockCommandLoader([builtinCommand]);
|
|
161
|
+
const mockLoader2 = new MockCommandLoader([
|
|
162
|
+
userCommand,
|
|
163
|
+
userDeployCommand,
|
|
164
|
+
projectCommand,
|
|
165
|
+
]);
|
|
166
|
+
const service = await CommandService.create([mockLoader1, mockLoader2], new AbortController().signal);
|
|
167
|
+
const commands = service.getCommands();
|
|
168
|
+
expect(commands).toHaveLength(2);
|
|
169
|
+
// User command overrides built-in
|
|
170
|
+
const helpCommand = commands.find((cmd) => cmd.name === 'help');
|
|
171
|
+
expect(helpCommand).toBeDefined();
|
|
172
|
+
expect(helpCommand?.kind).toBe(CommandKind.FILE);
|
|
173
|
+
// Project command overrides user command (last wins)
|
|
174
|
+
const deployCommand = commands.find((cmd) => cmd.name === 'deploy');
|
|
175
|
+
expect(deployCommand).toBeDefined();
|
|
176
|
+
expect(deployCommand?.kind).toBe(CommandKind.FILE);
|
|
177
|
+
});
|
|
178
|
+
it('should handle secondary conflicts when renaming extension commands', async () => {
|
|
179
|
+
// User has both /deploy and /gcp.deploy commands
|
|
180
|
+
const userCommand1 = createMockCommand('deploy', CommandKind.FILE);
|
|
181
|
+
const userCommand2 = createMockCommand('gcp.deploy', CommandKind.FILE);
|
|
182
|
+
// Extension also has a deploy command that will conflict with user's /deploy
|
|
183
|
+
const extensionCommand = {
|
|
184
|
+
...createMockCommand('deploy', CommandKind.FILE),
|
|
185
|
+
extensionName: 'gcp',
|
|
186
|
+
description: '[gcp] Deploy to Google Cloud',
|
|
187
|
+
};
|
|
188
|
+
const mockLoader = new MockCommandLoader([
|
|
189
|
+
userCommand1,
|
|
190
|
+
userCommand2,
|
|
191
|
+
extensionCommand,
|
|
192
|
+
]);
|
|
193
|
+
const service = await CommandService.create([mockLoader], new AbortController().signal);
|
|
194
|
+
const commands = service.getCommands();
|
|
195
|
+
expect(commands).toHaveLength(3);
|
|
196
|
+
// Original user command keeps its name
|
|
197
|
+
const deployUser = commands.find((cmd) => cmd.name === 'deploy' && !cmd.extensionName);
|
|
198
|
+
expect(deployUser).toBeDefined();
|
|
199
|
+
// User's dot notation command keeps its name
|
|
200
|
+
const gcpDeployUser = commands.find((cmd) => cmd.name === 'gcp.deploy' && !cmd.extensionName);
|
|
201
|
+
expect(gcpDeployUser).toBeDefined();
|
|
202
|
+
// Extension command gets renamed with suffix due to secondary conflict
|
|
203
|
+
const deployExtension = commands.find((cmd) => cmd.name === 'gcp.deploy1' && cmd.extensionName === 'gcp');
|
|
204
|
+
expect(deployExtension).toBeDefined();
|
|
205
|
+
expect(deployExtension?.description).toBe('[gcp] Deploy to Google Cloud');
|
|
206
|
+
});
|
|
207
|
+
it('should handle multiple secondary conflicts with incrementing suffixes', async () => {
|
|
208
|
+
// User has /deploy, /gcp.deploy, and /gcp.deploy1
|
|
209
|
+
const userCommand1 = createMockCommand('deploy', CommandKind.FILE);
|
|
210
|
+
const userCommand2 = createMockCommand('gcp.deploy', CommandKind.FILE);
|
|
211
|
+
const userCommand3 = createMockCommand('gcp.deploy1', CommandKind.FILE);
|
|
212
|
+
// Extension has a deploy command
|
|
213
|
+
const extensionCommand = {
|
|
214
|
+
...createMockCommand('deploy', CommandKind.FILE),
|
|
215
|
+
extensionName: 'gcp',
|
|
216
|
+
description: '[gcp] Deploy to Google Cloud',
|
|
217
|
+
};
|
|
218
|
+
const mockLoader = new MockCommandLoader([
|
|
219
|
+
userCommand1,
|
|
220
|
+
userCommand2,
|
|
221
|
+
userCommand3,
|
|
222
|
+
extensionCommand,
|
|
223
|
+
]);
|
|
224
|
+
const service = await CommandService.create([mockLoader], new AbortController().signal);
|
|
225
|
+
const commands = service.getCommands();
|
|
226
|
+
expect(commands).toHaveLength(4);
|
|
227
|
+
// Extension command gets renamed with suffix 2 due to multiple conflicts
|
|
228
|
+
const deployExtension = commands.find((cmd) => cmd.name === 'gcp.deploy2' && cmd.extensionName === 'gcp');
|
|
229
|
+
expect(deployExtension).toBeDefined();
|
|
230
|
+
expect(deployExtension?.description).toBe('[gcp] Deploy to Google Cloud');
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
//# sourceMappingURL=CommandService.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandService.test.js","sourceRoot":"","sources":["../../../src/services/CommandService.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAuB,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAqB,MAAM,yBAAyB,CAAC;AAEzE,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,IAAiB,EAAgB,EAAE,CAAC,CAAC;IAC5E,IAAI;IACJ,WAAW,EAAE,mBAAmB,IAAI,EAAE;IACtC,IAAI;IACJ,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE;CAChB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC1E,MAAM,YAAY,GAAG,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC1E,MAAM,YAAY,GAAG,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;AACtE,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;AA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C,IAAI,CAAC,CAAC;QACvE,MAAM,YAAY,GAAG,iBAAiB,CAAC,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAExE,iCAAiC;QACjC,MAAM,gBAAgB,GAAG;YACvB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;YAChD,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE,8BAA8B;SAC5C,CAAC;QAEF,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC;YACvC,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,gBAAgB;SACjB,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,MAAM,CACzC,CAAC,UAAU,CAAC,EACZ,IAAI,eAAe,EAAE,CAAC,MAAM,CAC7B,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QACvC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAEjC,yEAAyE;QACzE,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CACnC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,aAAa,IAAI,GAAG,CAAC,aAAa,KAAK,KAAK,CACnE,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC;QACtC,MAAM,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Config } from '@umsai/ums-code-core';
|
|
7
|
-
import { ICommandLoader } from './types.js';
|
|
8
|
-
import { SlashCommand } from '../ui/commands/types.js';
|
|
6
|
+
import type { Config } from '@umsai/ums-code-core';
|
|
7
|
+
import type { ICommandLoader } from './types.js';
|
|
8
|
+
import type { SlashCommand } from '../ui/commands/types.js';
|
|
9
9
|
/**
|
|
10
10
|
* Discovers and loads custom slash commands from .toml files in both the
|
|
11
11
|
* user's global config directory and the current project's directory.
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { promises as fs } from 'fs';
|
|
7
|
-
import path from 'path';
|
|
6
|
+
import { promises as fs } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
8
|
import toml from '@iarna/toml';
|
|
9
9
|
import { glob } from 'glob';
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import {
|
|
12
|
-
import { CommandKind
|
|
13
|
-
import { DefaultArgumentProcessor
|
|
14
|
-
import { SHORTHAND_ARGS_PLACEHOLDER, SHELL_INJECTION_TRIGGER, } from './prompt-processors/types.js';
|
|
11
|
+
import { Storage } from '@umsai/ums-code-core';
|
|
12
|
+
import { CommandKind } from '../ui/commands/types.js';
|
|
13
|
+
import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js';
|
|
14
|
+
import { SHORTHAND_ARGS_PLACEHOLDER, SHELL_INJECTION_TRIGGER, AT_FILE_INJECTION_TRIGGER, } from './prompt-processors/types.js';
|
|
15
15
|
import { ConfirmationRequiredError, ShellProcessor, } from './prompt-processors/shellProcessor.js';
|
|
16
|
+
import { AtFileProcessor } from './prompt-processors/atFileProcessor.js';
|
|
16
17
|
/**
|
|
17
18
|
* Defines the Zod schema for a command definition file. This serves as the
|
|
18
19
|
* single source of truth for both validation and type inference.
|
|
@@ -88,10 +89,11 @@ export class FileCommandLoader {
|
|
|
88
89
|
*/
|
|
89
90
|
getCommandDirectories() {
|
|
90
91
|
const dirs = [];
|
|
92
|
+
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
91
93
|
// 1. User commands
|
|
92
|
-
dirs.push({ path: getUserCommandsDir() });
|
|
94
|
+
dirs.push({ path: Storage.getUserCommandsDir() });
|
|
93
95
|
// 2. Project commands (override user commands)
|
|
94
|
-
dirs.push({ path: getProjectCommandsDir(
|
|
96
|
+
dirs.push({ path: storage.getProjectCommandsDir() });
|
|
95
97
|
// 3. Extension commands (processed last to detect all conflicts)
|
|
96
98
|
if (this.config) {
|
|
97
99
|
const activeExtensions = this.config
|
|
@@ -152,15 +154,23 @@ export class FileCommandLoader {
|
|
|
152
154
|
description = `[${extensionName}] ${description}`;
|
|
153
155
|
}
|
|
154
156
|
const processors = [];
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
const usesArgs = validDef.prompt.includes(SHORTHAND_ARGS_PLACEHOLDER);
|
|
158
|
+
const usesShellInjection = validDef.prompt.includes(SHELL_INJECTION_TRIGGER);
|
|
159
|
+
const usesAtFileInjection = validDef.prompt.includes(AT_FILE_INJECTION_TRIGGER);
|
|
160
|
+
// 1. @-File Injection (Security First).
|
|
161
|
+
// This runs first to ensure we're not executing shell commands that
|
|
162
|
+
// could dynamically generate malicious @-paths.
|
|
163
|
+
if (usesAtFileInjection) {
|
|
164
|
+
processors.push(new AtFileProcessor(baseCommandName));
|
|
158
165
|
}
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
// 2. Argument and Shell Injection.
|
|
167
|
+
// This runs after file content has been safely injected.
|
|
168
|
+
if (usesShellInjection || usesArgs) {
|
|
169
|
+
processors.push(new ShellProcessor(baseCommandName));
|
|
162
170
|
}
|
|
163
|
-
|
|
171
|
+
// 3. Default Argument Handling.
|
|
172
|
+
// Appends the raw invocation if no explicit {{args}} are used.
|
|
173
|
+
if (!usesArgs) {
|
|
164
174
|
processors.push(new DefaultArgumentProcessor());
|
|
165
175
|
}
|
|
166
176
|
return {
|
|
@@ -173,17 +183,19 @@ export class FileCommandLoader {
|
|
|
173
183
|
console.error(`[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`);
|
|
174
184
|
return {
|
|
175
185
|
type: 'submit_prompt',
|
|
176
|
-
content: validDef.prompt, // Fallback to unprocessed prompt
|
|
186
|
+
content: [{ text: validDef.prompt }], // Fallback to unprocessed prompt
|
|
177
187
|
};
|
|
178
188
|
}
|
|
179
189
|
try {
|
|
180
|
-
let
|
|
190
|
+
let processedContent = [
|
|
191
|
+
{ text: validDef.prompt },
|
|
192
|
+
];
|
|
181
193
|
for (const processor of processors) {
|
|
182
|
-
|
|
194
|
+
processedContent = await processor.process(processedContent, context);
|
|
183
195
|
}
|
|
184
196
|
return {
|
|
185
197
|
type: 'submit_prompt',
|
|
186
|
-
content:
|
|
198
|
+
content: processedContent,
|
|
187
199
|
};
|
|
188
200
|
}
|
|
189
201
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCommandLoader.js","sourceRoot":"","sources":["../../../src/services/FileCommandLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FileCommandLoader.js","sourceRoot":"","sources":["../../../src/services/FileCommandLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAKpF,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,8BAA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E,gBAAgB;qBAC1B,CAAC;gBACJ,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,wCAAwC;oBACxC,IAAI,CAAC,YAAY,yBAAyB,EAAE,CAAC;wBAC3C,mDAAmD;wBACnD,OAAO;4BACL,IAAI,EAAE,wBAAwB;4BAC9B,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;4BACtC,kBAAkB,EAAE;gCAClB,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;6BAC5B;yBACF,CAAC;oBACJ,CAAC;oBACD,mEAAmE;oBACnE,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Config } from '@umsai/ums-code-core';
|
|
7
|
-
import { SlashCommand } from '../ui/commands/types.js';
|
|
8
|
-
import { ICommandLoader } from './types.js';
|
|
6
|
+
import type { Config } from '@umsai/ums-code-core';
|
|
7
|
+
import type { SlashCommand } from '../ui/commands/types.js';
|
|
8
|
+
import type { ICommandLoader } from './types.js';
|
|
9
|
+
import type { PromptArgument } from '@modelcontextprotocol/sdk/types.js';
|
|
9
10
|
/**
|
|
10
11
|
* Discovers and loads executable slash commands from prompts exposed by
|
|
11
12
|
* Model-Context-Protocol (MCP) servers.
|
|
@@ -21,5 +22,14 @@ export declare class McpPromptLoader implements ICommandLoader {
|
|
|
21
22
|
* @returns A promise that resolves to an array of loaded SlashCommands.
|
|
22
23
|
*/
|
|
23
24
|
loadCommands(_signal: AbortSignal): Promise<SlashCommand[]>;
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Parses the `userArgs` string representing the prompt arguments (all the text
|
|
27
|
+
* after the command) into a record matching the shape of the `promptArgs`.
|
|
28
|
+
*
|
|
29
|
+
* @param userArgs
|
|
30
|
+
* @param promptArgs
|
|
31
|
+
* @returns A record of the parsed arguments
|
|
32
|
+
* @visibleForTesting
|
|
33
|
+
*/
|
|
34
|
+
parseArgs(userArgs: string, promptArgs: PromptArgument[] | undefined): Record<string, unknown> | Error;
|
|
25
35
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { getErrorMessage, getMCPServerPrompts, } from '@umsai/ums-code-core';
|
|
7
|
-
import { CommandKind
|
|
7
|
+
import { CommandKind } from '../ui/commands/types.js';
|
|
8
8
|
/**
|
|
9
9
|
* Discovers and loads executable slash commands from prompts exposed by
|
|
10
10
|
* Model-Context-Protocol (MCP) servers.
|
|
@@ -95,14 +95,14 @@ export class McpPromptLoader {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
const result = await prompt.invoke(promptInputs);
|
|
98
|
-
if (result
|
|
98
|
+
if (result['error']) {
|
|
99
99
|
return {
|
|
100
100
|
type: 'message',
|
|
101
101
|
messageType: 'error',
|
|
102
|
-
content: `Error invoking prompt: ${result
|
|
102
|
+
content: `Error invoking prompt: ${result['error']}`,
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
if (!result.messages?.[0]?.content?.text) {
|
|
105
|
+
if (!result.messages?.[0]?.content?.['text']) {
|
|
106
106
|
return {
|
|
107
107
|
type: 'message',
|
|
108
108
|
messageType: 'error',
|
|
@@ -141,29 +141,46 @@ export class McpPromptLoader {
|
|
|
141
141
|
}
|
|
142
142
|
return Promise.resolve(promptCommands);
|
|
143
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Parses the `userArgs` string representing the prompt arguments (all the text
|
|
146
|
+
* after the command) into a record matching the shape of the `promptArgs`.
|
|
147
|
+
*
|
|
148
|
+
* @param userArgs
|
|
149
|
+
* @param promptArgs
|
|
150
|
+
* @returns A record of the parsed arguments
|
|
151
|
+
* @visibleForTesting
|
|
152
|
+
*/
|
|
144
153
|
parseArgs(userArgs, promptArgs) {
|
|
145
154
|
const argValues = {};
|
|
146
155
|
const promptInputs = {};
|
|
147
156
|
// arg parsing: --key="value" or --key=value
|
|
148
|
-
const namedArgRegex = /--([^=]+)=(?:"((?:\\.|[^"\\])*)"|([^ ]
|
|
157
|
+
const namedArgRegex = /--([^=]+)=(?:"((?:\\.|[^"\\])*)"|([^ ]+))/g;
|
|
149
158
|
let match;
|
|
150
|
-
const remainingArgs = [];
|
|
151
159
|
let lastIndex = 0;
|
|
160
|
+
const positionalParts = [];
|
|
152
161
|
while ((match = namedArgRegex.exec(userArgs)) !== null) {
|
|
153
162
|
const key = match[1];
|
|
154
|
-
|
|
163
|
+
// Extract the quoted or unquoted argument and remove escape chars.
|
|
164
|
+
const value = (match[2] ?? match[3]).replace(/\\(.)/g, '$1');
|
|
155
165
|
argValues[key] = value;
|
|
156
166
|
// Capture text between matches as potential positional args
|
|
157
167
|
if (match.index > lastIndex) {
|
|
158
|
-
|
|
168
|
+
positionalParts.push(userArgs.substring(lastIndex, match.index));
|
|
159
169
|
}
|
|
160
170
|
lastIndex = namedArgRegex.lastIndex;
|
|
161
171
|
}
|
|
162
172
|
// Capture any remaining text after the last named arg
|
|
163
173
|
if (lastIndex < userArgs.length) {
|
|
164
|
-
|
|
174
|
+
positionalParts.push(userArgs.substring(lastIndex));
|
|
175
|
+
}
|
|
176
|
+
const positionalArgsString = positionalParts.join('').trim();
|
|
177
|
+
// extracts either quoted strings or non-quoted sequences of non-space characters.
|
|
178
|
+
const positionalArgRegex = /(?:"((?:\\.|[^"\\])*)"|([^ ]+))/g;
|
|
179
|
+
const positionalArgs = [];
|
|
180
|
+
while ((match = positionalArgRegex.exec(positionalArgsString)) !== null) {
|
|
181
|
+
// Extract the quoted or unquoted argument and remove escape chars.
|
|
182
|
+
positionalArgs.push((match[1] ?? match[2]).replace(/\\(.)/g, '$1'));
|
|
165
183
|
}
|
|
166
|
-
const positionalArgs = remainingArgs.join(' ').split(/ +/);
|
|
167
184
|
if (!promptArgs) {
|
|
168
185
|
return promptInputs;
|
|
169
186
|
}
|
|
@@ -173,19 +190,28 @@ export class McpPromptLoader {
|
|
|
173
190
|
}
|
|
174
191
|
}
|
|
175
192
|
const unfilledArgs = promptArgs.filter((arg) => arg.required && !promptInputs[arg.name]);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
193
|
+
if (unfilledArgs.length === 1) {
|
|
194
|
+
// If we have only one unfilled arg, we don't require quotes we just
|
|
195
|
+
// join all the given arguments together as if they were quoted.
|
|
196
|
+
promptInputs[unfilledArgs[0].name] = positionalArgs.join(' ');
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
const missingArgs = [];
|
|
200
|
+
for (let i = 0; i < unfilledArgs.length; i++) {
|
|
201
|
+
if (positionalArgs.length > i) {
|
|
202
|
+
promptInputs[unfilledArgs[i].name] = positionalArgs[i];
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
missingArgs.push(unfilledArgs[i].name);
|
|
206
|
+
}
|
|
180
207
|
}
|
|
181
|
-
|
|
182
|
-
missingArgs
|
|
208
|
+
if (missingArgs.length > 0) {
|
|
209
|
+
const missingArgNames = missingArgs
|
|
210
|
+
.map((name) => `--${name}`)
|
|
211
|
+
.join(', ');
|
|
212
|
+
return new Error(`Missing required argument(s): ${missingArgNames}`);
|
|
183
213
|
}
|
|
184
214
|
}
|
|
185
|
-
if (missingArgs.length > 0) {
|
|
186
|
-
const missingArgNames = missingArgs.map((name) => `--${name}`).join(', ');
|
|
187
|
-
return new Error(`Missing required argument(s): ${missingArgNames}`);
|
|
188
|
-
}
|
|
189
215
|
return promptInputs;
|
|
190
216
|
}
|
|
191
217
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpPromptLoader.js","sourceRoot":"","sources":["../../../src/services/McpPromptLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"McpPromptLoader.js","sourceRoot":"","sources":["../../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