@umsai/ums-code 0.0.14-v2 → 0.1.4-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/package.json +16 -11
- package/dist/src/commands/extensions/disable.d.ts +2 -3
- package/dist/src/commands/extensions/disable.js +20 -6
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/enable.d.ts +2 -3
- package/dist/src/commands/extensions/enable.js +21 -10
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
- package/dist/src/commands/extensions/examples/context/qwen-extension.json +4 -0
- package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
- package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +4 -0
- package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
- package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
- package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +11 -0
- package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
- package/dist/src/commands/extensions/install.d.ts +3 -2
- package/dist/src/commands/extensions/install.js +47 -17
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +86 -9
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.d.ts +12 -0
- package/dist/src/commands/extensions/link.js +37 -0
- package/dist/src/commands/extensions/link.js.map +1 -0
- package/dist/src/commands/extensions/list.js +1 -1
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/new.d.ts +7 -0
- package/dist/src/commands/extensions/new.js +90 -0
- package/dist/src/commands/extensions/new.js.map +1 -0
- package/dist/src/commands/extensions/new.test.js +59 -0
- package/dist/src/commands/extensions/new.test.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.js +1 -1
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.test.js +2 -2
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
- package/dist/src/commands/extensions/update.d.ts +2 -1
- package/dist/src/commands/extensions/update.js +80 -14
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions.js +4 -0
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/mcp/add.js +6 -1
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/list.js +4 -3
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/remove.js +1 -1
- package/dist/src/commands/mcp/remove.js.map +1 -1
- package/dist/src/config/auth.d.ts +2 -4
- package/dist/src/config/auth.js +10 -36
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.js +12 -32
- package/dist/src/config/auth.test.js.map +1 -1
- package/dist/src/config/config.d.ts +7 -2
- package/dist/src/config/config.js +183 -124
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +41 -18
- package/dist/src/config/extension.js +352 -195
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
- package/dist/src/config/extensions/extensionEnablement.js +189 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.test.js +333 -0
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +30 -0
- package/dist/src/config/extensions/github.js +322 -0
- package/dist/src/config/extensions/github.js.map +1 -0
- package/dist/src/{ui/components/ModelSelectionDialog.test.d.ts → config/extensions/github.test.d.ts} +1 -1
- package/dist/src/config/extensions/github.test.js +334 -0
- package/dist/src/config/extensions/github.test.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +19 -0
- package/dist/src/config/extensions/update.js +113 -0
- package/dist/src/config/extensions/update.js.map +1 -0
- package/dist/src/config/extensions/update.test.d.ts +6 -0
- package/dist/src/config/extensions/update.test.js +342 -0
- package/dist/src/config/extensions/update.test.js.map +1 -0
- package/dist/src/config/extensions/variableSchema.d.ts +8 -0
- package/dist/src/config/extensions/variableSchema.js +4 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +5 -1
- package/dist/src/config/keyBindings.js +14 -25
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/settings.d.ts +10 -5
- package/dist/src/config/settings.js +218 -275
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +358 -140
- package/dist/src/config/settingsSchema.js +347 -136
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +64 -57
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/trustedFolders.d.ts +24 -5
- package/dist/src/config/trustedFolders.js +98 -48
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +196 -20
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/core/auth.d.ts +13 -0
- package/dist/src/core/auth.js +27 -0
- package/dist/src/core/auth.js.map +1 -0
- package/dist/src/core/initializer.d.ts +21 -0
- package/dist/src/core/initializer.js +33 -0
- package/dist/src/core/initializer.js.map +1 -0
- package/dist/src/core/theme.d.ts +12 -0
- package/dist/src/core/theme.js +20 -0
- package/dist/src/core/theme.js.map +1 -0
- package/dist/src/gemini.d.ts +3 -2
- package/dist/src/gemini.js +167 -138
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +190 -47
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +2 -1
- package/dist/src/nonInteractiveCli.js +101 -72
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
- package/dist/src/nonInteractiveCliCommands.js +79 -0
- package/dist/src/nonInteractiveCliCommands.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +3 -3
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +53 -19
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +2 -0
- package/dist/src/services/FileCommandLoader.js +7 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +43 -8
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +228 -1
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.js +8 -1
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/test-utils/createExtension.d.ts +15 -0
- package/dist/src/test-utils/createExtension.js +25 -0
- package/dist/src/test-utils/createExtension.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.js +2 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/render.d.ts +5 -1
- package/dist/src/test-utils/render.js +5 -1
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/App.d.ts +1 -10
- package/dist/src/ui/App.js +26 -833
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +17 -0
- package/dist/src/ui/AppContainer.js +1069 -0
- package/dist/src/ui/AppContainer.js.map +1 -0
- package/dist/src/ui/AppContainer.test.d.ts +6 -0
- package/dist/src/ui/AppContainer.test.js +831 -0
- package/dist/src/ui/AppContainer.test.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.d.ts +2 -2
- package/dist/src/ui/IdeIntegrationNudge.js +6 -8
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/{components → auth}/AuthDialog.d.ts +5 -1
- package/dist/src/ui/{components → auth}/AuthDialog.js +26 -29
- package/dist/src/ui/auth/AuthDialog.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/{components → auth}/AuthDialog.test.js +92 -10
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthInProgress.js +2 -2
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +24 -0
- package/dist/src/ui/auth/useAuth.js +108 -0
- package/dist/src/ui/auth/useAuth.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.js +9 -3
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +19 -5
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +2 -0
- package/dist/src/ui/commands/chatCommand.js +95 -5
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +1 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.js +1 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +1 -1
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +92 -15
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +1 -2
- package/dist/src/ui/commands/ideCommand.js +19 -10
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +88 -263
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +1 -1
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.js +1 -16
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.test.js +10 -11
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
- package/dist/src/ui/commands/{privacyCommand.d.ts → permissionsCommand.d.ts} +1 -1
- package/dist/src/ui/commands/{privacyCommand.js → permissionsCommand.js} +5 -5
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
- package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/summaryCommand.js +1 -1
- package/dist/src/ui/commands/summaryCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +10 -24
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +8 -3
- package/dist/src/ui/commands/types.js +0 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AboutBox.js +2 -2
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
- package/dist/src/ui/components/AnsiOutput.js +12 -0
- package/dist/src/ui/components/AnsiOutput.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
- package/dist/src/ui/components/AnsiOutput.test.js +97 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
- package/dist/src/ui/components/AppHeader.d.ts +10 -0
- package/dist/src/ui/components/AppHeader.js +19 -0
- package/dist/src/ui/components/AppHeader.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js +5 -5
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/components/Composer.d.ts +6 -0
- package/dist/src/ui/components/Composer.js +54 -0
- package/dist/src/ui/components/Composer.js.map +1 -0
- package/dist/src/ui/components/Composer.test.d.ts +6 -0
- package/dist/src/ui/components/Composer.test.js +337 -0
- package/dist/src/ui/components/Composer.test.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
- package/dist/src/ui/components/ConsentPrompt.js +19 -0
- package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ConsentPrompt.test.js +67 -0
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +3 -3
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +4 -1
- package/dist/src/ui/components/ContextUsageDisplay.js +27 -5
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.js +2 -2
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js +7 -7
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.d.ts +12 -0
- package/dist/src/ui/components/DialogManager.js +130 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +16 -7
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/ExitWarning.d.ts +7 -0
- package/dist/src/ui/components/ExitWarning.js +9 -0
- package/dist/src/ui/components/ExitWarning.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.js +22 -9
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +37 -12
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -17
- package/dist/src/ui/components/Footer.js +33 -11
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +5 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +7 -2
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/Header.js +2 -2
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/Help.js +9 -6
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/Help.test.d.ts +6 -0
- package/dist/src/ui/components/Help.test.js +57 -0
- package/dist/src/ui/components/Help.test.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -4
- package/dist/src/ui/components/HistoryItemDisplay.js +13 -4
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +90 -9
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js +32 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +9 -0
- package/dist/src/ui/components/InputPrompt.js +192 -46
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +2 -2
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +4 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.d.ts +6 -0
- package/dist/src/ui/components/MainContent.js +28 -0
- package/dist/src/ui/components/MainContent.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.d.ts +11 -0
- package/dist/src/ui/components/ModelDialog.js +42 -0
- package/dist/src/ui/components/ModelDialog.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelDialog.test.js +158 -0
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.d.ts +3 -1
- package/dist/src/ui/components/ModelSwitchDialog.js +11 -7
- package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.test.js +14 -10
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.d.ts +6 -0
- package/dist/src/ui/components/Notifications.js +23 -0
- package/dist/src/ui/components/Notifications.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js +63 -39
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +8 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +13 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +48 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +154 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +5 -5
- package/dist/src/ui/components/PrepareLabel.js +67 -11
- package/dist/src/ui/components/PrepareLabel.js.map +1 -1
- package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
- package/dist/src/ui/components/PrepareLabel.test.js +71 -0
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.d.ts +13 -0
- package/dist/src/ui/components/ProQuotaDialog.js +23 -0
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js +58 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +56 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js +4 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.js +20 -0
- package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/QwenOAuthProgress.js +7 -6
- package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
- package/dist/src/ui/components/QwenOAuthProgress.test.js +84 -13
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
- package/dist/src/ui/components/SettingsDialog.js +97 -23
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +474 -84
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +5 -2
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
- package/dist/src/ui/components/ShellInputPrompt.js +36 -0
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.js +2 -2
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.js +2 -2
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.js +6 -6
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
- package/dist/src/ui/components/SuggestionsDisplay.js +17 -17
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +14 -29
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ThemeDialog.test.js +75 -0
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
- package/dist/src/ui/components/Tips.js +2 -2
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/UpdateNotification.js +2 -2
- package/dist/src/ui/components/UpdateNotification.js.map +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.js +2 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +14 -11
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +1 -2
- package/dist/src/ui/components/messages/CompressionMessage.js +37 -8
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +2 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +14 -22
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +2 -2
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +2 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +56 -21
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +36 -8
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -2
- package/dist/src/ui/components/messages/ToolGroupMessage.js +18 -10
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +17 -15
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +3 -1
- package/dist/src/ui/components/messages/ToolMessage.js +53 -11
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +34 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +3 -4
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/WarningMessage.js +10 -0
- package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
- package/dist/src/ui/components/shared/EnumSelector.js +44 -0
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +2 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +2 -3
- package/dist/src/ui/components/shared/RadioButtonSelect.js +10 -105
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +115 -92
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -1
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
- package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
- package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +25 -2
- package/dist/src/ui/components/shared/text-buffer.js +296 -187
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +2 -3
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -1
- package/dist/src/ui/components/subagents/create/ColorSelector.js +3 -2
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/CreationSummary.js +6 -5
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -1
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +2 -3
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -1
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +1 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/LocationSelector.js +1 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +2 -2
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -1
- package/dist/src/ui/components/subagents/create/ToolSelector.js +4 -3
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +4 -4
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +1 -2
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -1
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +1 -2
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -1
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +9 -10
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.d.ts +2 -2
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +66 -64
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.js +47 -0
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
- package/dist/src/ui/components/views/McpStatus.js +77 -0
- package/dist/src/ui/components/views/McpStatus.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
- package/dist/src/ui/components/views/McpStatus.test.js +117 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
- package/dist/src/ui/components/views/ToolsList.js +7 -0
- package/dist/src/ui/components/views/ToolsList.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ToolsList.test.js +45 -0
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/AppContext.d.ts +11 -0
- package/dist/src/ui/contexts/AppContext.js +15 -0
- package/dist/src/ui/contexts/AppContext.js.map +1 -0
- package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
- package/dist/src/ui/contexts/ConfigContext.js +16 -0
- package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +3 -0
- package/dist/src/ui/contexts/KeypressContext.js +309 -44
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +288 -2
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +6 -0
- package/dist/src/ui/contexts/SessionContext.js +107 -5
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
- package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
- package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +45 -0
- package/dist/src/ui/contexts/UIActionsContext.js +21 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/UIStateContext.d.ts +117 -0
- package/dist/src/ui/contexts/UIStateContext.js +17 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +12 -12
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +21 -19
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
- package/dist/src/ui/hooks/keyToAnsi.js +67 -0
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +65 -15
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +196 -17
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +20 -3
- package/dist/src/ui/hooks/slashCommandProcessor.js +48 -90
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +3 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +20 -18
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +43 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +0 -2
- package/dist/src/ui/hooks/useDialogClose.js +0 -14
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.js +1 -1
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.js +4 -4
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +21 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +116 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +243 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.js +10 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +6 -10
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +14 -3
- package/dist/src/ui/hooks/useGeminiStream.js +184 -83
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +15 -18
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +49 -53
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js +81 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +234 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +57 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
- package/dist/src/ui/hooks/useMessageQueue.js +5 -3
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +9 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
- package/dist/src/ui/hooks/useModelCommand.js +21 -0
- package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +78 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +182 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +11 -8
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +269 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
- package/dist/src/ui/hooks/useReactToolScheduler.js +23 -17
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
- package/dist/src/ui/hooks/useSelectionList.js +245 -0
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSelectionList.test.js +701 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +281 -67
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +4 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +390 -65
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useStateAndRef.d.ts +1 -1
- package/dist/src/ui/hooks/useStateAndRef.js +2 -2
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +3 -14
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +64 -291
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +1 -1
- package/dist/src/ui/hooks/useVisionAutoSwitch.js +36 -6
- package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +1 -1
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +3 -3
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +1 -1
- package/dist/src/ui/hooks/useWelcomeBack.js +2 -2
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.js +2 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +17 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.d.ts +9 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js +13 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js +14 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
- package/dist/src/ui/models/availableModels.d.ts +11 -5
- package/dist/src/ui/models/availableModels.js +89 -3
- package/dist/src/ui/models/availableModels.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +28 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
- package/dist/src/ui/state/extensions.d.ts +42 -0
- package/dist/src/ui/state/extensions.js +62 -0
- package/dist/src/ui/state/extensions.js.map +1 -0
- package/dist/src/ui/themes/ayu.js +1 -1
- package/dist/src/ui/themes/dracula.js +2 -2
- package/dist/src/ui/themes/github-dark.js +1 -1
- package/dist/src/ui/themes/theme.js +19 -19
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +79 -3
- package/dist/src/ui/types.js +14 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +3 -2
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -7
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +11 -11
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +95 -87
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +4 -4
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +5 -6
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.d.ts +1 -0
- package/dist/src/ui/utils/displayUtils.js +7 -4
- package/dist/src/ui/utils/displayUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.test.js +37 -18
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -1
- package/dist/src/ui/utils/highlight.d.ts +11 -0
- package/dist/src/ui/utils/highlight.js +78 -0
- package/dist/src/ui/utils/highlight.js.map +1 -0
- package/dist/src/ui/utils/highlight.test.d.ts +6 -0
- package/dist/src/ui/utils/highlight.test.js +120 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +39 -29
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
- package/dist/src/ui/utils/platformConstants.d.ts +24 -1
- package/dist/src/ui/utils/platformConstants.js +26 -1
- package/dist/src/ui/utils/platformConstants.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +10 -0
- package/dist/src/ui/utils/textUtils.js +108 -3
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/textUtils.test.js +132 -0
- package/dist/src/ui/utils/textUtils.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +1 -0
- package/dist/src/ui/utils/updateCheck.js +53 -2
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/commands.d.ts +20 -0
- package/dist/src/utils/commands.js +53 -0
- package/dist/src/utils/commands.js.map +1 -0
- package/dist/src/utils/commands.test.d.ts +6 -0
- package/dist/src/utils/commands.test.js +115 -0
- package/dist/src/utils/commands.test.js.map +1 -0
- package/dist/src/utils/commentJson.d.ts +9 -0
- package/dist/src/utils/commentJson.js +48 -0
- package/dist/src/utils/commentJson.js.map +1 -0
- package/dist/src/utils/commentJson.test.d.ts +6 -0
- package/dist/src/utils/commentJson.test.js +146 -0
- package/dist/src/utils/commentJson.test.js.map +1 -0
- package/dist/src/utils/deepMerge.d.ts +9 -0
- package/dist/src/utils/deepMerge.js +58 -0
- package/dist/src/utils/deepMerge.js.map +1 -0
- package/dist/src/utils/deepMerge.test.d.ts +6 -0
- package/dist/src/utils/deepMerge.test.js +143 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -0
- package/dist/src/utils/envVarResolver.d.ts +39 -0
- package/dist/src/utils/envVarResolver.js +97 -0
- package/dist/src/utils/envVarResolver.js.map +1 -0
- package/dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/dist/src/utils/envVarResolver.test.js +221 -0
- package/dist/src/utils/envVarResolver.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +21 -0
- package/dist/src/utils/errors.js +93 -0
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +303 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/events.d.ts +2 -1
- package/dist/src/utils/events.js +1 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.js +6 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/math.d.ts +13 -0
- package/dist/src/utils/math.js +14 -0
- package/dist/src/utils/math.js.map +1 -0
- package/dist/src/utils/processUtils.d.ts +13 -0
- package/dist/src/utils/processUtils.js +18 -0
- package/dist/src/utils/processUtils.js.map +1 -0
- package/dist/src/utils/processUtils.test.d.ts +6 -0
- package/dist/src/utils/processUtils.test.js +20 -0
- package/dist/src/utils/processUtils.test.js.map +1 -0
- package/dist/src/utils/relaunch.d.ts +7 -0
- package/dist/src/utils/relaunch.js +57 -0
- package/dist/src/utils/relaunch.js.map +1 -0
- package/dist/src/utils/relaunch.test.d.ts +6 -0
- package/dist/src/utils/relaunch.test.js +273 -0
- package/dist/src/utils/relaunch.test.js.map +1 -0
- package/dist/src/utils/sandbox.d.ts +1 -1
- package/dist/src/utils/sandbox.js +42 -17
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +16 -6
- package/dist/src/utils/settingsUtils.js +35 -25
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/settingsUtils.test.js +455 -158
- package/dist/src/utils/settingsUtils.test.js.map +1 -1
- package/dist/src/utils/startupWarnings.js +1 -1
- package/dist/src/utils/startupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.d.ts +7 -1
- package/dist/src/utils/userStartupWarnings.js +21 -6
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.js +26 -5
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
- package/dist/src/utils/windowTitle.d.ts +12 -0
- package/dist/src/utils/windowTitle.js +19 -0
- package/dist/src/utils/windowTitle.js.map +1 -0
- package/dist/src/utils/windowTitle.test.d.ts +6 -0
- package/dist/src/utils/windowTitle.test.js +49 -0
- package/dist/src/utils/windowTitle.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +4 -2
- package/dist/src/validateNonInterActiveAuth.js +36 -21
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +1 -0
- package/dist/src/zed-integration/fileSystemService.js +3 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -1
- package/dist/src/zed-integration/schema.d.ts +282 -282
- package/dist/src/zed-integration/zedIntegration.d.ts +8 -1
- package/dist/src/zed-integration/zedIntegration.js +34 -30
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -11
- package/dist/src/ui/commands/privacyCommand.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.js.map +0 -1
- package/dist/src/ui/components/ModelSelectionDialog.d.ts +0 -14
- package/dist/src/ui/components/ModelSelectionDialog.js +0 -26
- package/dist/src/ui/components/ModelSelectionDialog.js.map +0 -1
- package/dist/src/ui/components/ModelSelectionDialog.test.js +0 -124
- package/dist/src/ui/components/ModelSelectionDialog.test.js.map +0 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
- package/dist/src/ui/hooks/useAuthCommand.js +0 -66
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
- package/dist/src/ui/hooks/usePrivacySettings.js +0 -119
- package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -41
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -18
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -18
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
- package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
- /package/dist/src/{ui/components/AuthDialog.test.d.ts → commands/extensions/new.test.d.ts} +0 -0
- /package/dist/src/{ui/hooks/usePrivacySettings.test.d.ts → config/extensions/extensionEnablement.test.d.ts} +0 -0
- /package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +0 -0
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { exec } from 'node:child_process';
|
|
7
|
-
import { promisify } from 'node:util';
|
|
8
6
|
import * as fs from 'node:fs/promises';
|
|
9
7
|
import * as path from 'node:path';
|
|
10
|
-
|
|
8
|
+
import { spawnAsync } from '@umsai/ums-code-core';
|
|
11
9
|
/**
|
|
12
10
|
* Checks if the system clipboard contains an image (macOS only for now)
|
|
13
11
|
* @returns true if clipboard contains an image
|
|
@@ -18,8 +16,9 @@ export async function clipboardHasImage() {
|
|
|
18
16
|
}
|
|
19
17
|
try {
|
|
20
18
|
// Use osascript to check clipboard type
|
|
21
|
-
const { stdout } = await
|
|
22
|
-
|
|
19
|
+
const { stdout } = await spawnAsync('osascript', ['-e', 'clipboard info']);
|
|
20
|
+
const imageRegex = /«class PNGf»|TIFF picture|JPEG picture|GIF picture|«class JPEG»|«class TIFF»/;
|
|
21
|
+
return imageRegex.test(stdout);
|
|
23
22
|
}
|
|
24
23
|
catch {
|
|
25
24
|
return false;
|
|
@@ -66,7 +65,7 @@ export async function saveClipboardImage(targetDir) {
|
|
|
66
65
|
return "error"
|
|
67
66
|
end try
|
|
68
67
|
`;
|
|
69
|
-
const { stdout } = await
|
|
68
|
+
const { stdout } = await spawnAsync('osascript', ['-e', script]);
|
|
70
69
|
if (stdout.trim() === 'success') {
|
|
71
70
|
// Verify the file was created and has content
|
|
72
71
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboardUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/clipboardUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"clipboardUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/clipboardUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,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O,CAAC,CAAC;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAE/C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IACE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;gBAC7B,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACpB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACrB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;oBACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EACxB,CAAC;gBACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAC1C,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACtC,IAAI,KAAK,CAAC,OAAO,GAAG,UAAU,EAAE,CAAC;oBAC/B,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,2BAA2B;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { theme } from '../semantic-colors.js';
|
|
7
7
|
// --- Thresholds ---
|
|
8
8
|
export const TOOL_SUCCESS_RATE_HIGH = 95;
|
|
9
9
|
export const TOOL_SUCCESS_RATE_MEDIUM = 85;
|
|
@@ -14,11 +14,14 @@ export const CACHE_EFFICIENCY_MEDIUM = 15;
|
|
|
14
14
|
// --- Color Logic ---
|
|
15
15
|
export const getStatusColor = (value, thresholds, options = {}) => {
|
|
16
16
|
if (value >= thresholds.green) {
|
|
17
|
-
return
|
|
17
|
+
return theme.status.success;
|
|
18
18
|
}
|
|
19
19
|
if (value >= thresholds.yellow) {
|
|
20
|
-
return
|
|
20
|
+
return theme.status.warning;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
if (thresholds.red != null && value >= thresholds.red) {
|
|
23
|
+
return theme.status.error;
|
|
24
|
+
}
|
|
25
|
+
return options.defaultColor ?? theme.status.error;
|
|
23
26
|
};
|
|
24
27
|
//# sourceMappingURL=displayUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/displayUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"displayUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/displayUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,qBAAqB;AACrB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,sBAAsB;AACtB,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAa,EACb,UAA2D,EAC3D,UAAqC,EAAE,EACvC,EAAE;IACF,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAC9B,CAAC;IACD,IAAI,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAC9B,CAAC;IACD,IAAI,UAAU,CAAC,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AACpD,CAAC,CAAC"}
|
|
@@ -5,27 +5,46 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { describe, it, expect } from 'vitest';
|
|
7
7
|
import { getStatusColor, TOOL_SUCCESS_RATE_HIGH, TOOL_SUCCESS_RATE_MEDIUM, USER_AGREEMENT_RATE_HIGH, USER_AGREEMENT_RATE_MEDIUM, CACHE_EFFICIENCY_HIGH, CACHE_EFFICIENCY_MEDIUM, } from './displayUtils.js';
|
|
8
|
-
import {
|
|
8
|
+
import { theme } from '../semantic-colors.js';
|
|
9
9
|
describe('displayUtils', () => {
|
|
10
10
|
describe('getStatusColor', () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
describe('with red threshold', () => {
|
|
12
|
+
const thresholds = {
|
|
13
|
+
green: 80,
|
|
14
|
+
yellow: 50,
|
|
15
|
+
red: 20,
|
|
16
|
+
};
|
|
17
|
+
it('should return green for values >= green threshold', () => {
|
|
18
|
+
expect(getStatusColor(90, thresholds)).toBe(theme.status.success);
|
|
19
|
+
expect(getStatusColor(80, thresholds)).toBe(theme.status.success);
|
|
20
|
+
});
|
|
21
|
+
it('should return yellow for values < green and >= yellow threshold', () => {
|
|
22
|
+
expect(getStatusColor(79, thresholds)).toBe(theme.status.warning);
|
|
23
|
+
expect(getStatusColor(50, thresholds)).toBe(theme.status.warning);
|
|
24
|
+
});
|
|
25
|
+
it('should return red for values < yellow and >= red threshold', () => {
|
|
26
|
+
expect(getStatusColor(49, thresholds)).toBe(theme.status.error);
|
|
27
|
+
expect(getStatusColor(20, thresholds)).toBe(theme.status.error);
|
|
28
|
+
});
|
|
29
|
+
it('should return error for values < red threshold', () => {
|
|
30
|
+
expect(getStatusColor(19, thresholds)).toBe(theme.status.error);
|
|
31
|
+
expect(getStatusColor(0, thresholds)).toBe(theme.status.error);
|
|
32
|
+
});
|
|
33
|
+
it('should return defaultColor for values < red threshold when provided', () => {
|
|
34
|
+
expect(getStatusColor(19, thresholds, { defaultColor: theme.text.primary })).toBe(theme.text.primary);
|
|
35
|
+
});
|
|
18
36
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
describe('when red threshold is not provided', () => {
|
|
38
|
+
const thresholds = {
|
|
39
|
+
green: 80,
|
|
40
|
+
yellow: 50,
|
|
41
|
+
};
|
|
42
|
+
it('should return error color for values < yellow threshold', () => {
|
|
43
|
+
expect(getStatusColor(49, thresholds)).toBe(theme.status.error);
|
|
44
|
+
});
|
|
45
|
+
it('should return defaultColor for values < yellow threshold when provided', () => {
|
|
46
|
+
expect(getStatusColor(49, thresholds, { defaultColor: theme.text.primary })).toBe(theme.text.primary);
|
|
47
|
+
});
|
|
29
48
|
});
|
|
30
49
|
});
|
|
31
50
|
describe('Threshold Constants', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayUtils.test.js","sourceRoot":"","sources":["../../../../src/ui/utils/displayUtils.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3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EAAwE,EAAE,GAAG,EAAE;gBAChF,MAAM,CACJ,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CACrE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxC,MAAM,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1C,MAAM,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1C,MAAM,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC5C,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type HighlightToken = {
|
|
7
|
+
text: string;
|
|
8
|
+
type: 'default' | 'command' | 'file';
|
|
9
|
+
};
|
|
10
|
+
export declare function parseInputForHighlighting(text: string, index: number): readonly HighlightToken[];
|
|
11
|
+
export declare function buildSegmentsForVisualSlice(tokens: readonly HighlightToken[], sliceStart: number, sliceEnd: number): readonly HighlightToken[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { cpLen, cpSlice } from './textUtils.js';
|
|
7
|
+
const HIGHLIGHT_REGEX = /(^\/[a-zA-Z0-9_-]+|@(?:\\ |[a-zA-Z0-9_./-])+)/g;
|
|
8
|
+
export function parseInputForHighlighting(text, index) {
|
|
9
|
+
if (!text) {
|
|
10
|
+
return [{ text: '', type: 'default' }];
|
|
11
|
+
}
|
|
12
|
+
const tokens = [];
|
|
13
|
+
let lastIndex = 0;
|
|
14
|
+
let match;
|
|
15
|
+
while ((match = HIGHLIGHT_REGEX.exec(text)) !== null) {
|
|
16
|
+
const [fullMatch] = match;
|
|
17
|
+
const matchIndex = match.index;
|
|
18
|
+
// Add the text before the match as a default token
|
|
19
|
+
if (matchIndex > lastIndex) {
|
|
20
|
+
tokens.push({
|
|
21
|
+
text: text.slice(lastIndex, matchIndex),
|
|
22
|
+
type: 'default',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// Add the matched token
|
|
26
|
+
const type = fullMatch.startsWith('/') ? 'command' : 'file';
|
|
27
|
+
// Only highlight slash commands if the index is 0.
|
|
28
|
+
if (type === 'command' && index !== 0) {
|
|
29
|
+
tokens.push({
|
|
30
|
+
text: fullMatch,
|
|
31
|
+
type: 'default',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
tokens.push({
|
|
36
|
+
text: fullMatch,
|
|
37
|
+
type,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
lastIndex = matchIndex + fullMatch.length;
|
|
41
|
+
}
|
|
42
|
+
// Add any remaining text after the last match
|
|
43
|
+
if (lastIndex < text.length) {
|
|
44
|
+
tokens.push({
|
|
45
|
+
text: text.slice(lastIndex),
|
|
46
|
+
type: 'default',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return tokens;
|
|
50
|
+
}
|
|
51
|
+
export function buildSegmentsForVisualSlice(tokens, sliceStart, sliceEnd) {
|
|
52
|
+
if (sliceStart >= sliceEnd)
|
|
53
|
+
return [];
|
|
54
|
+
const segments = [];
|
|
55
|
+
let tokenCpStart = 0;
|
|
56
|
+
for (const token of tokens) {
|
|
57
|
+
const tokenLen = cpLen(token.text);
|
|
58
|
+
const tokenStart = tokenCpStart;
|
|
59
|
+
const tokenEnd = tokenStart + tokenLen;
|
|
60
|
+
const overlapStart = Math.max(tokenStart, sliceStart);
|
|
61
|
+
const overlapEnd = Math.min(tokenEnd, sliceEnd);
|
|
62
|
+
if (overlapStart < overlapEnd) {
|
|
63
|
+
const sliceStartInToken = overlapStart - tokenStart;
|
|
64
|
+
const sliceEndInToken = overlapEnd - tokenStart;
|
|
65
|
+
const rawSlice = cpSlice(token.text, sliceStartInToken, sliceEndInToken);
|
|
66
|
+
const last = segments[segments.length - 1];
|
|
67
|
+
if (last && last.type === token.type) {
|
|
68
|
+
last.text += rawSlice;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
segments.push({ type: token.type, text: rawSlice });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
tokenCpStart += tokenLen;
|
|
75
|
+
}
|
|
76
|
+
return segments;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=highlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.js","sourceRoot":"","sources":["../../../../src/ui/utils/highlight.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAOhD,MAAM,eAAe,GAAG,gDAAgD,CAAC;AAEzE,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,KAAa;IAEb,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE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AAC;IAC3B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
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 { parseInputForHighlighting } from './highlight.js';
|
|
8
|
+
describe('parseInputForHighlighting', () => {
|
|
9
|
+
it('should handle an empty string', () => {
|
|
10
|
+
expect(parseInputForHighlighting('', 0)).toEqual([
|
|
11
|
+
{ text: '', type: 'default' },
|
|
12
|
+
]);
|
|
13
|
+
});
|
|
14
|
+
it('should handle text with no commands or files', () => {
|
|
15
|
+
const text = 'this is a normal sentence';
|
|
16
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
17
|
+
{ text, type: 'default' },
|
|
18
|
+
]);
|
|
19
|
+
});
|
|
20
|
+
it('should highlight a single command at the beginning when index is 0', () => {
|
|
21
|
+
const text = '/help me';
|
|
22
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
23
|
+
{ text: '/help', type: 'command' },
|
|
24
|
+
{ text: ' me', type: 'default' },
|
|
25
|
+
]);
|
|
26
|
+
});
|
|
27
|
+
it('should NOT highlight a command at the beginning when index is not 0', () => {
|
|
28
|
+
const text = '/help me';
|
|
29
|
+
expect(parseInputForHighlighting(text, 1)).toEqual([
|
|
30
|
+
{ text: '/help', type: 'default' },
|
|
31
|
+
{ text: ' me', type: 'default' },
|
|
32
|
+
]);
|
|
33
|
+
});
|
|
34
|
+
it('should highlight a single file path at the beginning', () => {
|
|
35
|
+
const text = '@path/to/file.txt please';
|
|
36
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
37
|
+
{ text: '@path/to/file.txt', type: 'file' },
|
|
38
|
+
{ text: ' please', type: 'default' },
|
|
39
|
+
]);
|
|
40
|
+
});
|
|
41
|
+
it('should not highlight a command in the middle', () => {
|
|
42
|
+
const text = 'I need /help with this';
|
|
43
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
44
|
+
{ text: 'I need /help with this', type: 'default' },
|
|
45
|
+
]);
|
|
46
|
+
});
|
|
47
|
+
it('should highlight a file path in the middle', () => {
|
|
48
|
+
const text = 'Please check @path/to/file.txt for details';
|
|
49
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
50
|
+
{ text: 'Please check ', type: 'default' },
|
|
51
|
+
{ text: '@path/to/file.txt', type: 'file' },
|
|
52
|
+
{ text: ' for details', type: 'default' },
|
|
53
|
+
]);
|
|
54
|
+
});
|
|
55
|
+
it('should highlight files but not commands not at the start', () => {
|
|
56
|
+
const text = 'Use /run with @file.js and also /format @another/file.ts';
|
|
57
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
58
|
+
{ text: 'Use /run with ', type: 'default' },
|
|
59
|
+
{ text: '@file.js', type: 'file' },
|
|
60
|
+
{ text: ' and also /format ', type: 'default' },
|
|
61
|
+
{ text: '@another/file.ts', type: 'file' },
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
64
|
+
it('should handle adjacent highlights at start', () => {
|
|
65
|
+
const text = '/run@file.js';
|
|
66
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
67
|
+
{ text: '/run', type: 'command' },
|
|
68
|
+
{ text: '@file.js', type: 'file' },
|
|
69
|
+
]);
|
|
70
|
+
});
|
|
71
|
+
it('should not highlight command at the end of the string', () => {
|
|
72
|
+
const text = 'Get help with /help';
|
|
73
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
74
|
+
{ text: 'Get help with /help', type: 'default' },
|
|
75
|
+
]);
|
|
76
|
+
});
|
|
77
|
+
it('should handle file paths with dots and dashes', () => {
|
|
78
|
+
const text = 'Check @./path-to/file-name.v2.txt';
|
|
79
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
80
|
+
{ text: 'Check ', type: 'default' },
|
|
81
|
+
{ text: '@./path-to/file-name.v2.txt', type: 'file' },
|
|
82
|
+
]);
|
|
83
|
+
});
|
|
84
|
+
it('should not highlight command with dashes and numbers not at start', () => {
|
|
85
|
+
const text = 'Run /command-123 now';
|
|
86
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
87
|
+
{ text: 'Run /command-123 now', type: 'default' },
|
|
88
|
+
]);
|
|
89
|
+
});
|
|
90
|
+
it('should highlight command with dashes and numbers at start', () => {
|
|
91
|
+
const text = '/command-123 now';
|
|
92
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
93
|
+
{ text: '/command-123', type: 'command' },
|
|
94
|
+
{ text: ' now', type: 'default' },
|
|
95
|
+
]);
|
|
96
|
+
});
|
|
97
|
+
it('should still highlight a file path on a non-zero line', () => {
|
|
98
|
+
const text = 'some text @path/to/file.txt';
|
|
99
|
+
expect(parseInputForHighlighting(text, 1)).toEqual([
|
|
100
|
+
{ text: 'some text ', type: 'default' },
|
|
101
|
+
{ text: '@path/to/file.txt', type: 'file' },
|
|
102
|
+
]);
|
|
103
|
+
});
|
|
104
|
+
it('should not highlight command but highlight file on a non-zero line', () => {
|
|
105
|
+
const text = '/cmd @file.txt';
|
|
106
|
+
expect(parseInputForHighlighting(text, 2)).toEqual([
|
|
107
|
+
{ text: '/cmd', type: 'default' },
|
|
108
|
+
{ text: ' ', type: 'default' },
|
|
109
|
+
{ text: '@file.txt', type: 'file' },
|
|
110
|
+
]);
|
|
111
|
+
});
|
|
112
|
+
it('should highlight a file path with escaped spaces', () => {
|
|
113
|
+
const text = 'cat @/my\\ path/file.txt';
|
|
114
|
+
expect(parseInputForHighlighting(text, 0)).toEqual([
|
|
115
|
+
{ text: 'cat ', type: 'default' },
|
|
116
|
+
{ text: '@/my\\ path/file.txt', type: 'file' },
|
|
117
|
+
]);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=highlight.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9B,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE;SACpC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,IAAI,GAAG,0BAA0B,CAAC;QACxC,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACjD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YACjC,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -27,50 +27,60 @@ export async function detectAndEnableKittyProtocol() {
|
|
|
27
27
|
}
|
|
28
28
|
let responseBuffer = '';
|
|
29
29
|
let progressiveEnhancementReceived = false;
|
|
30
|
-
let
|
|
30
|
+
let timeoutId;
|
|
31
|
+
const onTimeout = () => {
|
|
32
|
+
timeoutId = undefined;
|
|
33
|
+
process.stdin.removeListener('data', handleData);
|
|
34
|
+
if (!originalRawMode) {
|
|
35
|
+
process.stdin.setRawMode(false);
|
|
36
|
+
}
|
|
37
|
+
detectionComplete = true;
|
|
38
|
+
resolve(false);
|
|
39
|
+
};
|
|
31
40
|
const handleData = (data) => {
|
|
41
|
+
if (timeoutId === undefined) {
|
|
42
|
+
// Race condition. We have already timed out.
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
32
45
|
responseBuffer += data.toString();
|
|
33
46
|
// Check for progressive enhancement response (CSI ? <flags> u)
|
|
34
47
|
if (responseBuffer.includes('\x1b[?') && responseBuffer.includes('u')) {
|
|
35
48
|
progressiveEnhancementReceived = true;
|
|
49
|
+
// Give more time to get the full set of kitty responses if we have an
|
|
50
|
+
// indication the terminal probably supports kitty and we just need to
|
|
51
|
+
// wait a bit longer for a response.
|
|
52
|
+
clearTimeout(timeoutId);
|
|
53
|
+
timeoutId = setTimeout(onTimeout, 1000);
|
|
36
54
|
}
|
|
37
55
|
// Check for device attributes response (CSI ? <attrs> c)
|
|
38
56
|
if (responseBuffer.includes('\x1b[?') && responseBuffer.includes('c')) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
if (progressiveEnhancementReceived) {
|
|
46
|
-
// Enable the protocol
|
|
47
|
-
process.stdout.write('\x1b[>1u');
|
|
48
|
-
protocolSupported = true;
|
|
49
|
-
protocolEnabled = true;
|
|
50
|
-
// Set up cleanup on exit
|
|
51
|
-
process.on('exit', disableProtocol);
|
|
52
|
-
process.on('SIGTERM', disableProtocol);
|
|
53
|
-
}
|
|
54
|
-
detectionComplete = true;
|
|
55
|
-
resolve(protocolSupported);
|
|
57
|
+
clearTimeout(timeoutId);
|
|
58
|
+
timeoutId = undefined;
|
|
59
|
+
process.stdin.removeListener('data', handleData);
|
|
60
|
+
if (!originalRawMode) {
|
|
61
|
+
process.stdin.setRawMode(false);
|
|
56
62
|
}
|
|
63
|
+
if (progressiveEnhancementReceived) {
|
|
64
|
+
// Enable the protocol
|
|
65
|
+
process.stdout.write('\x1b[>1u');
|
|
66
|
+
protocolSupported = true;
|
|
67
|
+
protocolEnabled = true;
|
|
68
|
+
// Set up cleanup on exit
|
|
69
|
+
process.on('exit', disableProtocol);
|
|
70
|
+
process.on('SIGTERM', disableProtocol);
|
|
71
|
+
}
|
|
72
|
+
detectionComplete = true;
|
|
73
|
+
resolve(protocolSupported);
|
|
57
74
|
}
|
|
58
75
|
};
|
|
59
76
|
process.stdin.on('data', handleData);
|
|
60
77
|
// Send queries
|
|
61
78
|
process.stdout.write('\x1b[?u'); // Query progressive enhancement
|
|
62
79
|
process.stdout.write('\x1b[c'); // Query device attributes
|
|
63
|
-
// Timeout after
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (!originalRawMode) {
|
|
68
|
-
process.stdin.setRawMode(false);
|
|
69
|
-
}
|
|
70
|
-
detectionComplete = true;
|
|
71
|
-
resolve(false);
|
|
72
|
-
}
|
|
73
|
-
}, 50);
|
|
80
|
+
// Timeout after 200ms
|
|
81
|
+
// When a iterm2 terminal does not have focus this can take over 90s on a
|
|
82
|
+
// fast macbook so we need a somewhat longer threshold than would be ideal.
|
|
83
|
+
timeoutId = setTimeout(onTimeout, 200);
|
|
74
84
|
});
|
|
75
85
|
}
|
|
76
86
|
function disableProtocol() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kittyProtocolDetector.js","sourceRoot":"","sources":["../../../../src/ui/utils/kittyProtocolDetector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,IAAI,eAAe,GAAG,KAAK,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B;IAChD,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClD,iBAAiB,GAAG,IAAI,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;QAC5C,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,cAAc,GAAG,EAAE,CAAC;QACxB,IAAI,8BAA8B,GAAG,KAAK,CAAC;Q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AAC,iBAAiB,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAErC,eAAe;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,gCAAgC;QACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B;QAE1D,sBAAsB;QACtB,yEAAyE;QACzE,2EAA2E;QAC3E,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe;IACtB,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAChC,eAAe,GAAG,KAAK,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -21,6 +21,29 @@ export declare const KITTY_KEYCODE_ENTER = 13;
|
|
|
21
21
|
export declare const KITTY_KEYCODE_NUMPAD_ENTER = 57414;
|
|
22
22
|
export declare const KITTY_KEYCODE_TAB = 9;
|
|
23
23
|
export declare const KITTY_KEYCODE_BACKSPACE = 127;
|
|
24
|
+
/**
|
|
25
|
+
* Kitty modifier decoding constants
|
|
26
|
+
*
|
|
27
|
+
* In Kitty/Ghostty, the modifier parameter is encoded as (1 + bitmask).
|
|
28
|
+
* Some terminals also set bit 7 (i.e., add 128) when reporting event types.
|
|
29
|
+
*/
|
|
30
|
+
export declare const KITTY_MODIFIER_BASE = 1;
|
|
31
|
+
export declare const KITTY_MODIFIER_EVENT_TYPES_OFFSET = 128;
|
|
32
|
+
/**
|
|
33
|
+
* Modifier bit flags for Kitty/Xterm-style parameters.
|
|
34
|
+
*
|
|
35
|
+
* Per spec, the modifiers parameter encodes (1 + bitmask) where:
|
|
36
|
+
* - 1: no modifiers
|
|
37
|
+
* - bit 0 (1): Shift
|
|
38
|
+
* - bit 1 (2): Alt/Option (reported as "alt" in spec; we map to meta)
|
|
39
|
+
* - bit 2 (4): Ctrl
|
|
40
|
+
*
|
|
41
|
+
* Some terminals add 128 to the entire modifiers field when reporting event types.
|
|
42
|
+
* See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
|
|
43
|
+
*/
|
|
44
|
+
export declare const MODIFIER_SHIFT_BIT = 1;
|
|
45
|
+
export declare const MODIFIER_ALT_BIT = 2;
|
|
46
|
+
export declare const MODIFIER_CTRL_BIT = 4;
|
|
24
47
|
/**
|
|
25
48
|
* Timing constants for terminal interactions
|
|
26
49
|
*/
|
|
@@ -42,7 +65,7 @@ export declare const BACKSLASH_ENTER_DETECTION_WINDOW_MS = 5;
|
|
|
42
65
|
* Longest reasonable: \x1b[127;15~ = 11 chars (Del with all modifiers)
|
|
43
66
|
* We use 12 to provide a small buffer.
|
|
44
67
|
*/
|
|
45
|
-
export declare const MAX_KITTY_SEQUENCE_LENGTH =
|
|
68
|
+
export declare const MAX_KITTY_SEQUENCE_LENGTH = 32;
|
|
46
69
|
/**
|
|
47
70
|
* Character codes for common escape sequences
|
|
48
71
|
*/
|
|
@@ -21,6 +21,29 @@ export const KITTY_KEYCODE_ENTER = 13;
|
|
|
21
21
|
export const KITTY_KEYCODE_NUMPAD_ENTER = 57414;
|
|
22
22
|
export const KITTY_KEYCODE_TAB = 9;
|
|
23
23
|
export const KITTY_KEYCODE_BACKSPACE = 127;
|
|
24
|
+
/**
|
|
25
|
+
* Kitty modifier decoding constants
|
|
26
|
+
*
|
|
27
|
+
* In Kitty/Ghostty, the modifier parameter is encoded as (1 + bitmask).
|
|
28
|
+
* Some terminals also set bit 7 (i.e., add 128) when reporting event types.
|
|
29
|
+
*/
|
|
30
|
+
export const KITTY_MODIFIER_BASE = 1; // Base value per spec before bitmask decode
|
|
31
|
+
export const KITTY_MODIFIER_EVENT_TYPES_OFFSET = 128; // Added when event types are included
|
|
32
|
+
/**
|
|
33
|
+
* Modifier bit flags for Kitty/Xterm-style parameters.
|
|
34
|
+
*
|
|
35
|
+
* Per spec, the modifiers parameter encodes (1 + bitmask) where:
|
|
36
|
+
* - 1: no modifiers
|
|
37
|
+
* - bit 0 (1): Shift
|
|
38
|
+
* - bit 1 (2): Alt/Option (reported as "alt" in spec; we map to meta)
|
|
39
|
+
* - bit 2 (4): Ctrl
|
|
40
|
+
*
|
|
41
|
+
* Some terminals add 128 to the entire modifiers field when reporting event types.
|
|
42
|
+
* See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
|
|
43
|
+
*/
|
|
44
|
+
export const MODIFIER_SHIFT_BIT = 1;
|
|
45
|
+
export const MODIFIER_ALT_BIT = 2;
|
|
46
|
+
export const MODIFIER_CTRL_BIT = 4;
|
|
24
47
|
/**
|
|
25
48
|
* Timing constants for terminal interactions
|
|
26
49
|
*/
|
|
@@ -42,7 +65,9 @@ export const BACKSLASH_ENTER_DETECTION_WINDOW_MS = 5;
|
|
|
42
65
|
* Longest reasonable: \x1b[127;15~ = 11 chars (Del with all modifiers)
|
|
43
66
|
* We use 12 to provide a small buffer.
|
|
44
67
|
*/
|
|
45
|
-
|
|
68
|
+
// Increased to accommodate parameterized forms and occasional colon subfields
|
|
69
|
+
// while still being small enough to avoid pathological buffering.
|
|
70
|
+
export const MAX_KITTY_SEQUENCE_LENGTH = 32;
|
|
46
71
|
/**
|
|
47
72
|
* Character codes for common escape sequences
|
|
48
73
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformConstants.js","sourceRoot":"","sources":["../../../../src/ui/utils/platformConstants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ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,sCAAsC;AAE5F;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,QAAQ,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,8EAA8E;AAC9E,kEAAkE;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC"}
|
|
@@ -30,3 +30,13 @@ export declare function cpSlice(str: string, start: number, end?: number): strin
|
|
|
30
30
|
* - CR/LF (0x0D/0x0A) - needed for line breaks
|
|
31
31
|
*/
|
|
32
32
|
export declare function stripUnsafeCharacters(str: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Cached version of stringWidth function for better performance
|
|
35
|
+
* Follows Ink's approach with unlimited cache (no eviction)
|
|
36
|
+
*/
|
|
37
|
+
export declare const getCachedStringWidth: (str: string) => number;
|
|
38
|
+
/**
|
|
39
|
+
* Clear the string width cache
|
|
40
|
+
*/
|
|
41
|
+
export declare const clearStringWidthCache: () => void;
|
|
42
|
+
export declare function escapeAnsiCtrlCodes<T>(obj: T): T;
|