@machina.ai/cell-cli 1.11.0-rc1 → 1.13.0-rc1
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 +12 -10
- package/dist/src/commands/extensions/disable.d.ts +1 -1
- package/dist/src/commands/extensions/disable.js +15 -7
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/enable.d.ts +1 -1
- package/dist/src/commands/extensions/enable.js +15 -7
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/install.js +14 -3
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +39 -19
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.js +14 -3
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/list.js +13 -4
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.js +13 -2
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/update.js +18 -13
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions/validate.d.ts +12 -0
- package/dist/src/commands/extensions/validate.js +83 -0
- package/dist/src/commands/extensions/validate.js.map +1 -0
- package/dist/src/commands/extensions/validate.test.js +93 -0
- package/dist/src/commands/extensions/validate.test.js.map +1 -0
- package/dist/src/commands/extensions.js +3 -0
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/mcp/add.test.js +3 -0
- package/dist/src/commands/mcp/add.test.js.map +1 -1
- package/dist/src/commands/mcp/list.js +10 -3
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/list.test.js +37 -27
- package/dist/src/commands/mcp/list.test.js.map +1 -1
- package/dist/src/config/auth.js +0 -5
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +6 -3
- package/dist/src/config/config.js +65 -80
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +235 -212
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager.d.ts +63 -0
- package/dist/src/config/extension-manager.js +450 -0
- package/dist/src/config/extension-manager.js.map +1 -0
- package/dist/src/config/extension.d.ts +4 -51
- package/dist/src/config/extension.js +1 -535
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extension.test.js +525 -201
- package/dist/src/config/extension.test.js.map +1 -1
- package/dist/src/config/extensions/consent.d.ts +38 -0
- package/dist/src/config/extensions/consent.js +123 -0
- package/dist/src/config/extensions/consent.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.d.ts +1 -1
- package/dist/src/config/extensions/extensionEnablement.js +4 -3
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.test.js +10 -10
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.d.ts +15 -0
- package/dist/src/config/extensions/extensionSettings.js +113 -0
- package/dist/src/config/extensions/extensionSettings.js.map +1 -0
- package/dist/src/config/extensions/extensionSettings.test.d.ts +6 -0
- package/dist/src/config/extensions/extensionSettings.test.js +254 -0
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +2 -2
- package/dist/src/config/extensions/github.js +5 -10
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +153 -167
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/github_fetch.d.ts +1 -1
- package/dist/src/config/extensions/github_fetch.js +13 -1
- package/dist/src/config/extensions/github_fetch.js.map +1 -1
- package/dist/src/config/extensions/github_fetch.test.d.ts +6 -0
- package/dist/src/config/extensions/github_fetch.test.js +169 -0
- package/dist/src/config/extensions/github_fetch.test.js.map +1 -0
- package/dist/src/config/extensions/storage.d.ts +14 -0
- package/dist/src/config/extensions/storage.js +32 -0
- package/dist/src/config/extensions/storage.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +4 -4
- package/dist/src/config/extensions/update.js +39 -39
- package/dist/src/config/extensions/update.js.map +1 -1
- package/dist/src/config/extensions/update.test.js +72 -74
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/extensions/variableSchema.d.ts +0 -6
- package/dist/src/config/extensions/variableSchema.js.map +1 -1
- package/dist/src/config/extensions/variables.d.ts +4 -0
- package/dist/src/config/extensions/variables.js +6 -0
- package/dist/src/config/extensions/variables.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +3 -0
- package/dist/src/config/keyBindings.js +30 -8
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/keyBindings.test.js +17 -0
- package/dist/src/config/keyBindings.test.js.map +1 -1
- package/dist/src/config/policies/read-only.toml +56 -0
- package/dist/src/config/policies/write.toml +63 -0
- package/dist/src/config/policies/yolo.toml +31 -0
- package/dist/src/config/policy-engine.integration.test.js +41 -38
- package/dist/src/config/policy-engine.integration.test.js.map +1 -1
- package/dist/src/config/policy.d.ts +2 -2
- package/dist/src/config/policy.js +10 -148
- package/dist/src/config/policy.js.map +1 -1
- package/dist/src/config/sandboxConfig.d.ts +1 -1
- package/dist/src/config/sandboxConfig.js +6 -3
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +2 -1
- package/dist/src/config/settings.js +58 -18
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +128 -69
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +170 -28
- package/dist/src/config/settingsSchema.js +418 -27
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +42 -1
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/trustedFolders.d.ts +1 -1
- package/dist/src/config/trustedFolders.js +4 -2
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/core/initializer.js +2 -1
- package/dist/src/core/initializer.js.map +1 -1
- package/dist/src/gemini.d.ts +1 -1
- package/dist/src/gemini.js +46 -16
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +88 -30
- 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/nonInteractiveCli.d.ts +9 -1
- package/dist/src/nonInteractiveCli.js +114 -7
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +355 -112
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +4 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +22 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FeedbackService.js +2 -2
- package/dist/src/services/FeedbackService.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +2 -2
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +4 -2
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/test-utils/async.d.ts +9 -0
- package/dist/src/test-utils/async.js +29 -0
- package/dist/src/test-utils/async.js.map +1 -0
- package/dist/src/test-utils/createExtension.d.ts +3 -1
- package/dist/src/test-utils/createExtension.js +3 -3
- package/dist/src/test-utils/createExtension.js.map +1 -1
- package/dist/src/test-utils/render.d.ts +16 -2
- package/dist/src/test-utils/render.js +66 -4
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/test-utils/render.test.d.ts +6 -0
- package/dist/src/test-utils/render.test.js +79 -0
- package/dist/src/test-utils/render.test.js.map +1 -0
- package/dist/src/ui/App.test.js +1 -1
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.js +181 -65
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +505 -147
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.d.ts +14 -0
- package/dist/src/ui/auth/ApiAuthDialog.js +26 -0
- package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.js +91 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.js +7 -3
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/useAuth.d.ts +2 -0
- package/dist/src/ui/auth/useAuth.js +31 -2
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/colors.js +3 -0
- package/dist/src/ui/colors.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 +64 -11
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.js +72 -1
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +14 -14
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.js +4 -0
- package/dist/src/ui/commands/mcpCommand.test.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/memoryCommand.test.js +3 -1
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.d.ts +7 -0
- package/dist/src/ui/commands/policiesCommand.js +59 -0
- package/dist/src/ui/commands/policiesCommand.js.map +1 -0
- package/dist/src/ui/commands/policiesCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/policiesCommand.test.js +83 -0
- package/dist/src/ui/commands/policiesCommand.test.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.js +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +3 -3
- package/dist/src/ui/components/AsciiArt.js +3 -3
- package/dist/src/ui/components/Composer.js +1 -1
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +5 -2
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.js +4 -6
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
- package/dist/src/ui/components/ConsentPrompt.test.js +18 -8
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.test.js +11 -6
- package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +4 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +2 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.js +4 -3
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Footer.test.js +83 -0
- package/dist/src/ui/components/Footer.test.js.map +1 -1
- package/dist/src/ui/components/Header.test.js +13 -5
- package/dist/src/ui/components/Header.test.js.map +1 -1
- package/dist/src/ui/components/Help.test.js +5 -4
- package/dist/src/ui/components/Help.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +27 -8
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +776 -727
- package/dist/src/ui/components/InputPrompt.test.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 +28 -15
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.js +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +2 -2
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/MainContent.js +15 -4
- package/dist/src/ui/components/MainContent.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +1 -1
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +23 -13
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.js +38 -5
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +2 -2
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/PrepareLabel.test.js +14 -8
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +14 -6
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +11 -6
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.js +32 -25
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +428 -532
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +2 -2
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +2 -2
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.js +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.js +25 -17
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.js +27 -5
- package/dist/src/ui/components/messages/Todo.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.test.js +20 -8
- package/dist/src/ui/components/messages/Todo.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +29 -15
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.js +2 -2
- package/dist/src/ui/components/messages/WarningMessage.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +43 -22
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/TextInput.d.ts +15 -0
- package/dist/src/ui/components/shared/TextInput.js +38 -0
- package/dist/src/ui/components/shared/TextInput.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.test.d.ts +6 -0
- package/dist/src/ui/components/shared/TextInput.test.js +242 -0
- package/dist/src/ui/components/shared/TextInput.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +9 -2
- package/dist/src/ui/components/shared/text-buffer.js +51 -13
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +385 -202
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/components/views/ChatList.test.js +7 -4
- package/dist/src/ui/components/views/ChatList.test.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +7 -1
- package/dist/src/ui/components/views/ExtensionsList.js +9 -11
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.test.js +43 -22
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +23 -12
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +3 -2
- package/dist/src/ui/contexts/KeypressContext.js +610 -540
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +438 -718
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/MouseContext.d.ts +21 -0
- package/dist/src/ui/contexts/MouseContext.js +89 -0
- package/dist/src/ui/contexts/MouseContext.js.map +1 -0
- package/dist/src/ui/contexts/MouseContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/MouseContext.test.js +164 -0
- package/dist/src/ui/contexts/MouseContext.test.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.test.js +35 -17
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +2 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +2 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +31 -9
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +163 -64
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +64 -35
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +193 -165
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.js +16 -5
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +10 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +32 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +66 -64
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.test.js +26 -9
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.js +40 -34
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +14 -5
- package/dist/src/ui/hooks/useExtensionUpdates.js +18 -13
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +49 -44
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -1
- package/dist/src/ui/hooks/useFlickerDetector.test.js +9 -5
- package/dist/src/ui/hooks/useFlickerDetector.test.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.test.js +25 -9
- package/dist/src/ui/hooks/useFocus.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +46 -22
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +56 -19
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +260 -411
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +4 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +46 -34
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.js +2 -1
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +40 -9
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistory.test.js +2 -1
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +2 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.test.js +103 -114
- package/dist/src/ui/hooks/useKeypress.test.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +24 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +10 -5
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +62 -45
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useModelCommand.test.js +21 -11
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -1
- package/dist/src/ui/hooks/useMouse.d.ts +17 -0
- package/dist/src/ui/hooks/useMouse.js +27 -0
- package/dist/src/ui/hooks/useMouse.js.map +1 -0
- package/dist/src/ui/hooks/useMouse.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMouse.test.js +57 -0
- package/dist/src/ui/hooks/useMouse.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +2 -2
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.js +109 -106
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js +26 -6
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.js +2 -2
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.js +13 -14
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +55 -48
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +8 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +59 -34
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.js +65 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +2 -2
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.js +5 -4
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.test.js +272 -183
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.test.js +52 -20
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +18 -7
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +275 -137
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useTimer.test.js +43 -14
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +226 -242
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.js +235 -355
- package/dist/src/ui/hooks/vim.test.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +30 -3
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/state/extensions.d.ts +1 -0
- package/dist/src/ui/state/extensions.js +1 -0
- package/dist/src/ui/state/extensions.js.map +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -0
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +1 -0
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +2 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +2 -0
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +2 -0
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/color-utils.d.ts +1 -0
- package/dist/src/ui/themes/color-utils.js +6 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -1
- package/dist/src/ui/themes/color-utils.test.js +13 -1
- package/dist/src/ui/themes/color-utils.test.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +2 -0
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +2 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +2 -0
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +2 -0
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +3 -0
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +2 -0
- package/dist/src/ui/themes/semantic-tokens.js +6 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +2 -0
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +3 -0
- package/dist/src/ui/themes/theme.js +14 -3
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/theme.test.js +67 -1
- package/dist/src/ui/themes/theme.test.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +2 -0
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +3 -1
- package/dist/src/ui/types.js +2 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +2 -1
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +11 -10
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +11 -9
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +2 -2
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/input.d.ts +17 -0
- package/dist/src/ui/utils/input.js +51 -0
- package/dist/src/ui/utils/input.js.map +1 -0
- package/dist/src/ui/utils/input.test.d.ts +6 -0
- package/dist/src/ui/utils/input.test.js +44 -0
- package/dist/src/ui/utils/input.test.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +13 -4
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
- package/dist/src/ui/utils/mouse.d.ts +31 -0
- package/dist/src/ui/utils/mouse.js +164 -0
- package/dist/src/ui/utils/mouse.js.map +1 -0
- package/dist/src/ui/utils/mouse.test.d.ts +6 -0
- package/dist/src/ui/utils/mouse.test.js +131 -0
- package/dist/src/ui/utils/mouse.test.js.map +1 -0
- package/dist/src/ui/utils/textOutput.d.ts +25 -0
- package/dist/src/ui/utils/textOutput.js +49 -0
- package/dist/src/ui/utils/textOutput.js.map +1 -0
- package/dist/src/ui/utils/textOutput.test.d.ts +6 -0
- package/dist/src/ui/utils/textOutput.test.js +79 -0
- package/dist/src/ui/utils/textOutput.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +7 -1
- package/dist/src/ui/utils/updateCheck.js +33 -29
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.js +24 -50
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -1
- package/dist/src/utils/commentJson.js +2 -2
- package/dist/src/utils/commentJson.js.map +1 -1
- package/dist/src/utils/commentJson.test.js +7 -6
- package/dist/src/utils/commentJson.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.d.ts +2 -2
- package/dist/src/utils/envVarResolver.js +10 -7
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/events.d.ts +11 -2
- package/dist/src/utils/events.js +1 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.js +9 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/sandbox.js +16 -18
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/version.js +6 -2
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/zed-integration/acp.js +2 -1
- package/dist/src/zed-integration/acp.js.map +1 -1
- package/dist/src/zed-integration/schema.d.ts +4 -4
- package/dist/src/zed-integration/zedIntegration.d.ts +2 -2
- package/dist/src/zed-integration/zedIntegration.js +12 -19
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/dist/src/config/policy.test.js +0 -360
- package/dist/src/config/policy.test.js.map +0 -1
- package/dist/src/utils/package.d.ts +0 -12
- package/dist/src/utils/package.js +0 -24
- package/dist/src/utils/package.js.map +0 -1
- /package/dist/src/{config/policy.test.d.ts → commands/extensions/validate.test.d.ts} +0 -0
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
/** @vitest-environment jsdom */
|
|
7
6
|
import { describe, it, expect, vi } from 'vitest';
|
|
8
|
-
import {
|
|
7
|
+
import { act, useState } from 'react';
|
|
8
|
+
import { renderHook } from '../../test-utils/render.js';
|
|
9
|
+
import { waitFor } from '../../test-utils/async.js';
|
|
9
10
|
import { useSlashCompletion } from './useSlashCompletion.js';
|
|
10
11
|
import { CommandKind } from '../commands/types.js';
|
|
11
|
-
import { useState } from 'react';
|
|
12
12
|
function createTestCommand(command) {
|
|
13
13
|
return {
|
|
14
14
|
kind: CommandKind.BUILT_IN, // default for tests
|
|
@@ -154,25 +154,67 @@ describe('useSlashCompletion', () => {
|
|
|
154
154
|
}),
|
|
155
155
|
createTestCommand({ name: 'chat', description: 'Manage chat history' }),
|
|
156
156
|
];
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
let result;
|
|
158
|
+
let unmount;
|
|
159
|
+
await act(async () => {
|
|
160
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, '/', slashCommands, mockCommandContext));
|
|
161
|
+
result = hook.result;
|
|
162
|
+
unmount = hook.unmount;
|
|
163
|
+
});
|
|
164
|
+
await act(async () => {
|
|
165
|
+
await waitFor(() => {
|
|
166
|
+
expect(result.current.suggestions.length).toBe(slashCommands.length);
|
|
167
|
+
expect(result.current.suggestions.map((s) => s.label)).toEqual(expect.arrayContaining([
|
|
168
|
+
'help',
|
|
169
|
+
'clear',
|
|
170
|
+
'memory',
|
|
171
|
+
'chat',
|
|
172
|
+
'stats',
|
|
173
|
+
]));
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
unmount();
|
|
160
177
|
});
|
|
161
178
|
it('should filter commands based on partial input', async () => {
|
|
162
179
|
const slashCommands = [
|
|
163
180
|
createTestCommand({ name: 'memory', description: 'Manage memory' }),
|
|
164
181
|
];
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
182
|
+
const setSuggestions = vi.fn();
|
|
183
|
+
const setIsLoadingSuggestions = vi.fn();
|
|
184
|
+
const setIsPerfectMatch = vi.fn();
|
|
185
|
+
let result;
|
|
186
|
+
let unmount;
|
|
187
|
+
await act(async () => {
|
|
188
|
+
const hook = renderHook(() => useSlashCompletion({
|
|
189
|
+
enabled: true,
|
|
190
|
+
query: '/mem',
|
|
191
|
+
slashCommands,
|
|
192
|
+
commandContext: mockCommandContext,
|
|
193
|
+
setSuggestions,
|
|
194
|
+
setIsLoadingSuggestions,
|
|
195
|
+
setIsPerfectMatch,
|
|
196
|
+
}));
|
|
197
|
+
result = hook.result;
|
|
198
|
+
unmount = hook.unmount;
|
|
199
|
+
});
|
|
200
|
+
await act(async () => {
|
|
201
|
+
await waitFor(() => {
|
|
202
|
+
expect(setSuggestions).toHaveBeenCalledWith([
|
|
203
|
+
{
|
|
204
|
+
label: 'memory',
|
|
205
|
+
value: 'memory',
|
|
206
|
+
description: 'Manage memory',
|
|
207
|
+
commandKind: CommandKind.BUILT_IN,
|
|
208
|
+
},
|
|
209
|
+
]);
|
|
210
|
+
expect(result.current.completionStart).toBe(1);
|
|
211
|
+
expect(result.current.completionEnd).toBe(4);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
await act(async () => {
|
|
215
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
175
216
|
});
|
|
217
|
+
unmount();
|
|
176
218
|
});
|
|
177
219
|
it('should suggest commands based on partial altNames', async () => {
|
|
178
220
|
const slashCommands = [
|
|
@@ -182,7 +224,13 @@ describe('useSlashCompletion', () => {
|
|
|
182
224
|
description: 'check session stats. Usage: /stats [model|tools]',
|
|
183
225
|
}),
|
|
184
226
|
];
|
|
185
|
-
|
|
227
|
+
let result;
|
|
228
|
+
let unmount;
|
|
229
|
+
await act(async () => {
|
|
230
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, '/usag', slashCommands, mockCommandContext));
|
|
231
|
+
result = hook.result;
|
|
232
|
+
unmount = hook.unmount;
|
|
233
|
+
});
|
|
186
234
|
await waitFor(() => {
|
|
187
235
|
expect(result.current.suggestions).toEqual([
|
|
188
236
|
{
|
|
@@ -192,7 +240,9 @@ describe('useSlashCompletion', () => {
|
|
|
192
240
|
commandKind: CommandKind.BUILT_IN,
|
|
193
241
|
},
|
|
194
242
|
]);
|
|
243
|
+
expect(result.current.completionStart).toBe(1);
|
|
195
244
|
});
|
|
245
|
+
unmount();
|
|
196
246
|
});
|
|
197
247
|
it('should NOT provide suggestions for a perfectly typed command that is a leaf node', async () => {
|
|
198
248
|
const slashCommands = [
|
|
@@ -202,8 +252,18 @@ describe('useSlashCompletion', () => {
|
|
|
202
252
|
action: vi.fn(),
|
|
203
253
|
}),
|
|
204
254
|
];
|
|
205
|
-
|
|
206
|
-
|
|
255
|
+
let result;
|
|
256
|
+
let unmount;
|
|
257
|
+
await act(async () => {
|
|
258
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, '/clear', slashCommands, mockCommandContext));
|
|
259
|
+
result = hook.result;
|
|
260
|
+
unmount = hook.unmount;
|
|
261
|
+
});
|
|
262
|
+
await waitFor(() => {
|
|
263
|
+
expect(result.current.suggestions).toHaveLength(0);
|
|
264
|
+
expect(result.current.completionStart).toBe(1);
|
|
265
|
+
});
|
|
266
|
+
unmount();
|
|
207
267
|
});
|
|
208
268
|
it.each([['/?'], ['/usage']])('should not suggest commands when altNames is fully typed', async (query) => {
|
|
209
269
|
const mockSlashCommands = [
|
|
@@ -220,22 +280,51 @@ describe('useSlashCompletion', () => {
|
|
|
220
280
|
action: vi.fn(),
|
|
221
281
|
}),
|
|
222
282
|
];
|
|
223
|
-
|
|
224
|
-
|
|
283
|
+
let result;
|
|
284
|
+
let unmount;
|
|
285
|
+
await act(async () => {
|
|
286
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, query, mockSlashCommands, mockCommandContext));
|
|
287
|
+
result = hook.result;
|
|
288
|
+
unmount = hook.unmount;
|
|
289
|
+
});
|
|
290
|
+
await waitFor(() => {
|
|
291
|
+
expect(result.current.suggestions).toHaveLength(0);
|
|
292
|
+
expect(result.current.completionStart).toBe(1);
|
|
293
|
+
});
|
|
294
|
+
unmount();
|
|
225
295
|
});
|
|
226
296
|
it('should not provide suggestions for a fully typed command that has no sub-commands or argument completion', async () => {
|
|
227
297
|
const slashCommands = [
|
|
228
298
|
createTestCommand({ name: 'clear', description: 'Clear the screen' }),
|
|
229
299
|
];
|
|
230
|
-
|
|
231
|
-
|
|
300
|
+
let result;
|
|
301
|
+
let unmount;
|
|
302
|
+
await act(async () => {
|
|
303
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, '/clear ', slashCommands, mockCommandContext));
|
|
304
|
+
result = hook.result;
|
|
305
|
+
unmount = hook.unmount;
|
|
306
|
+
});
|
|
307
|
+
await waitFor(() => {
|
|
308
|
+
expect(result.current.suggestions).toHaveLength(0);
|
|
309
|
+
});
|
|
310
|
+
unmount();
|
|
232
311
|
});
|
|
233
312
|
it('should not provide suggestions for an unknown command', async () => {
|
|
234
313
|
const slashCommands = [
|
|
235
314
|
createTestCommand({ name: 'help', description: 'Show help' }),
|
|
236
315
|
];
|
|
237
|
-
|
|
238
|
-
|
|
316
|
+
let result;
|
|
317
|
+
let unmount;
|
|
318
|
+
await act(async () => {
|
|
319
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, '/unknown-command', slashCommands, mockCommandContext));
|
|
320
|
+
result = hook.result;
|
|
321
|
+
unmount = hook.unmount;
|
|
322
|
+
});
|
|
323
|
+
await waitFor(() => {
|
|
324
|
+
expect(result.current.suggestions).toHaveLength(0);
|
|
325
|
+
expect(result.current.completionStart).toBe(1);
|
|
326
|
+
});
|
|
327
|
+
unmount();
|
|
239
328
|
});
|
|
240
329
|
it('should not suggest hidden commands', async () => {
|
|
241
330
|
const slashCommands = [
|
|
@@ -249,9 +338,18 @@ describe('useSlashCompletion', () => {
|
|
|
249
338
|
hidden: true,
|
|
250
339
|
}),
|
|
251
340
|
];
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
341
|
+
let result;
|
|
342
|
+
let unmount;
|
|
343
|
+
await act(async () => {
|
|
344
|
+
const hook = renderHook(() => useTestHarnessForSlashCompletion(true, '/', slashCommands, mockCommandContext));
|
|
345
|
+
result = hook.result;
|
|
346
|
+
unmount = hook.unmount;
|
|
347
|
+
});
|
|
348
|
+
await waitFor(() => {
|
|
349
|
+
expect(result.current.suggestions.length).toBe(1);
|
|
350
|
+
expect(result.current.suggestions[0].label).toBe('visible');
|
|
351
|
+
});
|
|
352
|
+
unmount();
|
|
255
353
|
});
|
|
256
354
|
});
|
|
257
355
|
describe('Sub-Commands', () => {
|
|
@@ -266,22 +364,25 @@ describe('useSlashCompletion', () => {
|
|
|
266
364
|
],
|
|
267
365
|
}),
|
|
268
366
|
];
|
|
269
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory', slashCommands, mockCommandContext));
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
367
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory ', slashCommands, mockCommandContext));
|
|
368
|
+
await waitFor(() => {
|
|
369
|
+
expect(result.current.suggestions).toHaveLength(2);
|
|
370
|
+
expect(result.current.suggestions).toEqual(expect.arrayContaining([
|
|
371
|
+
{
|
|
372
|
+
label: 'show',
|
|
373
|
+
value: 'show',
|
|
374
|
+
description: 'Show memory',
|
|
375
|
+
commandKind: CommandKind.BUILT_IN,
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
label: 'add',
|
|
379
|
+
value: 'add',
|
|
380
|
+
description: 'Add to memory',
|
|
381
|
+
commandKind: CommandKind.BUILT_IN,
|
|
382
|
+
},
|
|
383
|
+
]));
|
|
384
|
+
});
|
|
385
|
+
unmount();
|
|
285
386
|
});
|
|
286
387
|
it('should suggest all sub-commands when the query ends with the parent command and a space', async () => {
|
|
287
388
|
const slashCommands = [
|
|
@@ -294,22 +395,25 @@ describe('useSlashCompletion', () => {
|
|
|
294
395
|
],
|
|
295
396
|
}),
|
|
296
397
|
];
|
|
297
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory ', slashCommands, mockCommandContext));
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
398
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory ', slashCommands, mockCommandContext));
|
|
399
|
+
await waitFor(() => {
|
|
400
|
+
expect(result.current.suggestions).toHaveLength(2);
|
|
401
|
+
expect(result.current.suggestions).toEqual(expect.arrayContaining([
|
|
402
|
+
{
|
|
403
|
+
label: 'show',
|
|
404
|
+
value: 'show',
|
|
405
|
+
description: 'Show memory',
|
|
406
|
+
commandKind: CommandKind.BUILT_IN,
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
label: 'add',
|
|
410
|
+
value: 'add',
|
|
411
|
+
description: 'Add to memory',
|
|
412
|
+
commandKind: CommandKind.BUILT_IN,
|
|
413
|
+
},
|
|
414
|
+
]));
|
|
415
|
+
});
|
|
416
|
+
unmount();
|
|
313
417
|
});
|
|
314
418
|
it('should filter sub-commands by prefix', async () => {
|
|
315
419
|
const slashCommands = [
|
|
@@ -322,7 +426,7 @@ describe('useSlashCompletion', () => {
|
|
|
322
426
|
],
|
|
323
427
|
}),
|
|
324
428
|
];
|
|
325
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory a', slashCommands, mockCommandContext));
|
|
429
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory a', slashCommands, mockCommandContext));
|
|
326
430
|
await waitFor(() => {
|
|
327
431
|
expect(result.current.suggestions).toEqual([
|
|
328
432
|
{
|
|
@@ -332,7 +436,9 @@ describe('useSlashCompletion', () => {
|
|
|
332
436
|
commandKind: CommandKind.BUILT_IN,
|
|
333
437
|
},
|
|
334
438
|
]);
|
|
439
|
+
expect(result.current.completionStart).toBe(8);
|
|
335
440
|
});
|
|
441
|
+
unmount();
|
|
336
442
|
});
|
|
337
443
|
it('should provide no suggestions for an invalid sub-command', async () => {
|
|
338
444
|
const slashCommands = [
|
|
@@ -345,8 +451,14 @@ describe('useSlashCompletion', () => {
|
|
|
345
451
|
],
|
|
346
452
|
}),
|
|
347
453
|
];
|
|
348
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory dothisnow', slashCommands, mockCommandContext));
|
|
349
|
-
|
|
454
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory dothisnow', slashCommands, mockCommandContext));
|
|
455
|
+
await act(async () => {
|
|
456
|
+
await waitFor(() => {
|
|
457
|
+
expect(result.current.suggestions).toHaveLength(0);
|
|
458
|
+
expect(result.current.completionStart).toBe(8);
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
unmount();
|
|
350
462
|
});
|
|
351
463
|
});
|
|
352
464
|
describe('Argument Completion', () => {
|
|
@@ -372,22 +484,29 @@ describe('useSlashCompletion', () => {
|
|
|
372
484
|
],
|
|
373
485
|
}),
|
|
374
486
|
];
|
|
375
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/chat resume my-ch', slashCommands, mockCommandContext));
|
|
376
|
-
await
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
487
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/chat resume my-ch', slashCommands, mockCommandContext));
|
|
488
|
+
await act(async () => {
|
|
489
|
+
await waitFor(() => {
|
|
490
|
+
expect(mockCompletionFn).toHaveBeenCalledWith(expect.objectContaining({
|
|
491
|
+
invocation: {
|
|
492
|
+
raw: '/chat resume my-ch',
|
|
493
|
+
name: 'resume',
|
|
494
|
+
args: 'my-ch',
|
|
495
|
+
},
|
|
496
|
+
}), 'my-ch');
|
|
497
|
+
});
|
|
384
498
|
});
|
|
385
|
-
await
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
499
|
+
await act(async () => {
|
|
500
|
+
await waitFor(() => {
|
|
501
|
+
expect(result.current.suggestions).toEqual([
|
|
502
|
+
{ label: 'my-chat-tag-1', value: 'my-chat-tag-1' },
|
|
503
|
+
{ label: 'my-chat-tag-2', value: 'my-chat-tag-2' },
|
|
504
|
+
]);
|
|
505
|
+
expect(result.current.completionStart).toBe(13);
|
|
506
|
+
expect(result.current.isLoadingSuggestions).toBe(false);
|
|
507
|
+
});
|
|
390
508
|
});
|
|
509
|
+
unmount();
|
|
391
510
|
});
|
|
392
511
|
it('should call command.completion with an empty string when args start with a space', async () => {
|
|
393
512
|
const mockCompletionFn = vi
|
|
@@ -406,39 +525,41 @@ describe('useSlashCompletion', () => {
|
|
|
406
525
|
],
|
|
407
526
|
}),
|
|
408
527
|
];
|
|
409
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/chat resume ', slashCommands, mockCommandContext));
|
|
410
|
-
await
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
528
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/chat resume ', slashCommands, mockCommandContext));
|
|
529
|
+
await act(async () => {
|
|
530
|
+
await waitFor(() => {
|
|
531
|
+
expect(mockCompletionFn).toHaveBeenCalledWith(expect.objectContaining({
|
|
532
|
+
invocation: {
|
|
533
|
+
raw: '/chat resume ',
|
|
534
|
+
name: 'resume',
|
|
535
|
+
args: '',
|
|
536
|
+
},
|
|
537
|
+
}), '');
|
|
538
|
+
});
|
|
418
539
|
});
|
|
419
|
-
await
|
|
420
|
-
|
|
540
|
+
await act(async () => {
|
|
541
|
+
await waitFor(() => {
|
|
542
|
+
expect(result.current.suggestions).toHaveLength(3);
|
|
543
|
+
expect(result.current.completionStart).toBe(13);
|
|
544
|
+
});
|
|
421
545
|
});
|
|
546
|
+
unmount();
|
|
422
547
|
});
|
|
423
548
|
it('should handle completion function that returns null', async () => {
|
|
424
|
-
const
|
|
549
|
+
const mockCompletionFn = vi.fn().mockResolvedValue(null);
|
|
425
550
|
const slashCommands = [
|
|
426
551
|
createTestCommand({
|
|
427
|
-
name: '
|
|
428
|
-
description: '
|
|
429
|
-
|
|
430
|
-
createTestCommand({
|
|
431
|
-
name: 'resume',
|
|
432
|
-
description: 'Resume a saved chat',
|
|
433
|
-
completion: completionFn,
|
|
434
|
-
}),
|
|
435
|
-
],
|
|
552
|
+
name: 'test',
|
|
553
|
+
description: 'Test command',
|
|
554
|
+
completion: mockCompletionFn,
|
|
436
555
|
}),
|
|
437
556
|
];
|
|
438
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/
|
|
557
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/test arg', slashCommands, mockCommandContext));
|
|
439
558
|
await waitFor(() => {
|
|
440
|
-
expect(result.current.suggestions).
|
|
559
|
+
expect(result.current.suggestions).toEqual([]);
|
|
560
|
+
expect(result.current.isLoadingSuggestions).toBe(false);
|
|
441
561
|
});
|
|
562
|
+
unmount();
|
|
442
563
|
});
|
|
443
564
|
});
|
|
444
565
|
describe('Command Kind Information', () => {
|
|
@@ -457,21 +578,24 @@ describe('useSlashCompletion', () => {
|
|
|
457
578
|
action: vi.fn(),
|
|
458
579
|
},
|
|
459
580
|
];
|
|
460
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/', slashCommands, mockCommandContext));
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
581
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/', slashCommands, mockCommandContext));
|
|
582
|
+
await waitFor(() => {
|
|
583
|
+
expect(result.current.suggestions).toEqual(expect.arrayContaining([
|
|
584
|
+
{
|
|
585
|
+
label: 'summarize',
|
|
586
|
+
value: 'summarize',
|
|
587
|
+
description: 'Summarize content',
|
|
588
|
+
commandKind: CommandKind.MCP_PROMPT,
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
label: 'help',
|
|
592
|
+
value: 'help',
|
|
593
|
+
description: 'Show help',
|
|
594
|
+
commandKind: CommandKind.BUILT_IN,
|
|
595
|
+
},
|
|
596
|
+
]));
|
|
597
|
+
});
|
|
598
|
+
unmount();
|
|
475
599
|
});
|
|
476
600
|
it('should include commandKind when filtering MCP commands by prefix', async () => {
|
|
477
601
|
const slashCommands = [
|
|
@@ -488,7 +612,7 @@ describe('useSlashCompletion', () => {
|
|
|
488
612
|
action: vi.fn(),
|
|
489
613
|
},
|
|
490
614
|
];
|
|
491
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/summ', slashCommands, mockCommandContext));
|
|
615
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/summ', slashCommands, mockCommandContext));
|
|
492
616
|
await waitFor(() => {
|
|
493
617
|
expect(result.current.suggestions).toEqual([
|
|
494
618
|
{
|
|
@@ -498,7 +622,9 @@ describe('useSlashCompletion', () => {
|
|
|
498
622
|
commandKind: CommandKind.MCP_PROMPT,
|
|
499
623
|
},
|
|
500
624
|
]);
|
|
625
|
+
expect(result.current.completionStart).toBe(1);
|
|
501
626
|
});
|
|
627
|
+
unmount();
|
|
502
628
|
});
|
|
503
629
|
it('should include commandKind for sub-commands', async () => {
|
|
504
630
|
const slashCommands = [
|
|
@@ -522,21 +648,24 @@ describe('useSlashCompletion', () => {
|
|
|
522
648
|
],
|
|
523
649
|
},
|
|
524
650
|
];
|
|
525
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory', slashCommands, mockCommandContext));
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
651
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/memory', slashCommands, mockCommandContext));
|
|
652
|
+
await waitFor(() => {
|
|
653
|
+
expect(result.current.suggestions).toEqual(expect.arrayContaining([
|
|
654
|
+
{
|
|
655
|
+
label: 'show',
|
|
656
|
+
value: 'show',
|
|
657
|
+
description: 'Show memory',
|
|
658
|
+
commandKind: CommandKind.BUILT_IN,
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
label: 'add',
|
|
662
|
+
value: 'add',
|
|
663
|
+
description: 'Add to memory',
|
|
664
|
+
commandKind: CommandKind.MCP_PROMPT,
|
|
665
|
+
},
|
|
666
|
+
]));
|
|
667
|
+
});
|
|
668
|
+
unmount();
|
|
540
669
|
});
|
|
541
670
|
it('should include commandKind for file commands', async () => {
|
|
542
671
|
const slashCommands = [
|
|
@@ -547,7 +676,7 @@ describe('useSlashCompletion', () => {
|
|
|
547
676
|
action: vi.fn(),
|
|
548
677
|
},
|
|
549
678
|
];
|
|
550
|
-
const { result } = renderHook(() => useTestHarnessForSlashCompletion(true, '/custom', slashCommands, mockCommandContext));
|
|
679
|
+
const { result, unmount } = renderHook(() => useTestHarnessForSlashCompletion(true, '/custom', slashCommands, mockCommandContext));
|
|
551
680
|
await waitFor(() => {
|
|
552
681
|
expect(result.current.suggestions).toEqual([
|
|
553
682
|
{
|
|
@@ -557,10 +686,12 @@ describe('useSlashCompletion', () => {
|
|
|
557
686
|
commandKind: CommandKind.FILE,
|
|
558
687
|
},
|
|
559
688
|
]);
|
|
689
|
+
expect(result.current.completionStart).toBe(1);
|
|
560
690
|
});
|
|
691
|
+
unmount();
|
|
561
692
|
});
|
|
562
693
|
});
|
|
563
|
-
it('should not call shared callbacks when disabled', () => {
|
|
694
|
+
it('should not call shared callbacks when disabled', async () => {
|
|
564
695
|
const mockSetSuggestions = vi.fn();
|
|
565
696
|
const mockSetIsLoadingSuggestions = vi.fn();
|
|
566
697
|
const mockSetIsPerfectMatch = vi.fn();
|
|
@@ -570,7 +701,7 @@ describe('useSlashCompletion', () => {
|
|
|
570
701
|
description: 'Show help',
|
|
571
702
|
}),
|
|
572
703
|
];
|
|
573
|
-
const { rerender } = renderHook(({ enabled, query }) => useSlashCompletion({
|
|
704
|
+
const { rerender, unmount } = renderHook(({ enabled, query }) => useSlashCompletion({
|
|
574
705
|
enabled,
|
|
575
706
|
query,
|
|
576
707
|
slashCommands,
|
|
@@ -588,10 +719,17 @@ describe('useSlashCompletion', () => {
|
|
|
588
719
|
// Change query while disabled (simulating @ completion typing)
|
|
589
720
|
rerender({ enabled: false, query: '@src/file.ts' });
|
|
590
721
|
rerender({ enabled: false, query: '@src/file.tsx' });
|
|
722
|
+
// Wait for any internal async operations to settle to avoid act warnings
|
|
723
|
+
await act(async () => {
|
|
724
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
725
|
+
});
|
|
591
726
|
// Should not have called shared callbacks during @ completion typing
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
727
|
+
await waitFor(() => {
|
|
728
|
+
expect(mockSetSuggestions).not.toHaveBeenCalled();
|
|
729
|
+
expect(mockSetIsLoadingSuggestions).not.toHaveBeenCalled();
|
|
730
|
+
expect(mockSetIsPerfectMatch).not.toHaveBeenCalled();
|
|
731
|
+
});
|
|
732
|
+
unmount();
|
|
595
733
|
});
|
|
596
734
|
});
|
|
597
735
|
//# sourceMappingURL=useSlashCompletion.test.js.map
|