@machina.ai/cell-cli 1.10.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/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/package.json +14 -12
- package/dist/src/commands/extensions/disable.d.ts +1 -1
- package/dist/src/commands/extensions/disable.js +19 -8
- 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 +19 -9
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.js +46 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.js.map +1 -0
- package/dist/src/commands/extensions/install.d.ts +1 -0
- package/dist/src/commands/extensions/install.js +29 -4
- 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 +16 -4
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/list.js +17 -6
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/new.js +14 -20
- package/dist/src/commands/extensions/new.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.js +16 -4
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/update.js +28 -23
- 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.d.ts +6 -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.js +7 -4
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/add.test.d.ts +6 -0
- package/dist/src/commands/mcp/add.test.js +247 -0
- package/dist/src/commands/mcp/add.test.js.map +1 -0
- package/dist/src/commands/mcp/list.js +18 -9
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/list.test.d.ts +6 -0
- package/dist/src/commands/mcp/list.test.js +128 -0
- package/dist/src/commands/mcp/list.test.js.map +1 -0
- package/dist/src/commands/mcp/remove.js +3 -2
- package/dist/src/commands/mcp/remove.js.map +1 -1
- package/dist/src/commands/mcp/remove.test.d.ts +6 -0
- package/dist/src/commands/mcp/remove.test.js +175 -0
- package/dist/src/commands/mcp/remove.test.js.map +1 -0
- package/dist/src/commands/mcp.test.d.ts +6 -0
- package/dist/src/commands/mcp.test.js +62 -0
- package/dist/src/commands/mcp.test.js.map +1 -0
- package/dist/src/config/auth.js +0 -3
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +6 -15
- package/dist/src/config/config.integration.test.d.ts +6 -0
- package/dist/src/config/config.integration.test.js +321 -0
- package/dist/src/config/config.integration.test.js.map +1 -0
- package/dist/src/config/config.js +85 -164
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.d.ts +6 -0
- package/dist/src/config/config.test.js +1972 -0
- package/dist/src/config/config.test.js.map +1 -0
- 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 -61
- package/dist/src/config/extension.js +1 -538
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extension.test.d.ts +6 -0
- package/dist/src/config/extension.test.js +1412 -0
- package/dist/src/config/extension.test.js.map +1 -0
- 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 +2 -2
- package/dist/src/config/extensions/extensionEnablement.js +7 -5
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.test.js +31 -28
- 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 +18 -9
- package/dist/src/config/extensions/github.js +108 -36
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +158 -164
- 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 +5 -4
- package/dist/src/config/extensions/update.js +41 -37
- 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 -4
- 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 +5 -1
- package/dist/src/config/keyBindings.js +34 -10
- 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 +4 -3
- package/dist/src/config/policy.js +13 -142
- package/dist/src/config/policy.js.map +1 -1
- package/dist/src/config/sandboxConfig.d.ts +1 -2
- package/dist/src/config/sandboxConfig.js +7 -6
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +2 -1
- package/dist/src/config/settings.js +59 -15
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.d.ts +6 -0
- package/dist/src/config/settings.test.js +2000 -0
- package/dist/src/config/settings.test.js.map +1 -0
- 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 +63 -27
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +123 -34
- 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 +205 -10
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.d.ts +6 -0
- package/dist/src/nonInteractiveCli.test.js +984 -0
- package/dist/src/nonInteractiveCli.test.js.map +1 -0
- package/dist/src/nonInteractiveCliCommands.js +2 -2
- package/dist/src/nonInteractiveCliCommands.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/CommandService.js +2 -1
- package/dist/src/services/CommandService.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/FileCommandLoader.test.d.ts +6 -0
- package/dist/src/services/FileCommandLoader.test.js +971 -0
- package/dist/src/services/FileCommandLoader.test.js.map +1 -0
- 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/services/prompt-processors/argumentProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/argumentProcessor.test.js +40 -0
- package/dist/src/services/prompt-processors/argumentProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +3 -2
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/shellProcessor.test.js +482 -0
- package/dist/src/services/prompt-processors/shellProcessor.test.js.map +1 -0
- 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 +17 -2
- package/dist/src/test-utils/render.js +69 -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.d.ts +6 -0
- package/dist/src/ui/App.test.js +110 -0
- package/dist/src/ui/App.test.js.map +1 -0
- package/dist/src/ui/AppContainer.js +223 -92
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +531 -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.d.ts +1 -1
- package/dist/src/ui/auth/AuthDialog.js +9 -3
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/useAuth.d.ts +3 -1
- package/dist/src/ui/auth/useAuth.js +35 -4
- 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/aboutCommand.js +1 -1
- package/dist/src/ui/commands/aboutCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/aboutCommand.test.js +130 -0
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.js +1 -1
- package/dist/src/ui/commands/authCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/authCommand.test.js +30 -0
- package/dist/src/ui/commands/authCommand.test.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.js +1 -1
- package/dist/src/ui/commands/bugCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/bugCommand.test.js +105 -0
- package/dist/src/ui/commands/bugCommand.test.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.js +1 -1
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/chatCommand.test.js +555 -0
- package/dist/src/ui/commands/chatCommand.test.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.js +1 -1
- package/dist/src/ui/commands/clearCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/clearCommand.test.js +76 -0
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.js +1 -1
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/compressCommand.test.js +98 -0
- package/dist/src/ui/commands/compressCommand.test.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.js +2 -1
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/copyCommand.test.js +242 -0
- package/dist/src/ui/commands/copyCommand.test.js.map +1 -0
- package/dist/src/ui/commands/corgiCommand.js +1 -1
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/corgiCommand.test.js +28 -0
- package/dist/src/ui/commands/corgiCommand.test.js.map +1 -0
- package/dist/src/ui/commands/directoryCommand.js +1 -1
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/directoryCommand.test.js +144 -0
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/docsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/docsCommand.test.js +72 -0
- package/dist/src/ui/commands/docsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.js +1 -1
- package/dist/src/ui/commands/editorCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/editorCommand.test.js +27 -0
- package/dist/src/ui/commands/editorCommand.test.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/src/ui/commands/extensionsCommand.test.js +315 -0
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.js +1 -1
- package/dist/src/ui/commands/helpCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/helpCommand.test.js +42 -0
- package/dist/src/ui/commands/helpCommand.test.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.js +6 -6
- package/dist/src/ui/commands/ideCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/ideCommand.test.js +205 -0
- package/dist/src/ui/commands/ideCommand.test.js.map +1 -0
- package/dist/src/ui/commands/initCommand.js +1 -1
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/initCommand.test.js +80 -0
- package/dist/src/ui/commands/initCommand.test.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.js +110 -100
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/mcpCommand.test.js +152 -0
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.js +6 -6
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/memoryCommand.test.js +268 -0
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -0
- 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/commands/privacyCommand.js +1 -1
- package/dist/src/ui/commands/privacyCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/privacyCommand.test.js +32 -0
- package/dist/src/ui/commands/privacyCommand.test.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.js +1 -1
- package/dist/src/ui/commands/quitCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/quitCommand.test.js +50 -0
- package/dist/src/ui/commands/quitCommand.test.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/restoreCommand.test.js +190 -0
- package/dist/src/ui/commands/restoreCommand.test.js.map +1 -0
- package/dist/src/ui/commands/settingsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/settingsCommand.test.js +30 -0
- package/dist/src/ui/commands/settingsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js +4 -3
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js +1 -2
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.js +3 -3
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/statsCommand.test.js +53 -0
- package/dist/src/ui/commands/statsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/terminalSetupCommand.test.js +66 -0
- package/dist/src/ui/commands/terminalSetupCommand.test.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.js +1 -1
- package/dist/src/ui/commands/themeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/themeCommand.test.js +32 -0
- package/dist/src/ui/commands/themeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.js +1 -1
- package/dist/src/ui/commands/toolsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/toolsCommand.test.js +100 -0
- package/dist/src/ui/commands/toolsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +1 -0
- package/dist/src/ui/commands/vimCommand.js +1 -1
- 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 +6 -4
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +21 -3
- 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.d.ts +0 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +2 -12
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ContextSummaryDisplay.test.js +71 -0
- package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -0
- 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 +5 -5
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +8 -3
- 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.d.ts +6 -0
- package/dist/src/ui/components/Footer.test.js +314 -0
- package/dist/src/ui/components/Footer.test.js.map +1 -0
- 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.d.ts +4 -0
- package/dist/src/ui/components/InputPrompt.js +80 -12
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/InputPrompt.test.js +1786 -0
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js +285 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -0
- 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.js +22 -18
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +12 -4
- 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.js +3 -3
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -1
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +15 -6
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/RawMarkdownIndicator.d.ts +7 -0
- package/dist/src/ui/components/RawMarkdownIndicator.js +8 -0
- package/dist/src/ui/components/RawMarkdownIndicator.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +74 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.js +43 -35
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +554 -545
- 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.d.ts +6 -0
- package/dist/src/ui/components/StatsDisplay.test.js +351 -0
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -0
- 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.d.ts +4 -2
- package/dist/src/ui/components/ThemeDialog.js +3 -3
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +14 -1
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ToolStatsDisplay.test.js +227 -0
- package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -0
- 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/GeminiMessage.js +3 -1
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/GeminiMessage.test.js +35 -0
- package/dist/src/ui/components/messages/GeminiMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js +3 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.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.d.ts +7 -0
- package/dist/src/ui/components/messages/Todo.js +91 -0
- package/dist/src/ui/components/messages/Todo.js.map +1 -0
- package/dist/src/ui/components/messages/Todo.test.d.ts +6 -0
- package/dist/src/ui/components/messages/Todo.test.js +114 -0
- package/dist/src/ui/components/messages/Todo.test.js.map +1 -0
- 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.js +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.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/ToolMessage.js +8 -3
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +2 -2
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +30 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserShellMessage.js +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.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 +34 -25
- 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 +52 -14
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.d.ts +6 -0
- package/dist/src/ui/components/shared/text-buffer.test.js +1761 -0
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.d.ts +6 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js +951 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -0
- 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 +12 -15
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.test.js +43 -29
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.d.ts +0 -1
- package/dist/src/ui/components/views/McpStatus.js +4 -4
- package/dist/src/ui/components/views/McpStatus.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +23 -17
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/components/views/ToolsList.test.js +4 -4
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +4 -2
- package/dist/src/ui/contexts/KeypressContext.js +635 -439
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +634 -515
- 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.d.ts +6 -0
- package/dist/src/ui/contexts/SessionContext.test.js +195 -0
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +7 -4
- package/dist/src/ui/contexts/UIStateContext.d.ts +5 -3
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +33 -11
- 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.js +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.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.js +2 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +807 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.js +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js +396 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -0
- 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 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +5 -3
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.js +377 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +6 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js +127 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -0
- 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 -4
- package/dist/src/ui/hooks/useExtensionUpdates.js +18 -11
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +52 -35
- 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.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.test.js +131 -0
- package/dist/src/ui/hooks/useFocus.test.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js +188 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +119 -74
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js +1820 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
- 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.js +2 -1
- package/dist/src/ui/hooks/useInputHistoryStore.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.d.ts +6 -0
- package/dist/src/ui/hooks/useKeypress.test.js +223 -0
- package/dist/src/ui/hooks/useKeypress.test.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +29 -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.d.ts +1 -0
- package/dist/src/ui/hooks/useMessageQueue.js +14 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +173 -35
- 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.d.ts +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +156 -5
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.js +158 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -0
- 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 +61 -36
- 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/useShowMemoryCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.js +4 -3
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +20 -8
- 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/useThemeCommand.d.ts +2 -1
- package/dist/src/ui/hooks/useThemeCommand.js +6 -0
- package/dist/src/ui/hooks/useThemeCommand.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 +229 -242
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/vim.js +2 -1
- package/dist/src/ui/hooks/vim.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.d.ts +6 -0
- package/dist/src/ui/hooks/vim.test.js +1269 -0
- package/dist/src/ui/hooks/vim.test.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.js +39 -6
- 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 +8 -1
- 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-manager.js +8 -7
- package/dist/src/ui/themes/theme-manager.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.d.ts +6 -0
- package/dist/src/ui/themes/theme.test.js +151 -0
- package/dist/src/ui/themes/theme.test.js.map +1 -0
- 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 -2
- package/dist/src/ui/types.js +2 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +6 -3
- 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.d.ts +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +19 -10
- 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/commandUtils.js +20 -3
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +61 -6
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/computeStats.js +5 -2
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/computeStats.test.d.ts +6 -0
- package/dist/src/ui/utils/computeStats.test.js +262 -0
- package/dist/src/ui/utils/computeStats.test.js.map +1 -0
- 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/terminalSetup.js +3 -2
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- 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 +9 -2
- package/dist/src/ui/utils/updateCheck.js +38 -30
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.js +48 -59
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -1
- package/dist/src/utils/cleanup.test.d.ts +6 -0
- package/dist/src/utils/cleanup.test.js +49 -0
- package/dist/src/utils/cleanup.test.js.map +1 -0
- 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/errors.d.ts +1 -0
- package/dist/src/utils/errors.js +66 -5
- package/dist/src/utils/errors.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/gitUtils.js +3 -2
- package/dist/src/utils/gitUtils.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/handleAutoUpdate.test.d.ts +6 -0
- package/dist/src/utils/handleAutoUpdate.test.js +225 -0
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -0
- package/dist/src/utils/installationInfo.js +2 -2
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +8 -4
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/readStdin.js +2 -1
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/sandbox-macos-permissive-open.sb +2 -0
- package/dist/src/utils/sandbox.js +28 -30
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sessionCleanup.js +4 -4
- package/dist/src/utils/sessionCleanup.js.map +1 -1
- package/dist/src/utils/startupWarnings.test.d.ts +6 -0
- package/dist/src/utils/startupWarnings.test.js +61 -0
- package/dist/src/utils/startupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.js +6 -2
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +2 -2
- package/dist/src/validateNonInterActiveAuth.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 +16 -25
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/dist/src/config/policy.test.js +0 -336
- package/dist/src/config/policy.test.js.map +0 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +0 -11
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +0 -44
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +0 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +0 -13
- package/dist/src/ui/hooks/useWorkspaceMigration.js +0 -59
- package/dist/src/ui/hooks/useWorkspaceMigration.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/examples/mcp-server/example.d.ts} +0 -0
|
@@ -4,13 +4,19 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
7
|
-
import {
|
|
7
|
+
import { act } from 'react';
|
|
8
|
+
import { renderHook } from '../../test-utils/render.js';
|
|
8
9
|
import { useReactToolScheduler, mapToDisplay, } from './useReactToolScheduler.js';
|
|
9
10
|
import { DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES, DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD, ToolConfirmationOutcome, ApprovalMode, MockTool, } from '@google/gemini-cli-core';
|
|
10
11
|
import { ToolCallStatus } from '../types.js';
|
|
11
12
|
// Mocks
|
|
12
13
|
vi.mock('@google/gemini-cli-core', async () => {
|
|
13
14
|
const actual = await vi.importActual('@google/gemini-cli-core');
|
|
15
|
+
// Patch CoreToolScheduler to have cancelAll if it's missing in the test environment
|
|
16
|
+
if (actual.CoreToolScheduler &&
|
|
17
|
+
!actual.CoreToolScheduler.prototype.cancelAll) {
|
|
18
|
+
actual.CoreToolScheduler.prototype.cancelAll = vi.fn();
|
|
19
|
+
}
|
|
14
20
|
return {
|
|
15
21
|
...actual,
|
|
16
22
|
ToolRegistry: vi.fn(),
|
|
@@ -41,6 +47,9 @@ const mockConfig = {
|
|
|
41
47
|
getUseModelRouter: () => false,
|
|
42
48
|
getGeminiClient: () => null, // No client needed for these tests
|
|
43
49
|
getShellExecutionConfig: () => ({ terminalWidth: 80, terminalHeight: 24 }),
|
|
50
|
+
getEnableMessageBusIntegration: () => false,
|
|
51
|
+
getMessageBus: () => null,
|
|
52
|
+
getPolicyEngine: () => null,
|
|
44
53
|
};
|
|
45
54
|
const mockTool = new MockTool({
|
|
46
55
|
name: 'mockTool',
|
|
@@ -67,10 +76,8 @@ const mockToolRequiresConfirmation = new MockTool({
|
|
|
67
76
|
});
|
|
68
77
|
describe('useReactToolScheduler in YOLO Mode', () => {
|
|
69
78
|
let onComplete;
|
|
70
|
-
let setPendingHistoryItem;
|
|
71
79
|
beforeEach(() => {
|
|
72
80
|
onComplete = vi.fn();
|
|
73
|
-
setPendingHistoryItem = vi.fn();
|
|
74
81
|
mockToolRegistry.getTool.mockClear();
|
|
75
82
|
mockToolRequiresConfirmation.execute.mockClear();
|
|
76
83
|
mockToolRequiresConfirmation.shouldConfirmExecute.mockClear();
|
|
@@ -84,7 +91,7 @@ describe('useReactToolScheduler in YOLO Mode', () => {
|
|
|
84
91
|
// IMPORTANT: Disable YOLO mode after this test suite
|
|
85
92
|
mockConfig.getApprovalMode.mockReturnValue(ApprovalMode.DEFAULT);
|
|
86
93
|
});
|
|
87
|
-
const renderSchedulerInYoloMode = () => renderHook(() => useReactToolScheduler(onComplete, mockConfig,
|
|
94
|
+
const renderSchedulerInYoloMode = () => renderHook(() => useReactToolScheduler(onComplete, mockConfig, () => undefined, () => { }));
|
|
88
95
|
it('should skip confirmation and execute tool directly when yoloMode is true', async () => {
|
|
89
96
|
mockToolRegistry.getTool.mockReturnValue(mockToolRequiresConfirmation);
|
|
90
97
|
const expectedOutput = 'YOLO Confirmed output';
|
|
@@ -103,13 +110,13 @@ describe('useReactToolScheduler in YOLO Mode', () => {
|
|
|
103
110
|
schedule(request, new AbortController().signal);
|
|
104
111
|
});
|
|
105
112
|
await act(async () => {
|
|
106
|
-
await vi.
|
|
113
|
+
await vi.advanceTimersByTimeAsync(0); // Process validation
|
|
107
114
|
});
|
|
108
115
|
await act(async () => {
|
|
109
|
-
await vi.
|
|
116
|
+
await vi.advanceTimersByTimeAsync(0); // Process scheduling
|
|
110
117
|
});
|
|
111
118
|
await act(async () => {
|
|
112
|
-
await vi.
|
|
119
|
+
await vi.advanceTimersByTimeAsync(0); // Process execution
|
|
113
120
|
});
|
|
114
121
|
// Check that execute WAS called
|
|
115
122
|
expect(mockToolRequiresConfirmation.execute).toHaveBeenCalledWith(request.args);
|
|
@@ -132,49 +139,27 @@ describe('useReactToolScheduler in YOLO Mode', () => {
|
|
|
132
139
|
}),
|
|
133
140
|
}),
|
|
134
141
|
]);
|
|
135
|
-
// Ensure no confirmation UI was triggered (setPendingHistoryItem should not have been called with confirmation details)
|
|
136
|
-
const setPendingHistoryItemCalls = setPendingHistoryItem.mock.calls;
|
|
137
|
-
const confirmationCall = setPendingHistoryItemCalls.find((call) => {
|
|
138
|
-
const item = typeof call[0] === 'function' ? call[0]({}) : call[0];
|
|
139
|
-
return item?.tools?.[0]?.confirmationDetails;
|
|
140
|
-
});
|
|
141
|
-
expect(confirmationCall).toBeUndefined();
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
describe('useReactToolScheduler', () => {
|
|
145
|
-
// TODO(ntaylormullen): The following tests are skipped due to difficulties in
|
|
146
|
-
// reliably testing the asynchronous state updates and interactions with timers.
|
|
147
|
-
// These tests involve complex sequences of events, including confirmations,
|
|
148
|
-
// live output updates, and cancellations, which are challenging to assert
|
|
149
|
-
// correctly with the current testing setup. Further investigation is needed
|
|
150
|
-
// to find a robust way to test these scenarios.
|
|
151
145
|
let onComplete;
|
|
152
|
-
let setPendingHistoryItem;
|
|
153
146
|
let capturedOnConfirmForTest;
|
|
147
|
+
const advanceAndSettle = async () => {
|
|
148
|
+
await act(async () => {
|
|
149
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
const scheduleAndWaitForExecution = async (schedule, request) => {
|
|
153
|
+
act(() => {
|
|
154
|
+
schedule(request, new AbortController().signal);
|
|
155
|
+
});
|
|
156
|
+
await advanceAndSettle();
|
|
157
|
+
await advanceAndSettle();
|
|
158
|
+
await advanceAndSettle();
|
|
159
|
+
};
|
|
154
160
|
beforeEach(() => {
|
|
155
161
|
onComplete = vi.fn();
|
|
156
162
|
capturedOnConfirmForTest = undefined;
|
|
157
|
-
setPendingHistoryItem = vi.fn((updaterOrValue) => {
|
|
158
|
-
let pendingItem = null;
|
|
159
|
-
if (typeof updaterOrValue === 'function') {
|
|
160
|
-
// Loosen the type for prevState to allow for more flexible updates in tests
|
|
161
|
-
const prevState = {
|
|
162
|
-
type: 'tool_group', // Still default to tool_group for most cases
|
|
163
|
-
tools: [],
|
|
164
|
-
};
|
|
165
|
-
pendingItem = updaterOrValue(prevState); // Allow any for more flexibility
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
pendingItem = updaterOrValue;
|
|
169
|
-
}
|
|
170
|
-
// Capture onConfirm if it exists, regardless of the exact type of pendingItem
|
|
171
|
-
// This is a common pattern in these tests.
|
|
172
|
-
if (pendingItem?.tools?.[0]?.confirmationDetails
|
|
173
|
-
?.onConfirm) {
|
|
174
|
-
capturedOnConfirmForTest = pendingItem
|
|
175
|
-
.tools[0].confirmationDetails?.onConfirm;
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
163
|
mockToolRegistry.getTool.mockClear();
|
|
179
164
|
mockTool.execute.mockClear();
|
|
180
165
|
mockTool.shouldConfirmExecute.mockClear();
|
|
@@ -196,7 +181,7 @@ describe('useReactToolScheduler', () => {
|
|
|
196
181
|
vi.clearAllTimers();
|
|
197
182
|
vi.useRealTimers();
|
|
198
183
|
});
|
|
199
|
-
const renderScheduler = () => renderHook(() => useReactToolScheduler(onComplete, mockConfig,
|
|
184
|
+
const renderScheduler = () => renderHook(() => useReactToolScheduler(onComplete, mockConfig, () => undefined, () => { }));
|
|
200
185
|
it('initial state should be empty', () => {
|
|
201
186
|
const { result } = renderScheduler();
|
|
202
187
|
expect(result.current[0]).toEqual([]);
|
|
@@ -209,120 +194,81 @@ describe('useReactToolScheduler', () => {
|
|
|
209
194
|
});
|
|
210
195
|
mockTool.shouldConfirmExecute.mockResolvedValue(null);
|
|
211
196
|
const { result } = renderScheduler();
|
|
212
|
-
const schedule = result.current[1];
|
|
213
197
|
const request = {
|
|
214
198
|
callId: 'call1',
|
|
215
199
|
name: 'mockTool',
|
|
216
200
|
args: { param: 'value' },
|
|
217
201
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
await act(async () => {
|
|
222
|
-
await vi.runAllTimersAsync();
|
|
223
|
-
});
|
|
224
|
-
await act(async () => {
|
|
225
|
-
await vi.runAllTimersAsync();
|
|
226
|
-
});
|
|
227
|
-
await act(async () => {
|
|
228
|
-
await vi.runAllTimersAsync();
|
|
202
|
+
let completedToolCalls = [];
|
|
203
|
+
onComplete.mockImplementation((calls) => {
|
|
204
|
+
completedToolCalls = calls;
|
|
229
205
|
});
|
|
206
|
+
await scheduleAndWaitForExecution(result.current[1], request);
|
|
230
207
|
expect(mockTool.execute).toHaveBeenCalledWith(request.args);
|
|
231
|
-
expect(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
{
|
|
239
|
-
functionResponse: {
|
|
240
|
-
id: 'call1',
|
|
241
|
-
name: 'mockTool',
|
|
242
|
-
response: { output: 'Tool output' },
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
}),
|
|
247
|
-
}),
|
|
248
|
-
]);
|
|
249
|
-
expect(result.current[0]).toEqual([]);
|
|
208
|
+
expect(completedToolCalls).toHaveLength(1);
|
|
209
|
+
expect(completedToolCalls[0].status).toBe('success');
|
|
210
|
+
expect(completedToolCalls[0].request).toBe(request);
|
|
211
|
+
if (completedToolCalls[0].status === 'success' ||
|
|
212
|
+
completedToolCalls[0].status === 'error') {
|
|
213
|
+
expect(completedToolCalls[0].response).toMatchSnapshot();
|
|
214
|
+
}
|
|
250
215
|
});
|
|
251
|
-
it('should
|
|
252
|
-
mockToolRegistry.getTool.mockReturnValue(
|
|
216
|
+
it('should clear previous tool calls when scheduling new ones', async () => {
|
|
217
|
+
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
|
218
|
+
mockTool.execute.mockResolvedValue({
|
|
219
|
+
llmContent: 'Tool output',
|
|
220
|
+
returnDisplay: 'Formatted tool output',
|
|
221
|
+
});
|
|
253
222
|
const { result } = renderScheduler();
|
|
254
223
|
const schedule = result.current[1];
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
224
|
+
const setToolCallsForDisplay = result.current[3];
|
|
225
|
+
// Manually set a tool call in the display.
|
|
226
|
+
const oldToolCall = {
|
|
227
|
+
request: { callId: 'oldCall' },
|
|
228
|
+
status: 'success',
|
|
259
229
|
};
|
|
260
230
|
act(() => {
|
|
261
|
-
|
|
262
|
-
});
|
|
263
|
-
await act(async () => {
|
|
264
|
-
await vi.runAllTimersAsync();
|
|
231
|
+
setToolCallsForDisplay([oldToolCall]);
|
|
265
232
|
});
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
expect(onComplete).toHaveBeenCalledWith([
|
|
270
|
-
expect.objectContaining({
|
|
271
|
-
status: 'error',
|
|
272
|
-
request,
|
|
273
|
-
response: expect.objectContaining({
|
|
274
|
-
error: expect.objectContaining({
|
|
275
|
-
message: expect.stringMatching(/Tool "nonexistentTool" not found in registry/),
|
|
276
|
-
}),
|
|
277
|
-
}),
|
|
278
|
-
}),
|
|
279
|
-
]);
|
|
280
|
-
const errorMessage = onComplete.mock.calls[0][0][0].response.error.message;
|
|
281
|
-
expect(errorMessage).toContain('Did you mean one of:');
|
|
282
|
-
expect(errorMessage).toContain('"mockTool"');
|
|
283
|
-
expect(errorMessage).toContain('"anotherTool"');
|
|
284
|
-
expect(result.current[0]).toEqual([]);
|
|
285
|
-
});
|
|
286
|
-
it('should handle error during shouldConfirmExecute', async () => {
|
|
287
|
-
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
|
288
|
-
const confirmError = new Error('Confirmation check failed');
|
|
289
|
-
mockTool.shouldConfirmExecute.mockRejectedValue(confirmError);
|
|
290
|
-
const { result } = renderScheduler();
|
|
291
|
-
const schedule = result.current[1];
|
|
292
|
-
const request = {
|
|
293
|
-
callId: 'call1',
|
|
233
|
+
expect(result.current[0]).toEqual([oldToolCall]);
|
|
234
|
+
const newRequest = {
|
|
235
|
+
callId: 'newCall',
|
|
294
236
|
name: 'mockTool',
|
|
295
237
|
args: {},
|
|
296
238
|
};
|
|
297
239
|
act(() => {
|
|
298
|
-
schedule(
|
|
240
|
+
schedule(newRequest, new AbortController().signal);
|
|
299
241
|
});
|
|
242
|
+
// After scheduling, the old call should be gone,
|
|
243
|
+
// and the new one should be in the display in its initial state.
|
|
244
|
+
expect(result.current[0].length).toBe(1);
|
|
245
|
+
expect(result.current[0][0].request.callId).toBe('newCall');
|
|
246
|
+
expect(result.current[0][0].request.callId).not.toBe('oldCall');
|
|
247
|
+
// Let the new call finish.
|
|
300
248
|
await act(async () => {
|
|
301
|
-
await vi.
|
|
249
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
302
250
|
});
|
|
303
251
|
await act(async () => {
|
|
304
|
-
await vi.
|
|
252
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
305
253
|
});
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
response: expect.objectContaining({
|
|
311
|
-
error: confirmError,
|
|
312
|
-
}),
|
|
313
|
-
}),
|
|
314
|
-
]);
|
|
315
|
-
expect(result.current[0]).toEqual([]);
|
|
254
|
+
await act(async () => {
|
|
255
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
256
|
+
});
|
|
257
|
+
expect(onComplete).toHaveBeenCalled();
|
|
316
258
|
});
|
|
317
|
-
it('should
|
|
259
|
+
it('should cancel all running tool calls', async () => {
|
|
318
260
|
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
|
261
|
+
let resolveExecute = () => { };
|
|
262
|
+
const executePromise = new Promise((resolve) => {
|
|
263
|
+
resolveExecute = resolve;
|
|
264
|
+
});
|
|
265
|
+
mockTool.execute.mockReturnValue(executePromise);
|
|
319
266
|
mockTool.shouldConfirmExecute.mockResolvedValue(null);
|
|
320
|
-
const execError = new Error('Execution failed');
|
|
321
|
-
mockTool.execute.mockRejectedValue(execError);
|
|
322
267
|
const { result } = renderScheduler();
|
|
323
268
|
const schedule = result.current[1];
|
|
269
|
+
const cancelAllToolCalls = result.current[4];
|
|
324
270
|
const request = {
|
|
325
|
-
callId: '
|
|
271
|
+
callId: 'cancelCall',
|
|
326
272
|
name: 'mockTool',
|
|
327
273
|
args: {},
|
|
328
274
|
};
|
|
@@ -330,26 +276,97 @@ describe('useReactToolScheduler', () => {
|
|
|
330
276
|
schedule(request, new AbortController().signal);
|
|
331
277
|
});
|
|
332
278
|
await act(async () => {
|
|
333
|
-
await vi.
|
|
334
|
-
});
|
|
279
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
280
|
+
}); // validation
|
|
335
281
|
await act(async () => {
|
|
336
|
-
await vi.
|
|
282
|
+
await vi.advanceTimersByTimeAsync(0); // Process scheduling
|
|
283
|
+
});
|
|
284
|
+
// At this point, the tool is 'executing' and waiting on the promise.
|
|
285
|
+
expect(result.current[0][0].status).toBe('executing');
|
|
286
|
+
const cancelController = new AbortController();
|
|
287
|
+
act(() => {
|
|
288
|
+
cancelAllToolCalls(cancelController.signal);
|
|
337
289
|
});
|
|
338
290
|
await act(async () => {
|
|
339
|
-
await vi.
|
|
291
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
340
292
|
});
|
|
341
293
|
expect(onComplete).toHaveBeenCalledWith([
|
|
342
294
|
expect.objectContaining({
|
|
343
|
-
status: '
|
|
295
|
+
status: 'cancelled',
|
|
344
296
|
request,
|
|
345
|
-
response: expect.objectContaining({
|
|
346
|
-
error: execError,
|
|
347
|
-
}),
|
|
348
297
|
}),
|
|
349
298
|
]);
|
|
350
|
-
|
|
299
|
+
// Clean up the pending promise to avoid open handles.
|
|
300
|
+
await act(async () => {
|
|
301
|
+
resolveExecute({ llmContent: 'output', returnDisplay: 'display' });
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
it.each([
|
|
305
|
+
{
|
|
306
|
+
desc: 'tool not found',
|
|
307
|
+
setup: () => {
|
|
308
|
+
mockToolRegistry.getTool.mockReturnValue(undefined);
|
|
309
|
+
},
|
|
310
|
+
request: {
|
|
311
|
+
callId: 'call1',
|
|
312
|
+
name: 'nonexistentTool',
|
|
313
|
+
args: {},
|
|
314
|
+
},
|
|
315
|
+
expectedErrorContains: [
|
|
316
|
+
'Tool "nonexistentTool" not found in registry',
|
|
317
|
+
'Did you mean one of:',
|
|
318
|
+
],
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
desc: 'error during shouldConfirmExecute',
|
|
322
|
+
setup: () => {
|
|
323
|
+
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
|
324
|
+
const confirmError = new Error('Confirmation check failed');
|
|
325
|
+
mockTool.shouldConfirmExecute.mockRejectedValue(confirmError);
|
|
326
|
+
},
|
|
327
|
+
request: {
|
|
328
|
+
callId: 'call1',
|
|
329
|
+
name: 'mockTool',
|
|
330
|
+
args: {},
|
|
331
|
+
},
|
|
332
|
+
expectedError: new Error('Confirmation check failed'),
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
desc: 'error during execute',
|
|
336
|
+
setup: () => {
|
|
337
|
+
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
|
338
|
+
mockTool.shouldConfirmExecute.mockResolvedValue(null);
|
|
339
|
+
const execError = new Error('Execution failed');
|
|
340
|
+
mockTool.execute.mockRejectedValue(execError);
|
|
341
|
+
},
|
|
342
|
+
request: {
|
|
343
|
+
callId: 'call1',
|
|
344
|
+
name: 'mockTool',
|
|
345
|
+
args: {},
|
|
346
|
+
},
|
|
347
|
+
expectedError: new Error('Execution failed'),
|
|
348
|
+
},
|
|
349
|
+
])('should handle $desc', async ({ setup, request, expectedErrorContains, expectedError }) => {
|
|
350
|
+
setup();
|
|
351
|
+
const { result } = renderScheduler();
|
|
352
|
+
let completedToolCalls = [];
|
|
353
|
+
onComplete.mockImplementation((calls) => {
|
|
354
|
+
completedToolCalls = calls;
|
|
355
|
+
});
|
|
356
|
+
await scheduleAndWaitForExecution(result.current[1], request);
|
|
357
|
+
expect(completedToolCalls).toHaveLength(1);
|
|
358
|
+
expect(completedToolCalls[0].status).toBe('error');
|
|
359
|
+
expect(completedToolCalls[0].request).toBe(request);
|
|
360
|
+
if (expectedErrorContains) {
|
|
361
|
+
expectedErrorContains.forEach((errorText) => {
|
|
362
|
+
expect(completedToolCalls[0].response.error.message).toContain(errorText);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
if (expectedError) {
|
|
366
|
+
expect(completedToolCalls[0].response.error.message).toBe(expectedError.message);
|
|
367
|
+
}
|
|
351
368
|
});
|
|
352
|
-
it
|
|
369
|
+
it('should handle tool requiring confirmation - approved', async () => {
|
|
353
370
|
mockToolRegistry.getTool.mockReturnValue(mockToolRequiresConfirmation);
|
|
354
371
|
const expectedOutput = 'Confirmed output';
|
|
355
372
|
mockToolRequiresConfirmation.execute.mockResolvedValue({
|
|
@@ -366,43 +383,28 @@ describe('useReactToolScheduler', () => {
|
|
|
366
383
|
act(() => {
|
|
367
384
|
schedule(request, new AbortController().signal);
|
|
368
385
|
});
|
|
369
|
-
await
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
386
|
+
await advanceAndSettle();
|
|
387
|
+
const waitingCall = result.current[0][0];
|
|
388
|
+
expect(waitingCall.status).toBe('awaiting_approval');
|
|
389
|
+
capturedOnConfirmForTest = waitingCall.confirmationDetails?.onConfirm;
|
|
373
390
|
expect(capturedOnConfirmForTest).toBeDefined();
|
|
374
391
|
await act(async () => {
|
|
375
392
|
await capturedOnConfirmForTest?.(ToolConfirmationOutcome.ProceedOnce);
|
|
376
393
|
});
|
|
377
|
-
await
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
await act(async () => {
|
|
381
|
-
await vi.runAllTimersAsync();
|
|
382
|
-
});
|
|
383
|
-
await act(async () => {
|
|
384
|
-
await vi.runAllTimersAsync();
|
|
385
|
-
});
|
|
394
|
+
await advanceAndSettle();
|
|
395
|
+
await advanceAndSettle();
|
|
396
|
+
await advanceAndSettle();
|
|
386
397
|
expect(mockOnUserConfirmForToolConfirmation).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
|
|
387
398
|
expect(mockToolRequiresConfirmation.execute).toHaveBeenCalled();
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
expect.objectContaining({
|
|
396
|
-
functionResponse: expect.objectContaining({
|
|
397
|
-
response: { output: expectedOutput },
|
|
398
|
-
}),
|
|
399
|
-
}),
|
|
400
|
-
]),
|
|
401
|
-
}),
|
|
402
|
-
}),
|
|
403
|
-
]);
|
|
399
|
+
const completedCalls = onComplete.mock.calls[0][0];
|
|
400
|
+
expect(completedCalls[0].status).toBe('success');
|
|
401
|
+
expect(completedCalls[0].request).toBe(request);
|
|
402
|
+
if (completedCalls[0].status === 'success' ||
|
|
403
|
+
completedCalls[0].status === 'error') {
|
|
404
|
+
expect(completedCalls[0].response).toMatchSnapshot();
|
|
405
|
+
}
|
|
404
406
|
});
|
|
405
|
-
it
|
|
407
|
+
it('should handle tool requiring confirmation - cancelled by user', async () => {
|
|
406
408
|
mockToolRegistry.getTool.mockReturnValue(mockToolRequiresConfirmation);
|
|
407
409
|
const { result } = renderScheduler();
|
|
408
410
|
const schedule = result.current[1];
|
|
@@ -414,40 +416,27 @@ describe('useReactToolScheduler', () => {
|
|
|
414
416
|
act(() => {
|
|
415
417
|
schedule(request, new AbortController().signal);
|
|
416
418
|
});
|
|
417
|
-
await
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
await advanceAndSettle();
|
|
420
|
+
const waitingCall = result.current[0][0];
|
|
421
|
+
expect(waitingCall.status).toBe('awaiting_approval');
|
|
422
|
+
capturedOnConfirmForTest = waitingCall.confirmationDetails?.onConfirm;
|
|
421
423
|
expect(capturedOnConfirmForTest).toBeDefined();
|
|
422
424
|
await act(async () => {
|
|
423
425
|
await capturedOnConfirmForTest?.(ToolConfirmationOutcome.Cancel);
|
|
424
426
|
});
|
|
425
|
-
await
|
|
426
|
-
|
|
427
|
-
});
|
|
428
|
-
await act(async () => {
|
|
429
|
-
await vi.runAllTimersAsync();
|
|
430
|
-
});
|
|
427
|
+
await advanceAndSettle();
|
|
428
|
+
await advanceAndSettle();
|
|
431
429
|
expect(mockOnUserConfirmForToolConfirmation).toHaveBeenCalledWith(ToolConfirmationOutcome.Cancel);
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
response: expect.objectContaining({
|
|
441
|
-
error: `User did not allow tool call ${request.name}. Reason: User cancelled.`,
|
|
442
|
-
}),
|
|
443
|
-
}),
|
|
444
|
-
}),
|
|
445
|
-
]),
|
|
446
|
-
}),
|
|
447
|
-
}),
|
|
448
|
-
]);
|
|
430
|
+
const completedCalls = onComplete.mock.calls[0][0];
|
|
431
|
+
expect(completedCalls[0].status).toBe('cancelled');
|
|
432
|
+
expect(completedCalls[0].request).toBe(request);
|
|
433
|
+
if (completedCalls[0].status === 'success' ||
|
|
434
|
+
completedCalls[0].status === 'error' ||
|
|
435
|
+
completedCalls[0].status === 'cancelled') {
|
|
436
|
+
expect(completedCalls[0].response).toMatchSnapshot();
|
|
437
|
+
}
|
|
449
438
|
});
|
|
450
|
-
it
|
|
439
|
+
it('should handle live output updates', async () => {
|
|
451
440
|
mockToolRegistry.getTool.mockReturnValue(mockToolWithLiveOutput);
|
|
452
441
|
let liveUpdateFn;
|
|
453
442
|
let resolveExecutePromise;
|
|
@@ -460,60 +449,40 @@ describe('useReactToolScheduler', () => {
|
|
|
460
449
|
});
|
|
461
450
|
mockToolWithLiveOutput.shouldConfirmExecute.mockResolvedValue(null);
|
|
462
451
|
const { result } = renderScheduler();
|
|
463
|
-
const schedule = result.current[1];
|
|
464
452
|
const request = {
|
|
465
453
|
callId: 'liveCall',
|
|
466
454
|
name: 'mockToolWithLiveOutput',
|
|
467
455
|
args: {},
|
|
468
456
|
};
|
|
469
457
|
act(() => {
|
|
470
|
-
|
|
471
|
-
});
|
|
472
|
-
await act(async () => {
|
|
473
|
-
await vi.runAllTimersAsync();
|
|
458
|
+
result.current[1](request, new AbortController().signal);
|
|
474
459
|
});
|
|
460
|
+
await advanceAndSettle();
|
|
475
461
|
expect(liveUpdateFn).toBeDefined();
|
|
476
|
-
expect(
|
|
462
|
+
expect(result.current[0][0].status).toBe('executing');
|
|
477
463
|
await act(async () => {
|
|
478
464
|
liveUpdateFn?.('Live output 1');
|
|
479
465
|
});
|
|
480
|
-
await
|
|
481
|
-
await vi.runAllTimersAsync();
|
|
482
|
-
});
|
|
466
|
+
await advanceAndSettle();
|
|
483
467
|
await act(async () => {
|
|
484
468
|
liveUpdateFn?.('Live output 2');
|
|
485
469
|
});
|
|
486
|
-
await
|
|
487
|
-
await vi.runAllTimersAsync();
|
|
488
|
-
});
|
|
470
|
+
await advanceAndSettle();
|
|
489
471
|
act(() => {
|
|
490
472
|
resolveExecutePromise({
|
|
491
473
|
llmContent: 'Final output',
|
|
492
474
|
returnDisplay: 'Final display',
|
|
493
475
|
});
|
|
494
476
|
});
|
|
495
|
-
await
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
expect.
|
|
503
|
-
|
|
504
|
-
request,
|
|
505
|
-
response: expect.objectContaining({
|
|
506
|
-
resultDisplay: 'Final display',
|
|
507
|
-
responseParts: expect.arrayContaining([
|
|
508
|
-
expect.objectContaining({
|
|
509
|
-
functionResponse: expect.objectContaining({
|
|
510
|
-
response: { output: 'Final output' },
|
|
511
|
-
}),
|
|
512
|
-
}),
|
|
513
|
-
]),
|
|
514
|
-
}),
|
|
515
|
-
}),
|
|
516
|
-
]);
|
|
477
|
+
await advanceAndSettle();
|
|
478
|
+
await advanceAndSettle();
|
|
479
|
+
const completedCalls = onComplete.mock.calls[0][0];
|
|
480
|
+
expect(completedCalls[0].status).toBe('success');
|
|
481
|
+
expect(completedCalls[0].request).toBe(request);
|
|
482
|
+
if (completedCalls[0].status === 'success' ||
|
|
483
|
+
completedCalls[0].status === 'error') {
|
|
484
|
+
expect(completedCalls[0].response).toMatchSnapshot();
|
|
485
|
+
}
|
|
517
486
|
expect(result.current[0]).toEqual([]);
|
|
518
487
|
});
|
|
519
488
|
it('should schedule and execute multiple tool calls', async () => {
|
|
@@ -550,16 +519,16 @@ describe('useReactToolScheduler', () => {
|
|
|
550
519
|
schedule(requests, new AbortController().signal);
|
|
551
520
|
});
|
|
552
521
|
await act(async () => {
|
|
553
|
-
await vi.
|
|
522
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
554
523
|
});
|
|
555
524
|
await act(async () => {
|
|
556
|
-
await vi.
|
|
525
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
557
526
|
});
|
|
558
527
|
await act(async () => {
|
|
559
|
-
await vi.
|
|
528
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
560
529
|
});
|
|
561
530
|
await act(async () => {
|
|
562
|
-
await vi.
|
|
531
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
563
532
|
});
|
|
564
533
|
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
565
534
|
const completedCalls = onComplete.mock.calls[0][0];
|
|
@@ -598,9 +567,10 @@ describe('useReactToolScheduler', () => {
|
|
|
598
567
|
],
|
|
599
568
|
}),
|
|
600
569
|
});
|
|
601
|
-
expect(
|
|
570
|
+
expect(completedCalls).toHaveLength(2);
|
|
571
|
+
expect(completedCalls.every((t) => t.status === 'success')).toBe(true);
|
|
602
572
|
});
|
|
603
|
-
it
|
|
573
|
+
it('should queue if scheduling while already running', async () => {
|
|
604
574
|
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
|
605
575
|
const longExecutePromise = new Promise((resolve) => setTimeout(() => resolve({
|
|
606
576
|
llmContent: 'done',
|
|
@@ -624,14 +594,16 @@ describe('useReactToolScheduler', () => {
|
|
|
624
594
|
schedule(request1, new AbortController().signal);
|
|
625
595
|
});
|
|
626
596
|
await act(async () => {
|
|
627
|
-
await vi.
|
|
597
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
598
|
+
});
|
|
599
|
+
act(() => {
|
|
600
|
+
schedule(request2, new AbortController().signal);
|
|
628
601
|
});
|
|
629
|
-
expect(() => schedule(request2, new AbortController().signal)).toThrow('Cannot schedule tool calls while other tool calls are running');
|
|
630
602
|
await act(async () => {
|
|
631
603
|
await vi.advanceTimersByTimeAsync(50);
|
|
632
|
-
await vi.
|
|
604
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
633
605
|
await act(async () => {
|
|
634
|
-
await vi.
|
|
606
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
635
607
|
});
|
|
636
608
|
});
|
|
637
609
|
expect(onComplete).toHaveBeenCalledWith([
|
|
@@ -641,7 +613,22 @@ describe('useReactToolScheduler', () => {
|
|
|
641
613
|
response: expect.objectContaining({ resultDisplay: 'done display' }),
|
|
642
614
|
}),
|
|
643
615
|
]);
|
|
644
|
-
|
|
616
|
+
await act(async () => {
|
|
617
|
+
await vi.advanceTimersByTimeAsync(50);
|
|
618
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
619
|
+
await act(async () => {
|
|
620
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
expect(onComplete).toHaveBeenCalledWith([
|
|
624
|
+
expect.objectContaining({
|
|
625
|
+
status: 'success',
|
|
626
|
+
request: request2,
|
|
627
|
+
response: expect.objectContaining({ resultDisplay: 'done display' }),
|
|
628
|
+
}),
|
|
629
|
+
]);
|
|
630
|
+
const toolCalls = result.current[0];
|
|
631
|
+
expect(toolCalls).toHaveLength(0);
|
|
645
632
|
});
|
|
646
633
|
});
|
|
647
634
|
describe('mapToDisplay', () => {
|