@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,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect } from 'vitest';
|
|
7
|
+
import { extractInjections } from './injectionParser.js';
|
|
8
|
+
describe('extractInjections', () => {
|
|
9
|
+
const SHELL_TRIGGER = '!{';
|
|
10
|
+
const AT_FILE_TRIGGER = '@{';
|
|
11
|
+
describe('Basic Functionality', () => {
|
|
12
|
+
it('should return an empty array if no trigger is present', () => {
|
|
13
|
+
const prompt = 'This is a simple prompt without injections.';
|
|
14
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
15
|
+
expect(result).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
it('should extract a single, simple injection', () => {
|
|
18
|
+
const prompt = 'Run this command: !{ls -la}';
|
|
19
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
20
|
+
expect(result).toEqual([
|
|
21
|
+
{
|
|
22
|
+
content: 'ls -la',
|
|
23
|
+
startIndex: 18,
|
|
24
|
+
endIndex: 27,
|
|
25
|
+
},
|
|
26
|
+
]);
|
|
27
|
+
});
|
|
28
|
+
it('should extract multiple injections', () => {
|
|
29
|
+
const prompt = 'First: !{cmd1}, Second: !{cmd2}';
|
|
30
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
31
|
+
expect(result).toHaveLength(2);
|
|
32
|
+
expect(result[0]).toEqual({
|
|
33
|
+
content: 'cmd1',
|
|
34
|
+
startIndex: 7,
|
|
35
|
+
endIndex: 14,
|
|
36
|
+
});
|
|
37
|
+
expect(result[1]).toEqual({
|
|
38
|
+
content: 'cmd2',
|
|
39
|
+
startIndex: 24,
|
|
40
|
+
endIndex: 31,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
it('should handle different triggers (e.g., @{)', () => {
|
|
44
|
+
const prompt = 'Read this file: @{path/to/file.txt}';
|
|
45
|
+
const result = extractInjections(prompt, AT_FILE_TRIGGER);
|
|
46
|
+
expect(result).toEqual([
|
|
47
|
+
{
|
|
48
|
+
content: 'path/to/file.txt',
|
|
49
|
+
startIndex: 16,
|
|
50
|
+
endIndex: 35,
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('Positioning and Edge Cases', () => {
|
|
56
|
+
it('should handle injections at the start and end of the prompt', () => {
|
|
57
|
+
const prompt = '!{start} middle text !{end}';
|
|
58
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
59
|
+
expect(result).toHaveLength(2);
|
|
60
|
+
expect(result[0]).toEqual({
|
|
61
|
+
content: 'start',
|
|
62
|
+
startIndex: 0,
|
|
63
|
+
endIndex: 8,
|
|
64
|
+
});
|
|
65
|
+
expect(result[1]).toEqual({
|
|
66
|
+
content: 'end',
|
|
67
|
+
startIndex: 21,
|
|
68
|
+
endIndex: 27,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
it('should handle adjacent injections', () => {
|
|
72
|
+
const prompt = '!{A}!{B}';
|
|
73
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
74
|
+
expect(result).toHaveLength(2);
|
|
75
|
+
expect(result[0]).toEqual({ content: 'A', startIndex: 0, endIndex: 4 });
|
|
76
|
+
expect(result[1]).toEqual({ content: 'B', startIndex: 4, endIndex: 8 });
|
|
77
|
+
});
|
|
78
|
+
it('should handle empty injections', () => {
|
|
79
|
+
const prompt = 'Empty: !{}';
|
|
80
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
81
|
+
expect(result).toEqual([
|
|
82
|
+
{
|
|
83
|
+
content: '',
|
|
84
|
+
startIndex: 7,
|
|
85
|
+
endIndex: 10,
|
|
86
|
+
},
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
it('should trim whitespace within the content', () => {
|
|
90
|
+
const prompt = '!{ \n command with space \t }';
|
|
91
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
92
|
+
expect(result).toEqual([
|
|
93
|
+
{
|
|
94
|
+
content: 'command with space',
|
|
95
|
+
startIndex: 0,
|
|
96
|
+
endIndex: 29,
|
|
97
|
+
},
|
|
98
|
+
]);
|
|
99
|
+
});
|
|
100
|
+
it('should ignore similar patterns that are not the exact trigger', () => {
|
|
101
|
+
const prompt = 'Not a trigger: !(cmd) or {cmd} or ! {cmd}';
|
|
102
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
103
|
+
expect(result).toEqual([]);
|
|
104
|
+
});
|
|
105
|
+
it('should ignore extra closing braces before the trigger', () => {
|
|
106
|
+
const prompt = 'Ignore this } then !{run}';
|
|
107
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
108
|
+
expect(result).toEqual([
|
|
109
|
+
{
|
|
110
|
+
content: 'run',
|
|
111
|
+
startIndex: 19,
|
|
112
|
+
endIndex: 25,
|
|
113
|
+
},
|
|
114
|
+
]);
|
|
115
|
+
});
|
|
116
|
+
it('should stop parsing at the first balanced closing brace (non-greedy)', () => {
|
|
117
|
+
// This tests that the parser doesn't greedily consume extra closing braces
|
|
118
|
+
const prompt = 'Run !{ls -l}} extra braces';
|
|
119
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
120
|
+
expect(result).toEqual([
|
|
121
|
+
{
|
|
122
|
+
content: 'ls -l',
|
|
123
|
+
startIndex: 4,
|
|
124
|
+
endIndex: 12,
|
|
125
|
+
},
|
|
126
|
+
]);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
describe('Nested Braces (Balanced)', () => {
|
|
130
|
+
it('should correctly parse content with simple nested braces (e.g., JSON)', () => {
|
|
131
|
+
const prompt = `Send JSON: !{curl -d '{"key": "value"}'}`;
|
|
132
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
133
|
+
expect(result).toHaveLength(1);
|
|
134
|
+
expect(result[0].content).toBe(`curl -d '{"key": "value"}'`);
|
|
135
|
+
});
|
|
136
|
+
it('should correctly parse content with shell constructs (e.g., awk)', () => {
|
|
137
|
+
const prompt = `Process text: !{awk '{print $1}' file.txt}`;
|
|
138
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
139
|
+
expect(result).toHaveLength(1);
|
|
140
|
+
expect(result[0].content).toBe(`awk '{print $1}' file.txt`);
|
|
141
|
+
});
|
|
142
|
+
it('should correctly parse multiple levels of nesting', () => {
|
|
143
|
+
const prompt = `!{level1 {level2 {level3}} suffix}`;
|
|
144
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
145
|
+
expect(result).toHaveLength(1);
|
|
146
|
+
expect(result[0].content).toBe(`level1 {level2 {level3}} suffix`);
|
|
147
|
+
expect(result[0].endIndex).toBe(prompt.length);
|
|
148
|
+
});
|
|
149
|
+
it('should correctly parse paths containing balanced braces', () => {
|
|
150
|
+
const prompt = 'Analyze @{path/with/{braces}/file.txt}';
|
|
151
|
+
const result = extractInjections(prompt, AT_FILE_TRIGGER);
|
|
152
|
+
expect(result).toHaveLength(1);
|
|
153
|
+
expect(result[0].content).toBe('path/with/{braces}/file.txt');
|
|
154
|
+
});
|
|
155
|
+
it('should correctly handle an injection containing the trigger itself', () => {
|
|
156
|
+
// This works because the parser counts braces, it doesn't look for the trigger again until the current one is closed.
|
|
157
|
+
const prompt = '!{echo "The trigger is !{ confusing }"}';
|
|
158
|
+
const expectedContent = 'echo "The trigger is !{ confusing }"';
|
|
159
|
+
const result = extractInjections(prompt, SHELL_TRIGGER);
|
|
160
|
+
expect(result).toHaveLength(1);
|
|
161
|
+
expect(result[0].content).toBe(expectedContent);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
describe('Error Handling (Unbalanced/Unclosed)', () => {
|
|
165
|
+
it('should throw an error for a simple unclosed injection', () => {
|
|
166
|
+
const prompt = 'This prompt has !{an unclosed trigger';
|
|
167
|
+
expect(() => extractInjections(prompt, SHELL_TRIGGER)).toThrow(/Invalid syntax: Unclosed injection starting at index 16 \('!{'\)/);
|
|
168
|
+
});
|
|
169
|
+
it('should throw an error if the prompt ends inside a nested block', () => {
|
|
170
|
+
const prompt = 'This fails: !{outer {inner';
|
|
171
|
+
expect(() => extractInjections(prompt, SHELL_TRIGGER)).toThrow(/Invalid syntax: Unclosed injection starting at index 12 \('!{'\)/);
|
|
172
|
+
});
|
|
173
|
+
it('should include the context name in the error message if provided', () => {
|
|
174
|
+
const prompt = 'Failing !{command';
|
|
175
|
+
const contextName = 'test-command';
|
|
176
|
+
expect(() => extractInjections(prompt, SHELL_TRIGGER, contextName)).toThrow(/Invalid syntax in command 'test-command': Unclosed injection starting at index 8/);
|
|
177
|
+
});
|
|
178
|
+
it('should throw if content contains unbalanced braces (e.g., missing closing)', () => {
|
|
179
|
+
// This is functionally the same as an unclosed injection from the parser's perspective.
|
|
180
|
+
const prompt = 'Analyze @{path/with/braces{example.txt}';
|
|
181
|
+
expect(() => extractInjections(prompt, AT_FILE_TRIGGER)).toThrow(/Invalid syntax: Unclosed injection starting at index 8 \('@{'\)/);
|
|
182
|
+
});
|
|
183
|
+
it('should clearly state that unbalanced braces in content are not supported in the error', () => {
|
|
184
|
+
const prompt = 'Analyze @{path/with/braces{example.txt}';
|
|
185
|
+
expect(() => extractInjections(prompt, AT_FILE_TRIGGER)).toThrow(/Paths or commands with unbalanced braces are not supported directly/);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
//# sourceMappingURL=injectionParser.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injectionParser.test.js","sourceRoot":"","sources":["../../../../src/services/prompt-processors/injectionParser.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,MAAM,aAAa,GAAG,IAAI,CAAC;IAC3B,MAAM,eAAe,GAAG,IAAI,CAAC;IAE7B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;YAC/D,MAAM,MAAM,GAAG,6CAA6C,CAAC;YAC7D,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;YACxD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2C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PromptProcessor } from './types.js';
|
|
6
|
+
import type { CommandContext } from '../../ui/commands/types.js';
|
|
7
|
+
import type { IPromptProcessor, PromptPipelineContent } from './types.js';
|
|
8
8
|
export declare class ConfirmationRequiredError extends Error {
|
|
9
9
|
commandsToConfirm: string[];
|
|
10
10
|
constructor(message: string, commandsToConfirm: string[]);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Handles prompt interpolation, including shell command execution (`!{...}`)
|
|
14
|
+
* and context-aware argument injection (`{{args}}`).
|
|
15
15
|
*
|
|
16
|
-
* This processor ensures that
|
|
17
|
-
*
|
|
16
|
+
* This processor ensures that:
|
|
17
|
+
* 1. `{{args}}` outside `!{...}` are replaced with raw input.
|
|
18
|
+
* 2. `{{args}}` inside `!{...}` are replaced with shell-escaped input.
|
|
19
|
+
* 3. Shell commands are executed securely after argument substitution.
|
|
20
|
+
* 4. Parsing correctly handles nested braces.
|
|
18
21
|
*/
|
|
19
22
|
export declare class ShellProcessor implements IPromptProcessor {
|
|
20
23
|
private readonly commandName;
|
|
21
|
-
/**
|
|
22
|
-
* A regular expression to find all instances of `!{...}`. The inner
|
|
23
|
-
* capture group extracts the command itself.
|
|
24
|
-
*/
|
|
25
|
-
private static readonly SHELL_INJECTION_REGEX;
|
|
26
|
-
/**
|
|
27
|
-
* @param commandName The name of the custom command being executed, used
|
|
28
|
-
* for logging and error messages.
|
|
29
|
-
*/
|
|
30
24
|
constructor(commandName: string);
|
|
31
|
-
process(prompt:
|
|
25
|
+
process(prompt: PromptPipelineContent, context: CommandContext): Promise<PromptPipelineContent>;
|
|
26
|
+
private processString;
|
|
32
27
|
}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { checkCommandPermissions, ShellExecutionService, } from '@umsai/ums-code-core';
|
|
6
|
+
import { ApprovalMode, checkCommandPermissions, escapeShellArg, getShellConfiguration, ShellExecutionService, flatMapTextParts, } from '@umsai/ums-code-core';
|
|
7
|
+
import { SHELL_INJECTION_TRIGGER, SHORTHAND_ARGS_PLACEHOLDER, } from './types.js';
|
|
8
|
+
import { extractInjections } from './injectionParser.js';
|
|
7
9
|
export class ConfirmationRequiredError extends Error {
|
|
8
10
|
commandsToConfirm;
|
|
9
11
|
constructor(message, commandsToConfirm) {
|
|
@@ -13,65 +15,107 @@ export class ConfirmationRequiredError extends Error {
|
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
+
* Handles prompt interpolation, including shell command execution (`!{...}`)
|
|
19
|
+
* and context-aware argument injection (`{{args}}`).
|
|
18
20
|
*
|
|
19
|
-
* This processor ensures that
|
|
20
|
-
*
|
|
21
|
+
* This processor ensures that:
|
|
22
|
+
* 1. `{{args}}` outside `!{...}` are replaced with raw input.
|
|
23
|
+
* 2. `{{args}}` inside `!{...}` are replaced with shell-escaped input.
|
|
24
|
+
* 3. Shell commands are executed securely after argument substitution.
|
|
25
|
+
* 4. Parsing correctly handles nested braces.
|
|
21
26
|
*/
|
|
22
27
|
export class ShellProcessor {
|
|
23
28
|
commandName;
|
|
24
|
-
/**
|
|
25
|
-
* A regular expression to find all instances of `!{...}`. The inner
|
|
26
|
-
* capture group extracts the command itself.
|
|
27
|
-
*/
|
|
28
|
-
static SHELL_INJECTION_REGEX = /!\{([^}]*)\}/g;
|
|
29
|
-
/**
|
|
30
|
-
* @param commandName The name of the custom command being executed, used
|
|
31
|
-
* for logging and error messages.
|
|
32
|
-
*/
|
|
33
29
|
constructor(commandName) {
|
|
34
30
|
this.commandName = commandName;
|
|
35
31
|
}
|
|
36
32
|
async process(prompt, context) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
return flatMapTextParts(prompt, (text) => this.processString(text, context));
|
|
34
|
+
}
|
|
35
|
+
async processString(prompt, context) {
|
|
36
|
+
const userArgsRaw = context.invocation?.args || '';
|
|
37
|
+
if (!prompt.includes(SHELL_INJECTION_TRIGGER)) {
|
|
38
|
+
return [
|
|
39
|
+
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) },
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
const config = context.services.config;
|
|
43
|
+
if (!config) {
|
|
44
|
+
throw new Error(`Security configuration not loaded. Cannot verify shell command permissions for '${this.commandName}'. Aborting.`);
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const { sessionShellAllowlist } = context.session;
|
|
47
|
+
const injections = extractInjections(prompt, SHELL_INJECTION_TRIGGER, this.commandName);
|
|
48
|
+
// If extractInjections found no closed blocks (and didn't throw), treat as raw.
|
|
49
|
+
if (injections.length === 0) {
|
|
50
|
+
return [
|
|
51
|
+
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) },
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
const { shell } = getShellConfiguration();
|
|
55
|
+
const userArgsEscaped = escapeShellArg(userArgsRaw, shell);
|
|
56
|
+
const resolvedInjections = injections.map((injection) => {
|
|
57
|
+
const command = injection.content;
|
|
58
|
+
if (command === '') {
|
|
59
|
+
return { ...injection, resolvedCommand: undefined };
|
|
60
|
+
}
|
|
61
|
+
const resolvedCommand = command.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsEscaped);
|
|
62
|
+
return { ...injection, resolvedCommand };
|
|
63
|
+
});
|
|
64
|
+
const commandsToConfirm = new Set();
|
|
65
|
+
for (const injection of resolvedInjections) {
|
|
66
|
+
const command = injection.resolvedCommand;
|
|
67
|
+
if (!command)
|
|
68
|
+
continue;
|
|
69
|
+
// Security check on the final, escaped command string.
|
|
50
70
|
const { allAllowed, disallowedCommands, blockReason, isHardDenial } = checkCommandPermissions(command, config, sessionShellAllowlist);
|
|
51
71
|
if (!allAllowed) {
|
|
52
|
-
// If it's a hard denial, this is a non-recoverable security error.
|
|
53
72
|
if (isHardDenial) {
|
|
54
|
-
throw new Error(`${this.commandName} cannot be run.
|
|
73
|
+
throw new Error(`${this.commandName} cannot be run. Blocked command: "${command}". Reason: ${blockReason || 'Blocked by configuration.'}`);
|
|
74
|
+
}
|
|
75
|
+
// If not a hard denial, respect YOLO mode and auto-approve.
|
|
76
|
+
if (config.getApprovalMode() !== ApprovalMode.YOLO) {
|
|
77
|
+
disallowedCommands.forEach((uc) => commandsToConfirm.add(uc));
|
|
55
78
|
}
|
|
56
|
-
// Add each soft denial disallowed command to the set for confirmation.
|
|
57
|
-
disallowedCommands.forEach((uc) => commandsToConfirm.add(uc));
|
|
58
79
|
}
|
|
59
|
-
commandsToExecute.push({ fullMatch: match[0], command });
|
|
60
80
|
}
|
|
61
|
-
//
|
|
62
|
-
// pipeline and trigger the UI flow.
|
|
81
|
+
// Handle confirmation requirements.
|
|
63
82
|
if (commandsToConfirm.size > 0) {
|
|
64
83
|
throw new ConfirmationRequiredError('Shell command confirmation required', Array.from(commandsToConfirm));
|
|
65
84
|
}
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
for (const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
85
|
+
let processedPrompt = '';
|
|
86
|
+
let lastIndex = 0;
|
|
87
|
+
for (const injection of resolvedInjections) {
|
|
88
|
+
// Append the text segment BEFORE the injection, substituting {{args}} with RAW input.
|
|
89
|
+
const segment = prompt.substring(lastIndex, injection.startIndex);
|
|
90
|
+
processedPrompt += segment.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw);
|
|
91
|
+
// Execute the resolved command (which already has ESCAPED input).
|
|
92
|
+
if (injection.resolvedCommand) {
|
|
93
|
+
const { result } = await ShellExecutionService.execute(injection.resolvedCommand, config.getTargetDir(), () => { }, new AbortController().signal, config.getShouldUseNodePtyShell());
|
|
94
|
+
const executionResult = await result;
|
|
95
|
+
// Handle Spawn Errors
|
|
96
|
+
if (executionResult.error && !executionResult.aborted) {
|
|
97
|
+
throw new Error(`Failed to start shell command in '${this.commandName}': ${executionResult.error.message}. Command: ${injection.resolvedCommand}`);
|
|
98
|
+
}
|
|
99
|
+
// Append the output, making stderr explicit for the model.
|
|
100
|
+
processedPrompt += executionResult.output;
|
|
101
|
+
// Append a status message if the command did not succeed.
|
|
102
|
+
if (executionResult.aborted) {
|
|
103
|
+
processedPrompt += `\n[Shell command '${injection.resolvedCommand}' aborted]`;
|
|
104
|
+
}
|
|
105
|
+
else if (executionResult.exitCode !== 0 &&
|
|
106
|
+
executionResult.exitCode !== null) {
|
|
107
|
+
processedPrompt += `\n[Shell command '${injection.resolvedCommand}' exited with code ${executionResult.exitCode}]`;
|
|
108
|
+
}
|
|
109
|
+
else if (executionResult.signal !== null) {
|
|
110
|
+
processedPrompt += `\n[Shell command '${injection.resolvedCommand}' terminated by signal ${executionResult.signal}]`;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
lastIndex = injection.endIndex;
|
|
73
114
|
}
|
|
74
|
-
|
|
115
|
+
// Append the remaining text AFTER the last injection, substituting {{args}} with RAW input.
|
|
116
|
+
const finalSegment = prompt.substring(lastIndex);
|
|
117
|
+
processedPrompt += finalSegment.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw);
|
|
118
|
+
return [{ text: processedPrompt }];
|
|
75
119
|
}
|
|
76
120
|
}
|
|
77
121
|
//# sourceMappingURL=shellProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shellProcessor.js","sourceRoot":"","sources":["../../../../src/services/prompt-processors/shellProcessor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"shellProcessor.js","sourceRoot":"","sources":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ifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { CommandContext } from '../../ui/commands/types.js';
|
|
6
|
+
import type { CommandContext } from '../../ui/commands/types.js';
|
|
7
|
+
import type { PartUnion } from '@google/genai';
|
|
8
|
+
/**
|
|
9
|
+
* Defines the input/output type for prompt processors.
|
|
10
|
+
*/
|
|
11
|
+
export type PromptPipelineContent = PartUnion[];
|
|
7
12
|
/**
|
|
8
13
|
* Defines the interface for a prompt processor, a module that can transform
|
|
9
14
|
* a prompt string before it is sent to the model. Processors are chained
|
|
@@ -11,12 +16,8 @@ import { CommandContext } from '../../ui/commands/types.js';
|
|
|
11
16
|
*/
|
|
12
17
|
export interface IPromptProcessor {
|
|
13
18
|
/**
|
|
14
|
-
* Processes a prompt
|
|
15
|
-
*
|
|
16
|
-
* Each processor in a command's pipeline receives the output of the previous
|
|
17
|
-
* processor. This method provides the full command context, allowing for
|
|
18
|
-
* complex transformations that may require access to invocation details,
|
|
19
|
-
* application services, or UI state.
|
|
19
|
+
* Processes a prompt input (which may contain text and multi-modal parts),
|
|
20
|
+
* applying a specific transformation as part of a pipeline.
|
|
20
21
|
*
|
|
21
22
|
* @param prompt The current state of the prompt string. This may have been
|
|
22
23
|
* modified by previous processors in the pipeline.
|
|
@@ -26,13 +27,19 @@ export interface IPromptProcessor {
|
|
|
26
27
|
* @returns A promise that resolves to the transformed prompt string, which
|
|
27
28
|
* will be passed to the next processor or, if it's the last one, sent to the model.
|
|
28
29
|
*/
|
|
29
|
-
process(prompt:
|
|
30
|
+
process(prompt: PromptPipelineContent, context: CommandContext): Promise<PromptPipelineContent>;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* The placeholder string for shorthand argument injection in custom commands.
|
|
34
|
+
* When used outside of !{...}, arguments are injected raw.
|
|
35
|
+
* When used inside !{...}, arguments are shell-escaped.
|
|
33
36
|
*/
|
|
34
37
|
export declare const SHORTHAND_ARGS_PLACEHOLDER = "{{args}}";
|
|
35
38
|
/**
|
|
36
39
|
* The trigger string for shell command injection in custom commands.
|
|
37
40
|
*/
|
|
38
41
|
export declare const SHELL_INJECTION_TRIGGER = "!{";
|
|
42
|
+
/**
|
|
43
|
+
* The trigger string for at file injection in custom commands.
|
|
44
|
+
*/
|
|
45
|
+
export declare const AT_FILE_INJECTION_TRIGGER = "@{";
|
|
@@ -5,10 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* The placeholder string for shorthand argument injection in custom commands.
|
|
8
|
+
* When used outside of !{...}, arguments are injected raw.
|
|
9
|
+
* When used inside !{...}, arguments are shell-escaped.
|
|
8
10
|
*/
|
|
9
11
|
export const SHORTHAND_ARGS_PLACEHOLDER = '{{args}}';
|
|
10
12
|
/**
|
|
11
13
|
* The trigger string for shell command injection in custom commands.
|
|
12
14
|
*/
|
|
13
15
|
export const SHELL_INJECTION_TRIGGER = '!{';
|
|
16
|
+
/**
|
|
17
|
+
* The trigger string for at file injection in custom commands.
|
|
18
|
+
*/
|
|
19
|
+
export const AT_FILE_INJECTION_TRIGGER = '@{';
|
|
14
20
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/prompt-processors/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/prompt-processors/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { SlashCommand } from '../ui/commands/types.js';
|
|
6
|
+
import type { SlashCommand } from '../ui/commands/types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Defines the contract for any class that can load and provide slash commands.
|
|
9
9
|
* This allows the CommandService to be extended with new command sources
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
declare module 'vitest' {
|
|
7
|
+
interface Assertion<T> {
|
|
8
|
+
toHaveOnlyValidCharacters(): T;
|
|
9
|
+
}
|
|
10
|
+
interface AsymmetricMatchersContaining {
|
|
11
|
+
toHaveOnlyValidCharacters(): void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { expect } from 'vitest';
|
|
7
|
+
// RegExp to detect invalid characters: backspace, and ANSI escape codes
|
|
8
|
+
// eslint-disable-next-line no-control-regex
|
|
9
|
+
const invalidCharsRegex = /[\b\x1b]/;
|
|
10
|
+
function toHaveOnlyValidCharacters(buffer) {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
const { isNot } = this;
|
|
13
|
+
let pass = true;
|
|
14
|
+
const invalidLines = [];
|
|
15
|
+
for (let i = 0; i < buffer.lines.length; i++) {
|
|
16
|
+
const line = buffer.lines[i];
|
|
17
|
+
if (line.includes('\n')) {
|
|
18
|
+
pass = false;
|
|
19
|
+
invalidLines.push({ line: i, content: line });
|
|
20
|
+
break; // Fail fast on newlines
|
|
21
|
+
}
|
|
22
|
+
if (invalidCharsRegex.test(line)) {
|
|
23
|
+
pass = false;
|
|
24
|
+
invalidLines.push({ line: i, content: line });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
pass,
|
|
29
|
+
message: () => `Expected buffer ${isNot ? 'not ' : ''}to have only valid characters, but found invalid characters in lines:\n${invalidLines
|
|
30
|
+
.map((l) => ` [${l.line}]: "${l.content}"`) /* This line was changed */
|
|
31
|
+
.join('\n')}`,
|
|
32
|
+
actual: buffer.lines,
|
|
33
|
+
expected: 'Lines with no line breaks, backspaces, or escape codes.',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
expect.extend({
|
|
37
|
+
toHaveOnlyValidCharacters,
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=customMatchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customMatchers.js","sourceRoot":"","sources":["../../../src/test-utils/customMatchers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,wEAAwE;AACxE,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAErC,SAAS,yBAAyB,CAAkB,MAAkB;IACpE,8DAA8D;IAC9D,MAAM,EAAE,KAAK,EAAE,GAAG,IAAW,CAAC;IAC9B,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,MAAM,YAAY,GAA6C,EAAE,CAAC;IAElE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,IAAI,GAAG,KAAK,CAAC;YACb,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9C,MAAM,CAAC,wBAAwB;QACjC,CAAC;QACD,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,IAAI,GAAG,KAAK,CAAC;YACb,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,GAAG,EAAE,CACZ,mBAAmB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,0EAA0E,YAAY;aACzH,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,2BAA2B;aACvE,IAAI,CAAC,IAAI,CAAC,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC,KAAK;QACpB,QAAQ,EAAE,yDAAyD;KACpE,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,CAAC;IACZ,yBAAyB;IACzB,8DAA8D;CACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandContext } from '../ui/commands/types.js';
|
|
7
|
+
type DeepPartial<T> = T extends object ? {
|
|
8
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
9
|
+
} : T;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a deep, fully-typed mock of the CommandContext for use in tests.
|
|
12
|
+
* All functions are pre-mocked with `vi.fn()`.
|
|
13
|
+
*
|
|
14
|
+
* @param overrides - A deep partial object to override any default mock values.
|
|
15
|
+
* @returns A complete, mocked CommandContext object.
|
|
16
|
+
*/
|
|
17
|
+
export declare const createMockCommandContext: (overrides?: DeepPartial<CommandContext>) => CommandContext;
|
|
18
|
+
export {};
|