@zgsm/costrict-cli 0.0.1
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/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +93 -0
- package/dist/src/commands/extensions/disable.d.ts +13 -0
- package/dist/src/commands/extensions/disable.js +69 -0
- package/dist/src/commands/extensions/disable.js.map +1 -0
- package/dist/src/commands/extensions/disable.test.d.ts +6 -0
- package/dist/src/commands/extensions/disable.test.js +169 -0
- package/dist/src/commands/extensions/disable.test.js.map +1 -0
- package/dist/src/commands/extensions/enable.d.ts +13 -0
- package/dist/src/commands/extensions/enable.js +71 -0
- package/dist/src/commands/extensions/enable.js.map +1 -0
- package/dist/src/commands/extensions/enable.test.d.ts +6 -0
- package/dist/src/commands/extensions/enable.test.js +150 -0
- package/dist/src/commands/extensions/enable.test.js.map +1 -0
- package/dist/src/commands/extensions/examples/context/GEMINI.md +14 -0
- package/dist/src/commands/extensions/examples/context/gemini-extension.json +4 -0
- package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
- package/dist/src/commands/extensions/examples/custom-commands/gemini-extension.json +4 -0
- package/dist/src/commands/extensions/examples/exclude-tools/gemini-extension.json +5 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.d.ts +6 -0
- 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/examples/mcp-server/example.test.d.ts +6 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js +111 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js.map +1 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.ts +135 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
- package/dist/src/commands/extensions/examples/mcp-server/gemini-extension.json +11 -0
- package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
- package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
- package/dist/src/commands/extensions/install.d.ts +16 -0
- package/dist/src/commands/extensions/install.js +111 -0
- package/dist/src/commands/extensions/install.js.map +1 -0
- package/dist/src/commands/extensions/install.test.d.ts +6 -0
- package/dist/src/commands/extensions/install.test.js +122 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -0
- package/dist/src/commands/extensions/link.d.ts +13 -0
- package/dist/src/commands/extensions/link.js +64 -0
- package/dist/src/commands/extensions/link.js.map +1 -0
- package/dist/src/commands/extensions/link.test.d.ts +6 -0
- package/dist/src/commands/extensions/link.test.js +137 -0
- package/dist/src/commands/extensions/link.test.js.map +1 -0
- package/dist/src/commands/extensions/list.d.ts +8 -0
- package/dist/src/commands/extensions/list.js +45 -0
- package/dist/src/commands/extensions/list.js.map +1 -0
- package/dist/src/commands/extensions/list.test.d.ts +6 -0
- package/dist/src/commands/extensions/list.test.js +111 -0
- package/dist/src/commands/extensions/list.test.js.map +1 -0
- package/dist/src/commands/extensions/new.d.ts +7 -0
- package/dist/src/commands/extensions/new.js +86 -0
- package/dist/src/commands/extensions/new.js.map +1 -0
- package/dist/src/commands/extensions/new.test.d.ts +6 -0
- package/dist/src/commands/extensions/new.test.js +62 -0
- package/dist/src/commands/extensions/new.test.js.map +1 -0
- package/dist/src/commands/extensions/settings.d.ts +7 -0
- package/dist/src/commands/extensions/settings.js +111 -0
- package/dist/src/commands/extensions/settings.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.d.ts +12 -0
- package/dist/src/commands/extensions/uninstall.js +67 -0
- package/dist/src/commands/extensions/uninstall.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
- package/dist/src/commands/extensions/uninstall.test.js +199 -0
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
- package/dist/src/commands/extensions/update.d.ts +13 -0
- package/dist/src/commands/extensions/update.js +107 -0
- package/dist/src/commands/extensions/update.js.map +1 -0
- package/dist/src/commands/extensions/update.test.d.ts +6 -0
- package/dist/src/commands/extensions/update.test.js +170 -0
- package/dist/src/commands/extensions/update.test.js.map +1 -0
- package/dist/src/commands/extensions/utils.d.ts +13 -0
- package/dist/src/commands/extensions/utils.js +29 -0
- package/dist/src/commands/extensions/utils.js.map +1 -0
- package/dist/src/commands/extensions/validate.d.ts +12 -0
- package/dist/src/commands/extensions/validate.js +85 -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 +96 -0
- package/dist/src/commands/extensions/validate.test.js.map +1 -0
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +40 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/extensions.test.d.ts +6 -0
- package/dist/src/commands/extensions.test.js +67 -0
- package/dist/src/commands/extensions.test.js.map +1 -0
- package/dist/src/commands/hooks/migrate.d.ts +11 -0
- package/dist/src/commands/hooks/migrate.js +206 -0
- package/dist/src/commands/hooks/migrate.js.map +1 -0
- package/dist/src/commands/hooks/migrate.test.d.ts +6 -0
- package/dist/src/commands/hooks/migrate.test.js +389 -0
- package/dist/src/commands/hooks/migrate.test.js.map +1 -0
- package/dist/src/commands/hooks.d.ts +7 -0
- package/dist/src/commands/hooks.js +22 -0
- package/dist/src/commands/hooks.js.map +1 -0
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +178 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/add.test.d.ts +6 -0
- package/dist/src/commands/mcp/add.test.js +274 -0
- package/dist/src/commands/mcp/add.test.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +122 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/list.test.d.ts +6 -0
- package/dist/src/commands/mcp/list.test.js +126 -0
- package/dist/src/commands/mcp/list.test.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +47 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp/remove.test.d.ts +6 -0
- package/dist/src/commands/mcp/remove.test.js +189 -0
- package/dist/src/commands/mcp/remove.test.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +25 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/commands/mcp.test.d.ts +6 -0
- package/dist/src/commands/mcp.test.js +63 -0
- package/dist/src/commands/mcp.test.js.map +1 -0
- package/dist/src/commands/utils.d.ts +6 -0
- package/dist/src/commands/utils.js +11 -0
- package/dist/src/commands/utils.js.map +1 -0
- package/dist/src/commands/utils.test.d.ts +6 -0
- package/dist/src/commands/utils.test.js +35 -0
- package/dist/src/commands/utils.test.js.map +1 -0
- package/dist/src/config/auth.d.ts +6 -0
- package/dist/src/config/auth.js +53 -0
- package/dist/src/config/auth.js.map +1 -0
- package/dist/src/config/auth.test.d.ts +6 -0
- package/dist/src/config/auth.test.js +145 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/config.d.ts +36 -0
- package/dist/src/config/config.integration.test.d.ts +6 -0
- package/dist/src/config/config.integration.test.js +204 -0
- package/dist/src/config/config.integration.test.js.map +1 -0
- package/dist/src/config/config.js +518 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/config.test.d.ts +6 -0
- package/dist/src/config/config.test.js +1953 -0
- package/dist/src/config/config.test.js.map +1 -0
- package/dist/src/config/extension-manager.d.ts +64 -0
- package/dist/src/config/extension-manager.js +517 -0
- package/dist/src/config/extension-manager.js.map +1 -0
- package/dist/src/config/extension.d.ts +28 -0
- package/dist/src/config/extension.js +20 -0
- package/dist/src/config/extension.js.map +1 -0
- package/dist/src/config/extension.test.d.ts +6 -0
- package/dist/src/config/extension.test.js +1542 -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 +126 -0
- package/dist/src/config/extensions/consent.js.map +1 -0
- package/dist/src/config/extensions/consent.test.d.ts +6 -0
- package/dist/src/config/extensions/consent.test.js +162 -0
- package/dist/src/config/extensions/consent.test.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
- package/dist/src/config/extensions/extensionEnablement.js +190 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.test.d.ts +6 -0
- package/dist/src/config/extensions/extensionEnablement.test.js +404 -0
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
- package/dist/src/config/extensions/extensionSettings.d.ts +21 -0
- package/dist/src/config/extensions/extensionSettings.js +184 -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 +493 -0
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +50 -0
- package/dist/src/config/extensions/github.js +416 -0
- package/dist/src/config/extensions/github.js.map +1 -0
- package/dist/src/config/extensions/github.test.d.ts +6 -0
- package/dist/src/config/extensions/github.test.js +441 -0
- package/dist/src/config/extensions/github.test.js.map +1 -0
- package/dist/src/config/extensions/github_fetch.d.ts +7 -0
- package/dist/src/config/extensions/github_fetch.js +46 -0
- package/dist/src/config/extensions/github_fetch.js.map +1 -0
- 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/storage.test.d.ts +6 -0
- package/dist/src/config/extensions/storage.test.js +64 -0
- package/dist/src/config/extensions/storage.test.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +20 -0
- package/dist/src/config/extensions/update.js +120 -0
- package/dist/src/config/extensions/update.js.map +1 -0
- package/dist/src/config/extensions/update.test.d.ts +6 -0
- package/dist/src/config/extensions/update.test.js +231 -0
- package/dist/src/config/extensions/update.test.js.map +1 -0
- package/dist/src/config/extensions/variableSchema.d.ts +32 -0
- package/dist/src/config/extensions/variableSchema.js +22 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -0
- package/dist/src/config/extensions/variables.d.ts +21 -0
- package/dist/src/config/extensions/variables.js +46 -0
- package/dist/src/config/extensions/variables.js.map +1 -0
- package/dist/src/config/extensions/variables.test.d.ts +6 -0
- package/dist/src/config/extensions/variables.test.js +103 -0
- package/dist/src/config/extensions/variables.test.js.map +1 -0
- package/dist/src/config/keyBindings.d.ts +93 -0
- package/dist/src/config/keyBindings.js +305 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/keyBindings.test.d.ts +6 -0
- package/dist/src/config/keyBindings.test.js +93 -0
- package/dist/src/config/keyBindings.test.js.map +1 -0
- package/dist/src/config/policy-engine.integration.test.d.ts +6 -0
- package/dist/src/config/policy-engine.integration.test.js +291 -0
- package/dist/src/config/policy-engine.integration.test.js.map +1 -0
- package/dist/src/config/policy.d.ts +9 -0
- package/dist/src/config/policy.js +21 -0
- package/dist/src/config/policy.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +12 -0
- package/dist/src/config/sandboxConfig.js +74 -0
- package/dist/src/config/sandboxConfig.js.map +1 -0
- package/dist/src/config/sandboxConfig.test.d.ts +6 -0
- package/dist/src/config/sandboxConfig.test.js +178 -0
- package/dist/src/config/sandboxConfig.test.js.map +1 -0
- package/dist/src/config/settingPaths.d.ts +10 -0
- package/dist/src/config/settingPaths.js +11 -0
- package/dist/src/config/settingPaths.js.map +1 -0
- package/dist/src/config/settingPaths.test.d.ts +6 -0
- package/dist/src/config/settingPaths.test.js +22 -0
- package/dist/src/config/settingPaths.test.js.map +1 -0
- package/dist/src/config/settings-validation.d.ts +23 -0
- package/dist/src/config/settings-validation.js +249 -0
- package/dist/src/config/settings-validation.js.map +1 -0
- package/dist/src/config/settings-validation.test.d.ts +6 -0
- package/dist/src/config/settings-validation.test.js +322 -0
- package/dist/src/config/settings-validation.test.js.map +1 -0
- package/dist/src/config/settings.d.ts +85 -0
- package/dist/src/config/settings.js +618 -0
- package/dist/src/config/settings.js.map +1 -0
- package/dist/src/config/settings.test.d.ts +6 -0
- package/dist/src/config/settings.test.js +1955 -0
- package/dist/src/config/settings.test.js.map +1 -0
- package/dist/src/config/settingsSchema.d.ts +1511 -0
- package/dist/src/config/settingsSchema.js +1756 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/config/settingsSchema.test.d.ts +6 -0
- package/dist/src/config/settingsSchema.test.js +271 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/settings_repro.test.d.ts +6 -0
- package/dist/src/config/settings_repro.test.js +162 -0
- package/dist/src/config/settings_repro.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +55 -0
- package/dist/src/config/trustedFolders.js +176 -0
- package/dist/src/config/trustedFolders.js.map +1 -0
- package/dist/src/config/trustedFolders.test.d.ts +6 -0
- package/dist/src/config/trustedFolders.test.js +340 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- package/dist/src/core/auth.d.ts +13 -0
- package/dist/src/core/auth.js +27 -0
- package/dist/src/core/auth.js.map +1 -0
- package/dist/src/core/auth.test.d.ts +6 -0
- package/dist/src/core/auth.test.js +43 -0
- package/dist/src/core/auth.test.js.map +1 -0
- package/dist/src/core/initializer.d.ts +21 -0
- package/dist/src/core/initializer.js +36 -0
- package/dist/src/core/initializer.js.map +1 -0
- package/dist/src/core/initializer.test.d.ts +6 -0
- package/dist/src/core/initializer.test.js +101 -0
- package/dist/src/core/initializer.test.js.map +1 -0
- package/dist/src/core/theme.d.ts +12 -0
- package/dist/src/core/theme.js +20 -0
- package/dist/src/core/theme.js.map +1 -0
- package/dist/src/core/theme.test.d.ts +6 -0
- package/dist/src/core/theme.test.js +46 -0
- package/dist/src/core/theme.test.js.map +1 -0
- package/dist/src/gemini.d.ts +14 -0
- package/dist/src/gemini.js +494 -0
- package/dist/src/gemini.js.map +1 -0
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +1238 -0
- package/dist/src/gemini.test.js.map +1 -0
- package/dist/src/gemini_cleanup.test.d.ts +6 -0
- package/dist/src/gemini_cleanup.test.js +202 -0
- package/dist/src/gemini_cleanup.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/nonInteractiveCli.d.ts +17 -0
- package/dist/src/nonInteractiveCli.js +335 -0
- package/dist/src/nonInteractiveCli.js.map +1 -0
- package/dist/src/nonInteractiveCli.test.d.ts +6 -0
- package/dist/src/nonInteractiveCli.test.js +1333 -0
- package/dist/src/nonInteractiveCli.test.js.map +1 -0
- package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
- package/dist/src/nonInteractiveCliCommands.js +78 -0
- package/dist/src/nonInteractiveCliCommands.js.map +1 -0
- package/dist/src/patches/is-in-ci.d.ts +7 -0
- package/dist/src/patches/is-in-ci.js +15 -0
- package/dist/src/patches/is-in-ci.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
- package/dist/src/services/BuiltinCommandLoader.js +110 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
- package/dist/src/services/BuiltinCommandLoader.test.js +200 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +55 -0
- package/dist/src/services/CommandService.js +91 -0
- package/dist/src/services/CommandService.js.map +1 -0
- package/dist/src/services/CommandService.test.d.ts +6 -0
- package/dist/src/services/CommandService.test.js +234 -0
- package/dist/src/services/CommandService.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +51 -0
- package/dist/src/services/FileCommandLoader.js +230 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -0
- package/dist/src/services/FileCommandLoader.test.d.ts +6 -0
- package/dist/src/services/FileCommandLoader.test.js +1046 -0
- package/dist/src/services/FileCommandLoader.test.js.map +1 -0
- package/dist/src/services/McpPromptLoader.d.ts +35 -0
- package/dist/src/services/McpPromptLoader.js +256 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
- package/dist/src/services/McpPromptLoader.test.js +411 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +16 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js +21 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
- 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.d.ts +12 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +63 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
- package/dist/src/services/prompt-processors/injectionParser.js +60 -0
- package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +27 -0
- package/dist/src/services/prompt-processors/shellProcessor.js +128 -0
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
- 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/services/prompt-processors/types.d.ts +45 -0
- package/dist/src/services/prompt-processors/types.js +20 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -0
- package/dist/src/services/types.d.ts +22 -0
- package/dist/src/services/types.js +7 -0
- package/dist/src/services/types.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 +17 -0
- package/dist/src/test-utils/createExtension.js +25 -0
- package/dist/src/test-utils/createExtension.js.map +1 -0
- package/dist/src/test-utils/customMatchers.d.ts +14 -0
- package/dist/src/test-utils/customMatchers.js +40 -0
- package/dist/src/test-utils/customMatchers.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
- package/dist/src/test-utils/mockCommandContext.js +88 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
- package/dist/src/test-utils/mockCommandContext.test.js +51 -0
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +58 -0
- package/dist/src/test-utils/render.js +222 -0
- package/dist/src/test-utils/render.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/src/ui/App.js +29 -0
- package/dist/src/ui/App.js.map +1 -0
- package/dist/src/ui/App.test.d.ts +6 -0
- package/dist/src/ui/App.test.js +160 -0
- package/dist/src/ui/App.test.js.map +1 -0
- package/dist/src/ui/AppContainer.d.ts +16 -0
- package/dist/src/ui/AppContainer.js +1256 -0
- package/dist/src/ui/AppContainer.js.map +1 -0
- package/dist/src/ui/AppContainer.test.d.ts +6 -0
- package/dist/src/ui/AppContainer.test.js +1580 -0
- package/dist/src/ui/AppContainer.test.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +50 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.test.d.ts +6 -0
- package/dist/src/ui/IdeIntegrationNudge.test.js +147 -0
- package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -0
- package/dist/src/ui/auth/ApiAuthDialog.d.ts +14 -0
- package/dist/src/ui/auth/ApiAuthDialog.js +59 -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 +110 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.d.ts +18 -0
- package/dist/src/ui/auth/AuthDialog.js +149 -0
- package/dist/src/ui/auth/AuthDialog.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/AuthDialog.test.js +288 -0
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/auth/AuthInProgress.d.ts +11 -0
- package/dist/src/ui/auth/AuthInProgress.js +23 -0
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/auth/AuthInProgress.test.d.ts +6 -0
- package/dist/src/ui/auth/AuthInProgress.test.js +71 -0
- package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +17 -0
- package/dist/src/ui/auth/useAuth.js +114 -0
- package/dist/src/ui/auth/useAuth.js.map +1 -0
- package/dist/src/ui/auth/useAuth.test.d.ts +6 -0
- package/dist/src/ui/auth/useAuth.test.js +189 -0
- package/dist/src/ui/auth/useAuth.test.js.map +1 -0
- package/dist/src/ui/colors.d.ts +7 -0
- package/dist/src/ui/colors.js +57 -0
- package/dist/src/ui/colors.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
- package/dist/src/ui/commands/aboutCommand.js +56 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/aboutCommand.test.js +131 -0
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +7 -0
- package/dist/src/ui/commands/authCommand.js +17 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +76 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- 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/builtin/agentCommand.d.ts +10 -0
- package/dist/src/ui/commands/builtin/agentCommand.js +160 -0
- package/dist/src/ui/commands/builtin/agentCommand.js.map +1 -0
- package/dist/src/ui/commands/builtin/agentCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/builtin/agentCommand.test.js +172 -0
- package/dist/src/ui/commands/builtin/agentCommand.test.js.map +1 -0
- package/dist/src/ui/commands/builtin/planApplyCommand.d.ts +10 -0
- package/dist/src/ui/commands/builtin/planApplyCommand.js +104 -0
- package/dist/src/ui/commands/builtin/planApplyCommand.js.map +1 -0
- package/dist/src/ui/commands/builtin/planCommand.d.ts +10 -0
- package/dist/src/ui/commands/builtin/planCommand.js +308 -0
- package/dist/src/ui/commands/builtin/planCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +9 -0
- package/dist/src/ui/commands/chatCommand.js +326 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/chatCommand.test.js +594 -0
- package/dist/src/ui/commands/chatCommand.test.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.d.ts +7 -0
- package/dist/src/ui/commands/clearCommand.js +57 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/clearCommand.test.js +83 -0
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +67 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/copyCommand.js +61 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/corgiCommand.js +17 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/directoryCommand.js +189 -0
- package/dist/src/ui/commands/directoryCommand.js.map +1 -0
- package/dist/src/ui/commands/directoryCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/directoryCommand.test.js +235 -0
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +32 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +17 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- 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.d.ts +12 -0
- package/dist/src/ui/commands/extensionsCommand.js +403 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/extensionsCommand.test.js +588 -0
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +7 -0
- package/dist/src/ui/commands/helpCommand.js +22 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -0
- 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/hooksCommand.d.ts +7 -0
- package/dist/src/ui/commands/hooksCommand.js +207 -0
- package/dist/src/ui/commands/hooksCommand.js.map +1 -0
- package/dist/src/ui/commands/hooksCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/hooksCommand.test.js +396 -0
- package/dist/src/ui/commands/hooksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.d.ts +7 -0
- package/dist/src/ui/commands/ideCommand.js +233 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/ideCommand.test.js +203 -0
- package/dist/src/ui/commands/ideCommand.test.js.map +1 -0
- package/dist/src/ui/commands/initCommand.d.ts +7 -0
- package/dist/src/ui/commands/initCommand.js +37 -0
- package/dist/src/ui/commands/initCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +285 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/mcpCommand.test.js +181 -0
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/memoryCommand.js +108 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/memoryCommand.test.js +254 -0
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -0
- package/dist/src/ui/commands/modeCommand.d.ts +7 -0
- package/dist/src/ui/commands/modeCommand.js +45 -0
- package/dist/src/ui/commands/modeCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +17 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/modelCommand.test.js +30 -0
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/permissionsCommand.js +75 -0
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/permissionsCommand.test.js +86 -0
- package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/policiesCommand.d.ts +7 -0
- package/dist/src/ui/commands/policiesCommand.js +61 -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.d.ts +7 -0
- package/dist/src/ui/commands/privacyCommand.js +17 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -0
- 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/profileCommand.d.ts +7 -0
- package/dist/src/ui/commands/profileCommand.js +24 -0
- package/dist/src/ui/commands/profileCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +35 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- 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.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +130 -0
- package/dist/src/ui/commands/restoreCommand.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/resumeCommand.d.ts +7 -0
- package/dist/src/ui/commands/resumeCommand.js +17 -0
- package/dist/src/ui/commands/resumeCommand.js.map +1 -0
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +17 -0
- package/dist/src/ui/commands/settingsCommand.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.d.ts +10 -0
- package/dist/src/ui/commands/setupGithubCommand.js +195 -0
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js +238 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +79 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/statsCommand.test.js +56 -0
- package/dist/src/ui/commands/statsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
- package/dist/src/ui/commands/terminalSetupCommand.js +43 -0
- package/dist/src/ui/commands/terminalSetupCommand.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.d.ts +7 -0
- package/dist/src/ui/commands/themeCommand.js +17 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +43 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- 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 +135 -0
- package/dist/src/ui/commands/types.js +12 -0
- package/dist/src/ui/commands/types.js.map +1 -0
- package/dist/src/ui/commands/vimCommand.d.ts +7 -0
- package/dist/src/ui/commands/vimCommand.js +24 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -0
- package/dist/src/ui/components/AboutBox.d.ts +18 -0
- package/dist/src/ui/components/AboutBox.js +6 -0
- package/dist/src/ui/components/AboutBox.js.map +1 -0
- package/dist/src/ui/components/AboutBox.test.d.ts +6 -0
- package/dist/src/ui/components/AboutBox.test.js +53 -0
- package/dist/src/ui/components/AboutBox.test.js.map +1 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js +24 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +161 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.d.ts +14 -0
- package/dist/src/ui/components/AnsiOutput.js +12 -0
- package/dist/src/ui/components/AnsiOutput.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
- package/dist/src/ui/components/AnsiOutput.test.js +92 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
- package/dist/src/ui/components/AppHeader.d.ts +10 -0
- package/dist/src/ui/components/AppHeader.js +22 -0
- package/dist/src/ui/components/AppHeader.js.map +1 -0
- package/dist/src/ui/components/AppHeader.test.d.ts +6 -0
- package/dist/src/ui/components/AppHeader.test.js +144 -0
- package/dist/src/ui/components/AppHeader.test.js.map +1 -0
- package/dist/src/ui/components/AsciiArt.d.ts +11 -0
- package/dist/src/ui/components/AsciiArt.js +53 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js +26 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/AutoAcceptIndicator.test.js +31 -0
- package/dist/src/ui/components/AutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/components/Banner.d.ts +14 -0
- package/dist/src/ui/components/Banner.js +28 -0
- package/dist/src/ui/components/Banner.js.map +1 -0
- package/dist/src/ui/components/Banner.test.d.ts +6 -0
- package/dist/src/ui/components/Banner.test.js +24 -0
- package/dist/src/ui/components/Banner.test.js.map +1 -0
- package/dist/src/ui/components/CliSpinner.d.ts +9 -0
- package/dist/src/ui/components/CliSpinner.js +19 -0
- package/dist/src/ui/components/CliSpinner.js.map +1 -0
- package/dist/src/ui/components/CliSpinner.test.d.ts +6 -0
- package/dist/src/ui/components/CliSpinner.test.js +23 -0
- package/dist/src/ui/components/CliSpinner.test.js.map +1 -0
- package/dist/src/ui/components/Composer.d.ts +6 -0
- package/dist/src/ui/components/Composer.js +60 -0
- package/dist/src/ui/components/Composer.js.map +1 -0
- package/dist/src/ui/components/Composer.test.d.ts +6 -0
- package/dist/src/ui/components/Composer.test.js +355 -0
- package/dist/src/ui/components/Composer.test.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.js +49 -0
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.test.js +133 -0
- package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
- package/dist/src/ui/components/ConsentPrompt.js +19 -0
- package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ConsentPrompt.test.js +77 -0
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +26 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +19 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js +56 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
- 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/ContextUsageDisplay.d.ts +10 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +16 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/ContextUsageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ContextUsageDisplay.test.js +39 -0
- package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/CopyModeWarning.d.ts +7 -0
- package/dist/src/ui/components/CopyModeWarning.js +12 -0
- package/dist/src/ui/components/CopyModeWarning.js.map +1 -0
- package/dist/src/ui/components/CopyModeWarning.test.d.ts +6 -0
- package/dist/src/ui/components/CopyModeWarning.test.js +33 -0
- package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.d.ts +25 -0
- package/dist/src/ui/components/DebugProfiler.js +162 -0
- package/dist/src/ui/components/DebugProfiler.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.test.d.ts +6 -0
- package/dist/src/ui/components/DebugProfiler.test.js +201 -0
- package/dist/src/ui/components/DebugProfiler.test.js.map +1 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +15 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js +54 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js +39 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -0
- package/dist/src/ui/components/DialogManager.d.ts +12 -0
- package/dist/src/ui/components/DialogManager.js +103 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/DialogManager.test.d.ts +6 -0
- package/dist/src/ui/components/DialogManager.test.js +167 -0
- package/dist/src/ui/components/DialogManager.test.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +15 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +80 -0
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.js +118 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ExitWarning.d.ts +7 -0
- package/dist/src/ui/components/ExitWarning.js +9 -0
- package/dist/src/ui/components/ExitWarning.js.map +1 -0
- package/dist/src/ui/components/ExitWarning.test.d.ts +6 -0
- package/dist/src/ui/components/ExitWarning.test.js +54 -0
- package/dist/src/ui/components/ExitWarning.test.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
- package/dist/src/ui/components/FolderTrustDialog.js +66 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js +90 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +7 -0
- package/dist/src/ui/components/Footer.js +49 -0
- package/dist/src/ui/components/Footer.js.map +1 -0
- 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/GeminiRespondingSpinner.d.ts +22 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +23 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +6 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +61 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -0
- package/dist/src/ui/components/GradientRegression.test.d.ts +6 -0
- package/dist/src/ui/components/GradientRegression.test.js +105 -0
- package/dist/src/ui/components/GradientRegression.test.js.map +1 -0
- package/dist/src/ui/components/Header.d.ts +13 -0
- package/dist/src/ui/components/Header.js +29 -0
- package/dist/src/ui/components/Header.js.map +1 -0
- package/dist/src/ui/components/Header.test.d.ts +6 -0
- package/dist/src/ui/components/Header.test.js +145 -0
- package/dist/src/ui/components/Header.test.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +12 -0
- package/dist/src/ui/components/Help.js +13 -0
- package/dist/src/ui/components/Help.js.map +1 -0
- package/dist/src/ui/components/Help.test.d.ts +6 -0
- package/dist/src/ui/components/Help.test.js +67 -0
- package/dist/src/ui/components/Help.test.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +21 -0
- package/dist/src/ui/components/HistoryItemDisplay.js +31 -0
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js +185 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js +33 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +50 -0
- package/dist/src/ui/components/InputPrompt.js +833 -0
- package/dist/src/ui/components/InputPrompt.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/InputPrompt.test.js +2124 -0
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
- package/dist/src/ui/components/LoadingIndicator.js +30 -0
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/LoadingIndicator.test.js +207 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +25 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.d.ts +6 -0
- package/dist/src/ui/components/MainContent.js +76 -0
- package/dist/src/ui/components/MainContent.js.map +1 -0
- package/dist/src/ui/components/MainContent.test.d.ts +6 -0
- package/dist/src/ui/components/MainContent.test.js +73 -0
- package/dist/src/ui/components/MainContent.test.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +24 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/MemoryUsageDisplay.test.js +49 -0
- package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.d.ts +11 -0
- package/dist/src/ui/components/ModelDialog.js +86 -0
- package/dist/src/ui/components/ModelDialog.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelDialog.test.js +224 -0
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +7 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +33 -0
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js +292 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.d.ts +23 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.js +91 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js +161 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Notifications.d.ts +6 -0
- package/dist/src/ui/components/Notifications.js +68 -0
- package/dist/src/ui/components/Notifications.js.map +1 -0
- package/dist/src/ui/components/Notifications.test.d.ts +6 -0
- package/dist/src/ui/components/Notifications.test.js +153 -0
- package/dist/src/ui/components/Notifications.test.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +16 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +58 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +162 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
- package/dist/src/ui/components/PrepareLabel.js +72 -0
- package/dist/src/ui/components/PrepareLabel.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
- package/dist/src/ui/components/PrepareLabel.test.js +77 -0
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.d.ts +18 -0
- package/dist/src/ui/components/ProQuotaDialog.js +88 -0
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js +172 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +65 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.js +20 -0
- package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/QuittingDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.test.js +49 -0
- package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -0
- 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/RawMarkdownIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/RawMarkdownIndicator.test.js +34 -0
- package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser.d.ts +98 -0
- package/dist/src/ui/components/SessionBrowser.js +459 -0
- package/dist/src/ui/components/SessionBrowser.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser.test.d.ts +6 -0
- package/dist/src/ui/components/SessionBrowser.test.js +250 -0
- package/dist/src/ui/components/SessionBrowser.test.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +11 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +4 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +75 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.d.ts +18 -0
- package/dist/src/ui/components/SettingsDialog.js +704 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsDialog.test.js +1133 -0
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +15 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +49 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +40 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
- package/dist/src/ui/components/ShellInputPrompt.js +36 -0
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
- package/dist/src/ui/components/ShellInputPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ShellInputPrompt.test.js +82 -0
- package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
- package/dist/src/ui/components/ShellModeIndicator.js +5 -0
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/ShellModeIndicator.test.js +17 -0
- package/dist/src/ui/components/ShellModeIndicator.test.js.map +1 -0
- package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
- package/dist/src/ui/components/ShowMoreLines.js +24 -0
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
- package/dist/src/ui/components/ShowMoreLines.test.d.ts +6 -0
- package/dist/src/ui/components/ShowMoreLines.test.js +40 -0
- package/dist/src/ui/components/ShowMoreLines.test.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.d.ts +14 -0
- package/dist/src/ui/components/StatsDisplay.js +119 -0
- package/dist/src/ui/components/StatsDisplay.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/StatsDisplay.test.js +438 -0
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/StickyHeader.d.ts +14 -0
- package/dist/src/ui/components/StickyHeader.js +5 -0
- package/dist/src/ui/components/StickyHeader.js.map +1 -0
- package/dist/src/ui/components/StickyHeader.test.d.ts +6 -0
- package/dist/src/ui/components/StickyHeader.test.js +17 -0
- package/dist/src/ui/components/StickyHeader.test.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +27 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +40 -0
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.js +56 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.d.ts +21 -0
- package/dist/src/ui/components/ThemeDialog.js +135 -0
- package/dist/src/ui/components/ThemeDialog.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ThemeDialog.test.js +102 -0
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
- package/dist/src/ui/components/ThemedGradient.d.ts +8 -0
- package/dist/src/ui/components/ThemedGradient.js +16 -0
- package/dist/src/ui/components/ThemedGradient.js.map +1 -0
- package/dist/src/ui/components/ThemedGradient.test.d.ts +6 -0
- package/dist/src/ui/components/ThemedGradient.test.js +30 -0
- package/dist/src/ui/components/ThemedGradient.test.js.map +1 -0
- package/dist/src/ui/components/Tips.d.ts +12 -0
- package/dist/src/ui/components/Tips.js +9 -0
- package/dist/src/ui/components/Tips.js.map +1 -0
- package/dist/src/ui/components/Tips.test.d.ts +6 -0
- package/dist/src/ui/components/Tips.test.js +23 -0
- package/dist/src/ui/components/Tips.test.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +7 -0
- package/dist/src/ui/components/ToolStatsDisplay.js +41 -0
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
- 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/UpdateNotification.d.ts +10 -0
- package/dist/src/ui/components/UpdateNotification.js +10 -0
- package/dist/src/ui/components/UpdateNotification.js.map +1 -0
- package/dist/src/ui/components/UpdateNotification.test.d.ts +6 -0
- package/dist/src/ui/components/UpdateNotification.test.js +16 -0
- package/dist/src/ui/components/UpdateNotification.test.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +10 -0
- package/dist/src/ui/components/messages/CompressionMessage.js +46 -0
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +168 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +17 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +258 -0
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js +231 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ErrorMessage.test.js +23 -0
- package/dist/src/ui/components/messages/ErrorMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
- package/dist/src/ui/components/messages/GeminiMessage.js +15 -0
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
- 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.d.ts +14 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js +19 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.d.ts +13 -0
- package/dist/src/ui/components/messages/InfoMessage.js +11 -0
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/InfoMessage.test.js +28 -0
- package/dist/src/ui/components/messages/InfoMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ModelMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/ModelMessage.js +5 -0
- package/dist/src/ui/components/messages/ModelMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ShellToolMessage.d.ts +14 -0
- package/dist/src/ui/components/messages/ShellToolMessage.js +76 -0
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.js +123 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -0
- 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.d.ts +15 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +240 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +113 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +19 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js +80 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +300 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +24 -0
- package/dist/src/ui/components/messages/ToolMessage.js +36 -0
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js +153 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +62 -0
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.d.ts +13 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.js +54 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js +96 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolShared.d.ts +23 -0
- package/dist/src/ui/components/messages/ToolShared.js +40 -0
- package/dist/src/ui/components/messages/ToolShared.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.d.ts +12 -0
- package/dist/src/ui/components/messages/UserMessage.js +13 -0
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/UserMessage.test.js +32 -0
- package/dist/src/ui/components/messages/UserMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/UserShellMessage.js +9 -0
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
- package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/WarningMessage.js +10 -0
- package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
- package/dist/src/ui/components/messages/WarningMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/WarningMessage.test.js +23 -0
- package/dist/src/ui/components/messages/WarningMessage.test.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +385 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
- package/dist/src/ui/components/shared/EnumSelector.js +44 -0
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +451 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +175 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +45 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js +21 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +134 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
- package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
- package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
- package/dist/src/ui/components/shared/Scrollable.d.ts +18 -0
- package/dist/src/ui/components/shared/Scrollable.js +84 -0
- package/dist/src/ui/components/shared/Scrollable.js.map +1 -0
- package/dist/src/ui/components/shared/Scrollable.test.d.ts +6 -0
- package/dist/src/ui/components/shared/Scrollable.test.js +74 -0
- package/dist/src/ui/components/shared/Scrollable.test.js.map +1 -0
- package/dist/src/ui/components/shared/ScrollableList.d.ts +26 -0
- package/dist/src/ui/components/shared/ScrollableList.js +152 -0
- package/dist/src/ui/components/shared/ScrollableList.js.map +1 -0
- package/dist/src/ui/components/shared/ScrollableList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/ScrollableList.test.js +228 -0
- package/dist/src/ui/components/shared/ScrollableList.test.js.map +1 -0
- 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/VirtualizedList.d.ts +44 -0
- package/dist/src/ui/components/shared/VirtualizedList.js +312 -0
- package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -0
- package/dist/src/ui/components/shared/VirtualizedList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/VirtualizedList.test.js +171 -0
- package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +492 -0
- package/dist/src/ui/components/shared/text-buffer.js +1665 -0
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.test.d.ts +6 -0
- package/dist/src/ui/components/shared/text-buffer.test.js +1916 -0
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +552 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.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.d.ts +12 -0
- package/dist/src/ui/components/views/ChatList.js +17 -0
- package/dist/src/ui/components/views/ChatList.js.map +1 -0
- package/dist/src/ui/components/views/ChatList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ChatList.test.js +45 -0
- package/dist/src/ui/components/views/ChatList.test.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.d.ts +12 -0
- package/dist/src/ui/components/views/ExtensionsList.js +44 -0
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +111 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
- package/dist/src/ui/components/views/HooksList.d.ts +22 -0
- package/dist/src/ui/components/views/HooksList.js +23 -0
- package/dist/src/ui/components/views/HooksList.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
- package/dist/src/ui/components/views/McpStatus.js +87 -0
- package/dist/src/ui/components/views/McpStatus.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
- package/dist/src/ui/components/views/McpStatus.test.js +136 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
- package/dist/src/ui/components/views/ToolsList.js +7 -0
- package/dist/src/ui/components/views/ToolsList.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ToolsList.test.js +45 -0
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
- package/dist/src/ui/constants/tips.d.ts +6 -0
- package/dist/src/ui/constants/tips.js +167 -0
- package/dist/src/ui/constants/tips.js.map +1 -0
- package/dist/src/ui/constants/wittyPhrases.d.ts +6 -0
- package/dist/src/ui/constants/wittyPhrases.js +137 -0
- package/dist/src/ui/constants/wittyPhrases.js.map +1 -0
- package/dist/src/ui/constants.d.ts +20 -0
- package/dist/src/ui/constants.js +29 -0
- package/dist/src/ui/constants.js.map +1 -0
- package/dist/src/ui/contexts/AppContext.d.ts +11 -0
- package/dist/src/ui/contexts/AppContext.js +15 -0
- package/dist/src/ui/contexts/AppContext.js.map +1 -0
- package/dist/src/ui/contexts/AppModeContext.d.ts +17 -0
- package/dist/src/ui/contexts/AppModeContext.js +35 -0
- package/dist/src/ui/contexts/AppModeContext.js.map +1 -0
- package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
- package/dist/src/ui/contexts/ConfigContext.js +16 -0
- package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +31 -0
- package/dist/src/ui/contexts/KeypressContext.js +529 -0
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js +711 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
- package/dist/src/ui/contexts/MouseContext.d.ts +21 -0
- package/dist/src/ui/contexts/MouseContext.js +104 -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 +198 -0
- package/dist/src/ui/contexts/MouseContext.test.js.map +1 -0
- package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
- package/dist/src/ui/contexts/OverflowContext.js +38 -0
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
- package/dist/src/ui/contexts/ScrollProvider.d.ts +25 -0
- package/dist/src/ui/contexts/ScrollProvider.drag.test.d.ts +6 -0
- package/dist/src/ui/contexts/ScrollProvider.drag.test.js +319 -0
- package/dist/src/ui/contexts/ScrollProvider.drag.test.js.map +1 -0
- package/dist/src/ui/contexts/ScrollProvider.js +242 -0
- package/dist/src/ui/contexts/ScrollProvider.js.map +1 -0
- package/dist/src/ui/contexts/ScrollProvider.test.d.ts +6 -0
- package/dist/src/ui/contexts/ScrollProvider.test.js +377 -0
- package/dist/src/ui/contexts/ScrollProvider.test.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.d.ts +46 -0
- package/dist/src/ui/contexts/SessionContext.js +158 -0
- package/dist/src/ui/contexts/SessionContext.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/SessionContext.test.js +198 -0
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -0
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
- package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
- package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
- package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
- package/dist/src/ui/contexts/StreamingContext.js +15 -0
- package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +50 -0
- package/dist/src/ui/contexts/UIActionsContext.js +21 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/UIStateContext.d.ts +121 -0
- package/dist/src/ui/contexts/UIStateContext.js +17 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
- package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
- package/dist/src/ui/contexts/VimModeContext.js +48 -0
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
- package/dist/src/ui/debug.d.ts +8 -0
- package/dist/src/ui/debug.js +11 -0
- package/dist/src/ui/debug.js.map +1 -0
- package/dist/src/ui/editors/editorSettingsManager.d.ts +18 -0
- package/dist/src/ui/editors/editorSettingsManager.js +37 -0
- package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
- package/dist/src/ui/hooks/README.md +81 -0
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +32 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +499 -0
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +1026 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
- package/dist/src/ui/hooks/keyToAnsi.js +67 -0
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +19 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +285 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +521 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +49 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +455 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +846 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/useAlternateBuffer.d.ts +8 -0
- package/dist/src/ui/hooks/useAlternateBuffer.js +12 -0
- package/dist/src/ui/hooks/useAlternateBuffer.js.map +1 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.d.ts +10 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.js +91 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +85 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/useAtCompletion.js +229 -0
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js +417 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +13 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +60 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +410 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useBanner.d.ts +14 -0
- package/dist/src/ui/hooks/useBanner.js +48 -0
- package/dist/src/ui/hooks/useBanner.js.map +1 -0
- package/dist/src/ui/hooks/useBanner.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBanner.test.js +92 -0
- package/dist/src/ui/hooks/useBanner.test.js.map +1 -0
- package/dist/src/ui/hooks/useBatchedScroll.d.ts +14 -0
- package/dist/src/ui/hooks/useBatchedScroll.js +27 -0
- package/dist/src/ui/hooks/useBatchedScroll.js.map +1 -0
- package/dist/src/ui/hooks/useBatchedScroll.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBatchedScroll.test.js +62 -0
- package/dist/src/ui/hooks/useBatchedScroll.test.js.map +1 -0
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
- package/dist/src/ui/hooks/useBracketedPaste.js +31 -0
- package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +41 -0
- package/dist/src/ui/hooks/useCommandCompletion.js +232 -0
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.js +376 -0
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useCompletion.d.ts +24 -0
- package/dist/src/ui/hooks/useCompletion.js +88 -0
- package/dist/src/ui/hooks/useCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +11 -0
- package/dist/src/ui/hooks/useConsoleMessages.js +101 -0
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +6 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js +159 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
- package/dist/src/ui/hooks/useEditorSettings.js +44 -0
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +179 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +31 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +175 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +263 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useFlickerDetector.d.ts +14 -0
- package/dist/src/ui/hooks/useFlickerDetector.js +37 -0
- package/dist/src/ui/hooks/useFlickerDetector.js.map +1 -0
- package/dist/src/ui/hooks/useFlickerDetector.test.d.ts +6 -0
- package/dist/src/ui/hooks/useFlickerDetector.test.js +106 -0
- package/dist/src/ui/hooks/useFlickerDetector.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +10 -0
- package/dist/src/ui/hooks/useFocus.js +51 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- 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.d.ts +14 -0
- package/dist/src/ui/hooks/useFolderTrust.js +81 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js +210 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +36 -0
- package/dist/src/ui/hooks/useGeminiStream.js +824 -0
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js +1827 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.js +65 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js +183 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +25 -0
- package/dist/src/ui/hooks/useHistoryManager.js +108 -0
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js +172 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js +67 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +214 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
- package/dist/src/ui/hooks/useInactivityTimer.d.ts +14 -0
- package/dist/src/ui/hooks/useInactivityTimer.js +30 -0
- package/dist/src/ui/hooks/useInactivityTimer.js.map +1 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.d.ts +8 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.js +121 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +151 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistory.js +84 -0
- package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +208 -0
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js +82 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +238 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +17 -0
- package/dist/src/ui/hooks/useKeypress.js +27 -0
- package/dist/src/ui/hooks/useKeypress.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.test.d.ts +6 -0
- package/dist/src/ui/hooks/useKeypress.test.js +200 -0
- package/dist/src/ui/hooks/useKeypress.test.js.map +1 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +14 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +19 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +10 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js +44 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +127 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useLogger.d.ts +11 -0
- package/dist/src/ui/hooks/useLogger.js +29 -0
- package/dist/src/ui/hooks/useLogger.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +62 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.d.ts +24 -0
- package/dist/src/ui/hooks/useMessageQueue.js +61 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js +293 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
- package/dist/src/ui/hooks/useModelCommand.js +21 -0
- package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useModelCommand.test.js +45 -0
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
- 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/useMouseClick.d.ts +12 -0
- package/dist/src/ui/hooks/useMouseClick.js +28 -0
- package/dist/src/ui/hooks/useMouseClick.js.map +1 -0
- package/dist/src/ui/hooks/useMouseClick.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMouseClick.test.js +59 -0
- package/dist/src/ui/hooks/useMouseClick.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +115 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +284 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +16 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +91 -0
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.js +237 -0
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -0
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +16 -0
- package/dist/src/ui/hooks/usePrivacySettings.js +103 -0
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js +104 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -0
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/usePromptCompletion.js +171 -0
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +19 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js +112 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +332 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +42 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js +213 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.js +58 -0
- package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +103 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +169 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
- package/dist/src/ui/hooks/useSelectionList.js +273 -0
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSelectionList.test.js +819 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
- package/dist/src/ui/hooks/useSessionBrowser.d.ts +35 -0
- package/dist/src/ui/hooks/useSessionBrowser.js +224 -0
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -0
- package/dist/src/ui/hooks/useSessionBrowser.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSessionBrowser.test.js +209 -0
- package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -0
- package/dist/src/ui/hooks/useSessionResume.d.ts +30 -0
- package/dist/src/ui/hooks/useSessionResume.js +57 -0
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -0
- package/dist/src/ui/hooks/useSessionResume.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSessionResume.test.js +325 -0
- package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +14 -0
- package/dist/src/ui/hooks/useShellHistory.js +113 -0
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +223 -0
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js +59 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +382 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +735 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
- package/dist/src/ui/hooks/useStateAndRef.js +26 -0
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
- package/dist/src/ui/hooks/useTerminalSize.js +26 -0
- package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +16 -0
- package/dist/src/ui/hooks/useThemeCommand.js +74 -0
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.d.ts +12 -0
- package/dist/src/ui/hooks/useTimer.js +58 -0
- package/dist/src/ui/hooks/useTimer.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTimer.test.js +119 -0
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +857 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/vim.d.ts +28 -0
- package/dist/src/ui/hooks/vim.js +641 -0
- package/dist/src/ui/hooks/vim.js.map +1 -0
- package/dist/src/ui/hooks/vim.test.d.ts +6 -0
- package/dist/src/ui/hooks/vim.test.js +1270 -0
- package/dist/src/ui/hooks/vim.test.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +27 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/keyMatchers.test.js +364 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- package/dist/src/ui/layouts/DefaultAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js +24 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js +17 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +29 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +12 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +42 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +121 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +10 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +18 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +34 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +10 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +18 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +34 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +12 -0
- package/dist/src/ui/privacy/PrivacyNotice.js +25 -0
- package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/PrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/PrivacyNotice.test.js +62 -0
- package/dist/src/ui/privacy/PrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/state/extensions.d.ts +67 -0
- package/dist/src/ui/state/extensions.js +97 -0
- package/dist/src/ui/state/extensions.js.map +1 -0
- package/dist/src/ui/state/extensions.test.d.ts +6 -0
- package/dist/src/ui/state/extensions.test.js +219 -0
- package/dist/src/ui/state/extensions.test.js.map +1 -0
- package/dist/src/ui/textConstants.d.ts +9 -0
- package/dist/src/ui/textConstants.js +10 -0
- package/dist/src/ui/textConstants.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.d.ts +7 -0
- package/dist/src/ui/themes/ansi-light.js +143 -0
- package/dist/src/ui/themes/ansi-light.js.map +1 -0
- package/dist/src/ui/themes/ansi.d.ts +7 -0
- package/dist/src/ui/themes/ansi.js +153 -0
- package/dist/src/ui/themes/ansi.js.map +1 -0
- package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
- package/dist/src/ui/themes/atom-one-dark.js +140 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
- package/dist/src/ui/themes/ayu-light.d.ts +7 -0
- package/dist/src/ui/themes/ayu-light.js +132 -0
- package/dist/src/ui/themes/ayu-light.js.map +1 -0
- package/dist/src/ui/themes/ayu.d.ts +7 -0
- package/dist/src/ui/themes/ayu.js +106 -0
- package/dist/src/ui/themes/ayu.js.map +1 -0
- package/dist/src/ui/themes/color-utils.d.ts +22 -0
- package/dist/src/ui/themes/color-utils.js +237 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -0
- package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
- package/dist/src/ui/themes/color-utils.test.js +226 -0
- package/dist/src/ui/themes/color-utils.test.js.map +1 -0
- package/dist/src/ui/themes/default-light.d.ts +7 -0
- package/dist/src/ui/themes/default-light.js +100 -0
- package/dist/src/ui/themes/default-light.js.map +1 -0
- package/dist/src/ui/themes/default.d.ts +7 -0
- package/dist/src/ui/themes/default.js +143 -0
- package/dist/src/ui/themes/default.js.map +1 -0
- package/dist/src/ui/themes/dracula.d.ts +7 -0
- package/dist/src/ui/themes/dracula.js +117 -0
- package/dist/src/ui/themes/dracula.js.map +1 -0
- package/dist/src/ui/themes/github-dark.d.ts +7 -0
- package/dist/src/ui/themes/github-dark.js +140 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -0
- package/dist/src/ui/themes/github-light.d.ts +7 -0
- package/dist/src/ui/themes/github-light.js +142 -0
- package/dist/src/ui/themes/github-light.js.map +1 -0
- package/dist/src/ui/themes/googlecode.d.ts +7 -0
- package/dist/src/ui/themes/googlecode.js +139 -0
- package/dist/src/ui/themes/googlecode.js.map +1 -0
- package/dist/src/ui/themes/holiday.d.ts +7 -0
- package/dist/src/ui/themes/holiday.js +162 -0
- package/dist/src/ui/themes/holiday.js.map +1 -0
- package/dist/src/ui/themes/no-color.d.ts +7 -0
- package/dist/src/ui/themes/no-color.js +118 -0
- package/dist/src/ui/themes/no-color.js.map +1 -0
- package/dist/src/ui/themes/semantic-tokens.d.ts +39 -0
- package/dist/src/ui/themes/semantic-tokens.js +100 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
- package/dist/src/ui/themes/shades-of-purple.js +306 -0
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +66 -0
- package/dist/src/ui/themes/theme-manager.js +265 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.test.js +143 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +133 -0
- package/dist/src/ui/themes/theme.js +390 -0
- package/dist/src/ui/themes/theme.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/src/ui/themes/xcode.js +147 -0
- package/dist/src/ui/themes/xcode.js.map +1 -0
- package/dist/src/ui/types.d.ts +313 -0
- package/dist/src/ui/types.js +66 -0
- package/dist/src/ui/types.js.map +1 -0
- package/dist/src/ui/utils/CodeColorizer.d.ts +25 -0
- package/dist/src/ui/utils/CodeColorizer.js +123 -0
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
- package/dist/src/ui/utils/CodeColorizer.test.d.ts +6 -0
- package/dist/src/ui/utils/CodeColorizer.test.js +38 -0
- package/dist/src/ui/utils/CodeColorizer.test.js.map +1 -0
- package/dist/src/ui/utils/ConsolePatcher.d.ts +25 -0
- package/dist/src/ui/utils/ConsolePatcher.js +49 -0
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +17 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +112 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +21 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +15 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +242 -0
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js +159 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.d.ts +17 -0
- package/dist/src/ui/utils/TableRenderer.js +84 -0
- package/dist/src/ui/utils/TableRenderer.js.map +1 -0
- package/dist/src/ui/utils/bracketedPaste.d.ts +7 -0
- package/dist/src/ui/utils/bracketedPaste.js +15 -0
- package/dist/src/ui/utils/bracketedPaste.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.d.ts +47 -0
- package/dist/src/ui/utils/clipboardUtils.js +212 -0
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.test.js +187 -0
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +36 -0
- package/dist/src/ui/utils/commandUtils.js +189 -0
- package/dist/src/ui/utils/commandUtils.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/commandUtils.test.js +309 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +10 -0
- package/dist/src/ui/utils/computeStats.js +62 -0
- package/dist/src/ui/utils/computeStats.js.map +1 -0
- package/dist/src/ui/utils/computeStats.test.d.ts +6 -0
- package/dist/src/ui/utils/computeStats.test.js +271 -0
- package/dist/src/ui/utils/computeStats.test.js.map +1 -0
- package/dist/src/ui/utils/directoryUtils.d.ts +6 -0
- package/dist/src/ui/utils/directoryUtils.js +21 -0
- package/dist/src/ui/utils/directoryUtils.js.map +1 -0
- package/dist/src/ui/utils/directoryUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/directoryUtils.test.js +52 -0
- package/dist/src/ui/utils/directoryUtils.test.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.d.ts +18 -0
- package/dist/src/ui/utils/displayUtils.js +27 -0
- package/dist/src/ui/utils/displayUtils.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +61 -0
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
- package/dist/src/ui/utils/formatters.d.ts +13 -0
- package/dist/src/ui/utils/formatters.js +56 -0
- package/dist/src/ui/utils/formatters.js.map +1 -0
- package/dist/src/ui/utils/formatters.test.d.ts +6 -0
- package/dist/src/ui/utils/formatters.test.js +56 -0
- package/dist/src/ui/utils/formatters.test.js.map +1 -0
- package/dist/src/ui/utils/highlight.d.ts +11 -0
- package/dist/src/ui/utils/highlight.js +82 -0
- package/dist/src/ui/utils/highlight.js.map +1 -0
- package/dist/src/ui/utils/highlight.test.d.ts +6 -0
- package/dist/src/ui/utils/highlight.test.js +120 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -0
- package/dist/src/ui/utils/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/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +17 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +111 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.test.d.ts +6 -0
- package/dist/src/ui/utils/kittyProtocolDetector.test.js +113 -0
- package/dist/src/ui/utils/kittyProtocolDetector.test.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.js +110 -0
- package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
- package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
- package/dist/src/ui/utils/mouse.d.ts +32 -0
- package/dist/src/ui/utils/mouse.js +181 -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 +136 -0
- package/dist/src/ui/utils/mouse.test.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +34 -0
- package/dist/src/ui/utils/terminalSetup.js +290 -0
- package/dist/src/ui/utils/terminalSetup.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.test.d.ts +6 -0
- package/dist/src/ui/utils/terminalSetup.test.js +136 -0
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -0
- package/dist/src/ui/utils/textOutput.d.ts +27 -0
- package/dist/src/ui/utils/textOutput.js +53 -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/textUtils.d.ts +43 -0
- package/dist/src/ui/utils/textUtils.js +186 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -0
- package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/textUtils.test.js +138 -0
- package/dist/src/ui/utils/textUtils.test.js.map +1 -0
- package/dist/src/ui/utils/ui-sizing.d.ts +7 -0
- package/dist/src/ui/utils/ui-sizing.js +30 -0
- package/dist/src/ui/utils/ui-sizing.js.map +1 -0
- package/dist/src/ui/utils/ui-sizing.test.d.ts +6 -0
- package/dist/src/ui/utils/ui-sizing.test.js +56 -0
- package/dist/src/ui/utils/ui-sizing.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +19 -0
- package/dist/src/ui/utils/updateCheck.js +86 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.test.js +134 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
- package/dist/src/utils/checks.d.ts +19 -0
- package/dist/src/utils/checks.js +24 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/checks.test.d.ts +6 -0
- package/dist/src/utils/checks.test.js +29 -0
- package/dist/src/utils/checks.test.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +16 -0
- package/dist/src/utils/cleanup.js +69 -0
- package/dist/src/utils/cleanup.js.map +1 -0
- package/dist/src/utils/cleanup.test.d.ts +6 -0
- package/dist/src/utils/cleanup.test.js +102 -0
- package/dist/src/utils/cleanup.test.js.map +1 -0
- package/dist/src/utils/commands.d.ts +20 -0
- package/dist/src/utils/commands.js +53 -0
- package/dist/src/utils/commands.js.map +1 -0
- package/dist/src/utils/commands.test.d.ts +6 -0
- package/dist/src/utils/commands.test.js +115 -0
- package/dist/src/utils/commands.test.js.map +1 -0
- package/dist/src/utils/commentJson.d.ts +9 -0
- package/dist/src/utils/commentJson.js +130 -0
- package/dist/src/utils/commentJson.js.map +1 -0
- package/dist/src/utils/commentJson.test.d.ts +6 -0
- package/dist/src/utils/commentJson.test.js +308 -0
- package/dist/src/utils/commentJson.test.js.map +1 -0
- package/dist/src/utils/deepMerge.d.ts +9 -0
- package/dist/src/utils/deepMerge.js +63 -0
- package/dist/src/utils/deepMerge.js.map +1 -0
- package/dist/src/utils/deepMerge.test.d.ts +6 -0
- package/dist/src/utils/deepMerge.test.js +201 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -0
- package/dist/src/utils/dialogScopeUtils.d.ts +25 -0
- package/dist/src/utils/dialogScopeUtils.js +50 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/dialogScopeUtils.test.d.ts +6 -0
- package/dist/src/utils/dialogScopeUtils.test.js +81 -0
- package/dist/src/utils/dialogScopeUtils.test.js.map +1 -0
- package/dist/src/utils/envVarResolver.d.ts +39 -0
- package/dist/src/utils/envVarResolver.js +100 -0
- package/dist/src/utils/envVarResolver.js.map +1 -0
- package/dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/dist/src/utils/envVarResolver.test.js +221 -0
- package/dist/src/utils/envVarResolver.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +33 -0
- package/dist/src/utils/errors.js +186 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +377 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/events.d.ts +24 -0
- package/dist/src/utils/events.js +17 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/events.test.d.ts +6 -0
- package/dist/src/utils/events.test.js +24 -0
- package/dist/src/utils/events.test.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +30 -0
- package/dist/src/utils/gitUtils.js +90 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/gitUtils.test.d.ts +6 -0
- package/dist/src/utils/gitUtils.test.js +113 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.d.ts +11 -0
- package/dist/src/utils/handleAutoUpdate.js +113 -0
- package/dist/src/utils/handleAutoUpdate.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.test.d.ts +6 -0
- package/dist/src/utils/handleAutoUpdate.test.js +303 -0
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -0
- package/dist/src/utils/installationInfo.d.ts +24 -0
- package/dist/src/utils/installationInfo.js +156 -0
- package/dist/src/utils/installationInfo.js.map +1 -0
- package/dist/src/utils/installationInfo.test.d.ts +6 -0
- package/dist/src/utils/installationInfo.test.js +245 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -0
- package/dist/src/utils/math.d.ts +13 -0
- package/dist/src/utils/math.js +14 -0
- package/dist/src/utils/math.js.map +1 -0
- package/dist/src/utils/math.test.d.ts +6 -0
- package/dist/src/utils/math.test.js +23 -0
- package/dist/src/utils/math.test.js.map +1 -0
- package/dist/src/utils/persistentState.d.ts +19 -0
- package/dist/src/utils/persistentState.js +65 -0
- package/dist/src/utils/persistentState.js.map +1 -0
- package/dist/src/utils/persistentState.test.d.ts +6 -0
- package/dist/src/utils/persistentState.test.js +68 -0
- package/dist/src/utils/persistentState.test.js.map +1 -0
- package/dist/src/utils/processUtils.d.ts +13 -0
- package/dist/src/utils/processUtils.js +18 -0
- package/dist/src/utils/processUtils.js.map +1 -0
- package/dist/src/utils/processUtils.test.d.ts +6 -0
- package/dist/src/utils/processUtils.test.js +20 -0
- package/dist/src/utils/processUtils.test.js.map +1 -0
- package/dist/src/utils/readStdin.d.ts +6 -0
- package/dist/src/utils/readStdin.js +61 -0
- package/dist/src/utils/readStdin.js.map +1 -0
- package/dist/src/utils/readStdin.test.d.ts +6 -0
- package/dist/src/utils/readStdin.test.js +113 -0
- package/dist/src/utils/readStdin.test.js.map +1 -0
- package/dist/src/utils/relaunch.d.ts +7 -0
- package/dist/src/utils/relaunch.js +57 -0
- package/dist/src/utils/relaunch.js.map +1 -0
- package/dist/src/utils/relaunch.test.d.ts +6 -0
- package/dist/src/utils/relaunch.test.js +273 -0
- package/dist/src/utils/relaunch.test.js.map +1 -0
- package/dist/src/utils/resolvePath.d.ts +6 -0
- package/dist/src/utils/resolvePath.js +21 -0
- package/dist/src/utils/resolvePath.js.map +1 -0
- package/dist/src/utils/resolvePath.test.d.ts +6 -0
- package/dist/src/utils/resolvePath.test.js +31 -0
- package/dist/src/utils/resolvePath.test.js.map +1 -0
- package/dist/src/utils/sandbox-macos-permissive-closed.sb +32 -0
- package/dist/src/utils/sandbox-macos-permissive-open.sb +27 -0
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +37 -0
- package/dist/src/utils/sandbox-macos-restrictive-closed.sb +93 -0
- package/dist/src/utils/sandbox-macos-restrictive-open.sb +96 -0
- package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +98 -0
- package/dist/src/utils/sandbox.d.ts +7 -0
- package/dist/src/utils/sandbox.js +616 -0
- package/dist/src/utils/sandbox.js.map +1 -0
- package/dist/src/utils/sandbox.test.d.ts +6 -0
- package/dist/src/utils/sandbox.test.js +302 -0
- package/dist/src/utils/sandbox.test.js.map +1 -0
- package/dist/src/utils/sandboxUtils.d.ts +14 -0
- package/dist/src/utils/sandboxUtils.js +121 -0
- package/dist/src/utils/sandboxUtils.js.map +1 -0
- package/dist/src/utils/sandboxUtils.test.d.ts +6 -0
- package/dist/src/utils/sandboxUtils.test.js +122 -0
- package/dist/src/utils/sandboxUtils.test.js.map +1 -0
- package/dist/src/utils/sessionCleanup.d.ts +22 -0
- package/dist/src/utils/sessionCleanup.integration.test.d.ts +6 -0
- package/dist/src/utils/sessionCleanup.integration.test.js +182 -0
- package/dist/src/utils/sessionCleanup.integration.test.js.map +1 -0
- package/dist/src/utils/sessionCleanup.js +214 -0
- package/dist/src/utils/sessionCleanup.js.map +1 -0
- package/dist/src/utils/sessionCleanup.test.d.ts +6 -0
- package/dist/src/utils/sessionCleanup.test.js +1348 -0
- package/dist/src/utils/sessionCleanup.test.js.map +1 -0
- package/dist/src/utils/sessionUtils.d.ts +150 -0
- package/dist/src/utils/sessionUtils.js +306 -0
- package/dist/src/utils/sessionUtils.js.map +1 -0
- package/dist/src/utils/sessionUtils.test.d.ts +6 -0
- package/dist/src/utils/sessionUtils.test.js +503 -0
- package/dist/src/utils/sessionUtils.test.js.map +1 -0
- package/dist/src/utils/sessions.d.ts +8 -0
- package/dist/src/utils/sessions.js +69 -0
- package/dist/src/utils/sessions.js.map +1 -0
- package/dist/src/utils/sessions.test.d.ts +6 -0
- package/dist/src/utils/sessions.test.js +584 -0
- package/dist/src/utils/sessions.test.js.map +1 -0
- package/dist/src/utils/settingsUtils.d.ts +144 -0
- package/dist/src/utils/settingsUtils.js +340 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/src/utils/settingsUtils.test.d.ts +6 -0
- package/dist/src/utils/settingsUtils.test.js +808 -0
- package/dist/src/utils/settingsUtils.test.js.map +1 -0
- package/dist/src/utils/spawnWrapper.d.ts +7 -0
- package/dist/src/utils/spawnWrapper.js +8 -0
- package/dist/src/utils/spawnWrapper.js.map +1 -0
- package/dist/src/utils/startupWarnings.d.ts +6 -0
- package/dist/src/utils/startupWarnings.js +40 -0
- package/dist/src/utils/startupWarnings.js.map +1 -0
- 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/updateEventEmitter.d.ts +11 -0
- package/dist/src/utils/updateEventEmitter.js +12 -0
- package/dist/src/utils/updateEventEmitter.js.map +1 -0
- package/dist/src/utils/updateEventEmitter.test.d.ts +6 -0
- package/dist/src/utils/updateEventEmitter.test.js +18 -0
- package/dist/src/utils/updateEventEmitter.test.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.js +54 -0
- package/dist/src/utils/userStartupWarnings.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.test.js +67 -0
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
- package/dist/src/utils/windowTitle.d.ts +12 -0
- package/dist/src/utils/windowTitle.js +19 -0
- package/dist/src/utils/windowTitle.js.map +1 -0
- package/dist/src/utils/windowTitle.test.d.ts +6 -0
- package/dist/src/utils/windowTitle.test.js +49 -0
- package/dist/src/utils/windowTitle.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +9 -0
- package/dist/src/validateNonInterActiveAuth.js +59 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.test.d.ts +6 -0
- package/dist/src/validateNonInterActiveAuth.test.js +337 -0
- package/dist/src/validateNonInterActiveAuth.test.js.map +1 -0
- package/dist/src/zed-integration/acp.d.ts +41 -0
- package/dist/src/zed-integration/acp.js +72 -0
- package/dist/src/zed-integration/acp.js.map +1 -0
- package/dist/src/zed-integration/acp.test.d.ts +6 -0
- package/dist/src/zed-integration/acp.test.js +214 -0
- package/dist/src/zed-integration/acp.test.js.map +1 -0
- package/dist/src/zed-integration/connection.d.ts +28 -0
- package/dist/src/zed-integration/connection.js +165 -0
- package/dist/src/zed-integration/connection.js.map +1 -0
- package/dist/src/zed-integration/connection.test.d.ts +6 -0
- package/dist/src/zed-integration/connection.test.js +175 -0
- package/dist/src/zed-integration/connection.test.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.d.ts +19 -0
- package/dist/src/zed-integration/fileSystemService.js +43 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.test.d.ts +6 -0
- package/dist/src/zed-integration/fileSystemService.test.js +90 -0
- package/dist/src/zed-integration/fileSystemService.test.js.map +1 -0
- package/dist/src/zed-integration/schema.d.ts +11792 -0
- package/dist/src/zed-integration/schema.js +311 -0
- package/dist/src/zed-integration/schema.js.map +1 -0
- package/dist/src/zed-integration/zedIntegration.d.ts +39 -0
- package/dist/src/zed-integration/zedIntegration.js +728 -0
- package/dist/src/zed-integration/zedIntegration.js.map +1 -0
- package/dist/src/zed-integration/zedIntegration.test.d.ts +6 -0
- package/dist/src/zed-integration/zedIntegration.test.js +614 -0
- package/dist/src/zed-integration/zedIntegration.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,1827 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
7
|
+
import { act } from 'react';
|
|
8
|
+
import { renderHook } from '../../test-utils/render.js';
|
|
9
|
+
import { waitFor } from '../../test-utils/async.js';
|
|
10
|
+
import { useGeminiStream } from './useGeminiStream.js';
|
|
11
|
+
import { useKeypress } from './useKeypress.js';
|
|
12
|
+
import * as atCommandProcessor from './atCommandProcessor.js';
|
|
13
|
+
import { useReactToolScheduler } from './useReactToolScheduler.js';
|
|
14
|
+
import { ApprovalMode, AuthType, GeminiEventType as ServerGeminiEventType, ToolErrorType, ToolConfirmationOutcome, tokenLimit, debugLogger, } from '@google/gemini-cli-core';
|
|
15
|
+
import { MessageType, StreamingState } from '../types.js';
|
|
16
|
+
// --- MOCKS ---
|
|
17
|
+
const mockSendMessageStream = vi
|
|
18
|
+
.fn()
|
|
19
|
+
.mockReturnValue((async function* () { })());
|
|
20
|
+
const mockStartChat = vi.fn();
|
|
21
|
+
const MockedGeminiClientClass = vi.hoisted(() => vi.fn().mockImplementation(function (_config) {
|
|
22
|
+
// _config
|
|
23
|
+
this.startChat = mockStartChat;
|
|
24
|
+
this.sendMessageStream = mockSendMessageStream;
|
|
25
|
+
this.addHistory = vi.fn();
|
|
26
|
+
this.getChat = vi.fn().mockReturnValue({
|
|
27
|
+
recordCompletedToolCalls: vi.fn(),
|
|
28
|
+
});
|
|
29
|
+
this.getChatRecordingService = vi.fn().mockReturnValue({
|
|
30
|
+
recordThought: vi.fn(),
|
|
31
|
+
initialize: vi.fn(),
|
|
32
|
+
recordMessage: vi.fn(),
|
|
33
|
+
recordMessageTokens: vi.fn(),
|
|
34
|
+
recordToolCalls: vi.fn(),
|
|
35
|
+
getConversationFile: vi.fn(),
|
|
36
|
+
});
|
|
37
|
+
}));
|
|
38
|
+
const MockedUserPromptEvent = vi.hoisted(() => vi.fn().mockImplementation(() => { }));
|
|
39
|
+
const mockParseAndFormatApiError = vi.hoisted(() => vi.fn());
|
|
40
|
+
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
41
|
+
const actualCoreModule = (await importOriginal());
|
|
42
|
+
return {
|
|
43
|
+
...actualCoreModule,
|
|
44
|
+
GitService: vi.fn(),
|
|
45
|
+
GeminiClient: MockedGeminiClientClass,
|
|
46
|
+
UserPromptEvent: MockedUserPromptEvent,
|
|
47
|
+
parseAndFormatApiError: mockParseAndFormatApiError,
|
|
48
|
+
tokenLimit: vi.fn().mockReturnValue(100), // Mock tokenLimit
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const mockUseReactToolScheduler = useReactToolScheduler;
|
|
52
|
+
vi.mock('./useReactToolScheduler.js', async (importOriginal) => {
|
|
53
|
+
const actualSchedulerModule = (await importOriginal());
|
|
54
|
+
return {
|
|
55
|
+
...(actualSchedulerModule || {}),
|
|
56
|
+
useReactToolScheduler: vi.fn(),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
vi.mock('./useKeypress.js', () => ({
|
|
60
|
+
useKeypress: vi.fn(),
|
|
61
|
+
}));
|
|
62
|
+
vi.mock('./shellCommandProcessor.js', () => ({
|
|
63
|
+
useShellCommandProcessor: vi.fn().mockReturnValue({
|
|
64
|
+
handleShellCommand: vi.fn(),
|
|
65
|
+
}),
|
|
66
|
+
}));
|
|
67
|
+
vi.mock('./atCommandProcessor.js');
|
|
68
|
+
vi.mock('../utils/markdownUtilities.js', () => ({
|
|
69
|
+
findLastSafeSplitPoint: vi.fn((s) => s.length),
|
|
70
|
+
}));
|
|
71
|
+
vi.mock('./useStateAndRef.js', () => ({
|
|
72
|
+
useStateAndRef: vi.fn((initial) => {
|
|
73
|
+
let val = initial;
|
|
74
|
+
const ref = { current: val };
|
|
75
|
+
const setVal = vi.fn((updater) => {
|
|
76
|
+
if (typeof updater === 'function') {
|
|
77
|
+
val = updater(val);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
val = updater;
|
|
81
|
+
}
|
|
82
|
+
ref.current = val;
|
|
83
|
+
});
|
|
84
|
+
return [val, ref, setVal];
|
|
85
|
+
}),
|
|
86
|
+
}));
|
|
87
|
+
vi.mock('./useLogger.js', () => ({
|
|
88
|
+
useLogger: vi.fn().mockReturnValue({
|
|
89
|
+
logMessage: vi.fn().mockResolvedValue(undefined),
|
|
90
|
+
}),
|
|
91
|
+
}));
|
|
92
|
+
const mockStartNewPrompt = vi.fn();
|
|
93
|
+
const mockAddUsage = vi.fn();
|
|
94
|
+
vi.mock('../contexts/SessionContext.js', () => ({
|
|
95
|
+
useSessionStats: vi.fn(() => ({
|
|
96
|
+
startNewPrompt: mockStartNewPrompt,
|
|
97
|
+
addUsage: mockAddUsage,
|
|
98
|
+
getPromptCount: vi.fn(() => 5),
|
|
99
|
+
})),
|
|
100
|
+
}));
|
|
101
|
+
vi.mock('./slashCommandProcessor.js', () => ({
|
|
102
|
+
handleSlashCommand: vi.fn().mockReturnValue(false),
|
|
103
|
+
}));
|
|
104
|
+
vi.mock('./useAlternateBuffer.js', () => ({
|
|
105
|
+
useAlternateBuffer: vi.fn(() => false),
|
|
106
|
+
}));
|
|
107
|
+
// --- END MOCKS ---
|
|
108
|
+
// --- Tests for useGeminiStream Hook ---
|
|
109
|
+
describe('useGeminiStream', () => {
|
|
110
|
+
let mockAddItem;
|
|
111
|
+
let mockConfig;
|
|
112
|
+
let mockOnDebugMessage;
|
|
113
|
+
let mockHandleSlashCommand;
|
|
114
|
+
let mockScheduleToolCalls;
|
|
115
|
+
let mockCancelAllToolCalls;
|
|
116
|
+
let mockMarkToolsAsSubmitted;
|
|
117
|
+
let handleAtCommandSpy;
|
|
118
|
+
beforeEach(() => {
|
|
119
|
+
vi.clearAllMocks(); // Clear mocks before each test
|
|
120
|
+
mockAddItem = vi.fn();
|
|
121
|
+
// Define the mock for getGeminiClient
|
|
122
|
+
const mockGetGeminiClient = vi.fn().mockImplementation(() => {
|
|
123
|
+
// MockedGeminiClientClass is defined in the module scope by the previous change.
|
|
124
|
+
// It will use the mockStartChat and mockSendMessageStream that are managed within beforeEach.
|
|
125
|
+
const clientInstance = new MockedGeminiClientClass(mockConfig);
|
|
126
|
+
return clientInstance;
|
|
127
|
+
});
|
|
128
|
+
const contentGeneratorConfig = {
|
|
129
|
+
model: 'test-model',
|
|
130
|
+
apiKey: 'test-key',
|
|
131
|
+
vertexai: false,
|
|
132
|
+
authType: AuthType.USE_GEMINI,
|
|
133
|
+
};
|
|
134
|
+
mockConfig = {
|
|
135
|
+
apiKey: 'test-api-key',
|
|
136
|
+
model: 'gemini-pro',
|
|
137
|
+
sandbox: false,
|
|
138
|
+
targetDir: '/test/dir',
|
|
139
|
+
debugMode: false,
|
|
140
|
+
question: undefined,
|
|
141
|
+
coreTools: [],
|
|
142
|
+
toolDiscoveryCommand: undefined,
|
|
143
|
+
toolCallCommand: undefined,
|
|
144
|
+
mcpServerCommand: undefined,
|
|
145
|
+
mcpServers: undefined,
|
|
146
|
+
userAgent: 'test-agent',
|
|
147
|
+
userMemory: '',
|
|
148
|
+
geminiMdFileCount: 0,
|
|
149
|
+
alwaysSkipModificationConfirmation: false,
|
|
150
|
+
vertexai: false,
|
|
151
|
+
showMemoryUsage: false,
|
|
152
|
+
contextFileName: undefined,
|
|
153
|
+
getToolRegistry: vi.fn(() => ({ getToolSchemaList: vi.fn(() => []) })),
|
|
154
|
+
getProjectRoot: vi.fn(() => '/test/dir'),
|
|
155
|
+
getCheckpointingEnabled: vi.fn(() => false),
|
|
156
|
+
getGeminiClient: mockGetGeminiClient,
|
|
157
|
+
getApprovalMode: () => ApprovalMode.DEFAULT,
|
|
158
|
+
getUsageStatisticsEnabled: () => true,
|
|
159
|
+
getDebugMode: () => false,
|
|
160
|
+
addHistory: vi.fn(),
|
|
161
|
+
getSessionId() {
|
|
162
|
+
return 'test-session-id';
|
|
163
|
+
},
|
|
164
|
+
setQuotaErrorOccurred: vi.fn(),
|
|
165
|
+
getQuotaErrorOccurred: vi.fn(() => false),
|
|
166
|
+
getModel: vi.fn(() => 'gemini-2.5-pro'),
|
|
167
|
+
getContentGeneratorConfig: vi
|
|
168
|
+
.fn()
|
|
169
|
+
.mockReturnValue(contentGeneratorConfig),
|
|
170
|
+
getUseSmartEdit: () => false,
|
|
171
|
+
isInteractive: () => false,
|
|
172
|
+
getExperiments: () => { },
|
|
173
|
+
};
|
|
174
|
+
mockOnDebugMessage = vi.fn();
|
|
175
|
+
mockHandleSlashCommand = vi.fn().mockResolvedValue(false);
|
|
176
|
+
// Mock return value for useReactToolScheduler
|
|
177
|
+
mockScheduleToolCalls = vi.fn();
|
|
178
|
+
mockCancelAllToolCalls = vi.fn();
|
|
179
|
+
mockMarkToolsAsSubmitted = vi.fn();
|
|
180
|
+
// Default mock for useReactToolScheduler to prevent toolCalls being undefined initially
|
|
181
|
+
mockUseReactToolScheduler.mockReturnValue([
|
|
182
|
+
[], // Default to empty array for toolCalls
|
|
183
|
+
mockScheduleToolCalls,
|
|
184
|
+
mockMarkToolsAsSubmitted,
|
|
185
|
+
vi.fn(), // setToolCallsForDisplay
|
|
186
|
+
mockCancelAllToolCalls,
|
|
187
|
+
]);
|
|
188
|
+
// Reset mocks for GeminiClient instance methods (startChat and sendMessageStream)
|
|
189
|
+
// The GeminiClient constructor itself is mocked at the module level.
|
|
190
|
+
mockStartChat.mockClear().mockResolvedValue({
|
|
191
|
+
sendMessageStream: mockSendMessageStream,
|
|
192
|
+
}); // GeminiChat -> any
|
|
193
|
+
mockSendMessageStream
|
|
194
|
+
.mockClear()
|
|
195
|
+
.mockReturnValue((async function* () { })());
|
|
196
|
+
handleAtCommandSpy = vi.spyOn(atCommandProcessor, 'handleAtCommand');
|
|
197
|
+
});
|
|
198
|
+
const mockLoadedSettings = {
|
|
199
|
+
merged: { preferredEditor: 'vscode' },
|
|
200
|
+
user: { path: '/user/settings.json', settings: {} },
|
|
201
|
+
workspace: { path: '/workspace/.gemini/settings.json', settings: {} },
|
|
202
|
+
errors: [],
|
|
203
|
+
forScope: vi.fn(),
|
|
204
|
+
setValue: vi.fn(),
|
|
205
|
+
};
|
|
206
|
+
const renderTestHook = (initialToolCalls = [], geminiClient) => {
|
|
207
|
+
const client = geminiClient || mockConfig.getGeminiClient();
|
|
208
|
+
const initialProps = {
|
|
209
|
+
client,
|
|
210
|
+
history: [],
|
|
211
|
+
addItem: mockAddItem,
|
|
212
|
+
config: mockConfig,
|
|
213
|
+
onDebugMessage: mockOnDebugMessage,
|
|
214
|
+
handleSlashCommand: mockHandleSlashCommand,
|
|
215
|
+
shellModeActive: false,
|
|
216
|
+
loadedSettings: mockLoadedSettings,
|
|
217
|
+
toolCalls: initialToolCalls,
|
|
218
|
+
};
|
|
219
|
+
const { result, rerender } = renderHook((props) => {
|
|
220
|
+
// This mock needs to be stateful. When setToolCallsForDisplay is called,
|
|
221
|
+
// it should trigger a rerender with the new state.
|
|
222
|
+
const mockSetToolCallsForDisplay = vi.fn((updater) => {
|
|
223
|
+
const newToolCalls = typeof updater === 'function' ? updater(props.toolCalls) : updater;
|
|
224
|
+
rerender({ ...props, toolCalls: newToolCalls });
|
|
225
|
+
});
|
|
226
|
+
// Create a stateful mock for cancellation that updates the toolCalls state.
|
|
227
|
+
const statefulCancelAllToolCalls = vi.fn((...args) => {
|
|
228
|
+
// Call the original spy so `toHaveBeenCalled` checks still work.
|
|
229
|
+
mockCancelAllToolCalls(...args);
|
|
230
|
+
const newToolCalls = props.toolCalls.map((tc) => {
|
|
231
|
+
// Only cancel tools that are in a cancellable state.
|
|
232
|
+
if (tc.status === 'awaiting_approval' ||
|
|
233
|
+
tc.status === 'executing' ||
|
|
234
|
+
tc.status === 'scheduled' ||
|
|
235
|
+
tc.status === 'validating') {
|
|
236
|
+
// A real cancelled tool call has a response object.
|
|
237
|
+
// We need to simulate this to avoid type errors downstream.
|
|
238
|
+
return {
|
|
239
|
+
...tc,
|
|
240
|
+
status: 'cancelled',
|
|
241
|
+
response: {
|
|
242
|
+
callId: tc.request.callId,
|
|
243
|
+
responseParts: [],
|
|
244
|
+
resultDisplay: 'Request cancelled.',
|
|
245
|
+
},
|
|
246
|
+
responseSubmittedToGemini: true, // Mark as "processed"
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
return tc;
|
|
250
|
+
});
|
|
251
|
+
rerender({ ...props, toolCalls: newToolCalls });
|
|
252
|
+
});
|
|
253
|
+
mockUseReactToolScheduler.mockImplementation(() => [
|
|
254
|
+
props.toolCalls,
|
|
255
|
+
mockScheduleToolCalls,
|
|
256
|
+
mockMarkToolsAsSubmitted,
|
|
257
|
+
mockSetToolCallsForDisplay,
|
|
258
|
+
statefulCancelAllToolCalls, // Use the stateful mock
|
|
259
|
+
]);
|
|
260
|
+
return useGeminiStream(props.client, props.history, props.addItem, props.config, props.loadedSettings, props.onDebugMessage, props.handleSlashCommand, props.shellModeActive, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24);
|
|
261
|
+
}, {
|
|
262
|
+
initialProps,
|
|
263
|
+
});
|
|
264
|
+
return {
|
|
265
|
+
result,
|
|
266
|
+
rerender,
|
|
267
|
+
mockMarkToolsAsSubmitted,
|
|
268
|
+
mockSendMessageStream,
|
|
269
|
+
client,
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
// Helper to create mock tool calls - reduces boilerplate
|
|
273
|
+
const createMockToolCall = (toolName, callId, confirmationType, mockOnConfirm, status = 'awaiting_approval') => ({
|
|
274
|
+
request: {
|
|
275
|
+
callId,
|
|
276
|
+
name: toolName,
|
|
277
|
+
args: {},
|
|
278
|
+
isClientInitiated: false,
|
|
279
|
+
prompt_id: 'prompt-id-1',
|
|
280
|
+
},
|
|
281
|
+
status: status,
|
|
282
|
+
responseSubmittedToGemini: false,
|
|
283
|
+
confirmationDetails: confirmationType === 'edit'
|
|
284
|
+
? {
|
|
285
|
+
type: 'edit',
|
|
286
|
+
title: 'Confirm Edit',
|
|
287
|
+
onConfirm: mockOnConfirm,
|
|
288
|
+
fileName: 'file.txt',
|
|
289
|
+
filePath: '/test/file.txt',
|
|
290
|
+
fileDiff: 'fake diff',
|
|
291
|
+
originalContent: 'old',
|
|
292
|
+
newContent: 'new',
|
|
293
|
+
}
|
|
294
|
+
: {
|
|
295
|
+
type: 'info',
|
|
296
|
+
title: `${toolName} confirmation`,
|
|
297
|
+
onConfirm: mockOnConfirm,
|
|
298
|
+
prompt: `Execute ${toolName}?`,
|
|
299
|
+
},
|
|
300
|
+
tool: {
|
|
301
|
+
name: toolName,
|
|
302
|
+
displayName: toolName,
|
|
303
|
+
description: `${toolName} description`,
|
|
304
|
+
build: vi.fn(),
|
|
305
|
+
},
|
|
306
|
+
invocation: {
|
|
307
|
+
getDescription: () => 'Mock description',
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
// Helper to render hook with default parameters - reduces boilerplate
|
|
311
|
+
const renderHookWithDefaults = (options = {}) => {
|
|
312
|
+
const { shellModeActive = false, onCancelSubmit = () => { }, setShellInputFocused = () => { }, performMemoryRefresh = () => Promise.resolve(), onAuthError = () => { }, setModelSwitched = vi.fn(), modelSwitched = false, } = options;
|
|
313
|
+
return renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, shellModeActive, () => 'vscode', onAuthError, performMemoryRefresh, modelSwitched, setModelSwitched, onCancelSubmit, setShellInputFocused, 80, 24));
|
|
314
|
+
};
|
|
315
|
+
it('should not submit tool responses if not all tool calls are completed', () => {
|
|
316
|
+
const toolCalls = [
|
|
317
|
+
{
|
|
318
|
+
request: {
|
|
319
|
+
callId: 'call1',
|
|
320
|
+
name: 'tool1',
|
|
321
|
+
args: {},
|
|
322
|
+
isClientInitiated: false,
|
|
323
|
+
prompt_id: 'prompt-id-1',
|
|
324
|
+
},
|
|
325
|
+
status: 'success',
|
|
326
|
+
responseSubmittedToGemini: false,
|
|
327
|
+
response: {
|
|
328
|
+
callId: 'call1',
|
|
329
|
+
responseParts: [{ text: 'tool 1 response' }],
|
|
330
|
+
error: undefined,
|
|
331
|
+
errorType: undefined, // FIX: Added missing property
|
|
332
|
+
resultDisplay: 'Tool 1 success display',
|
|
333
|
+
},
|
|
334
|
+
tool: {
|
|
335
|
+
name: 'tool1',
|
|
336
|
+
displayName: 'tool1',
|
|
337
|
+
description: 'desc1',
|
|
338
|
+
build: vi.fn(),
|
|
339
|
+
},
|
|
340
|
+
invocation: {
|
|
341
|
+
getDescription: () => `Mock description`,
|
|
342
|
+
},
|
|
343
|
+
startTime: Date.now(),
|
|
344
|
+
endTime: Date.now(),
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
request: {
|
|
348
|
+
callId: 'call2',
|
|
349
|
+
name: 'tool2',
|
|
350
|
+
args: {},
|
|
351
|
+
prompt_id: 'prompt-id-1',
|
|
352
|
+
},
|
|
353
|
+
status: 'executing',
|
|
354
|
+
responseSubmittedToGemini: false,
|
|
355
|
+
tool: {
|
|
356
|
+
name: 'tool2',
|
|
357
|
+
displayName: 'tool2',
|
|
358
|
+
description: 'desc2',
|
|
359
|
+
build: vi.fn(),
|
|
360
|
+
},
|
|
361
|
+
invocation: {
|
|
362
|
+
getDescription: () => `Mock description`,
|
|
363
|
+
},
|
|
364
|
+
startTime: Date.now(),
|
|
365
|
+
liveOutput: '...',
|
|
366
|
+
},
|
|
367
|
+
];
|
|
368
|
+
const { mockMarkToolsAsSubmitted, mockSendMessageStream } = renderTestHook(toolCalls);
|
|
369
|
+
// Effect for submitting tool responses depends on toolCalls and isResponding
|
|
370
|
+
// isResponding is initially false, so the effect should run.
|
|
371
|
+
expect(mockMarkToolsAsSubmitted).not.toHaveBeenCalled();
|
|
372
|
+
expect(mockSendMessageStream).not.toHaveBeenCalled(); // submitQuery uses this
|
|
373
|
+
});
|
|
374
|
+
it('should submit tool responses when all tool calls are completed and ready', async () => {
|
|
375
|
+
const toolCall1ResponseParts = [{ text: 'tool 1 final response' }];
|
|
376
|
+
const toolCall2ResponseParts = [{ text: 'tool 2 final response' }];
|
|
377
|
+
const completedToolCalls = [
|
|
378
|
+
{
|
|
379
|
+
request: {
|
|
380
|
+
callId: 'call1',
|
|
381
|
+
name: 'tool1',
|
|
382
|
+
args: {},
|
|
383
|
+
isClientInitiated: false,
|
|
384
|
+
prompt_id: 'prompt-id-2',
|
|
385
|
+
},
|
|
386
|
+
status: 'success',
|
|
387
|
+
responseSubmittedToGemini: false,
|
|
388
|
+
response: {
|
|
389
|
+
callId: 'call1',
|
|
390
|
+
responseParts: toolCall1ResponseParts,
|
|
391
|
+
errorType: undefined, // FIX: Added missing property
|
|
392
|
+
},
|
|
393
|
+
tool: {
|
|
394
|
+
displayName: 'MockTool',
|
|
395
|
+
},
|
|
396
|
+
invocation: {
|
|
397
|
+
getDescription: () => `Mock description`,
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
request: {
|
|
402
|
+
callId: 'call2',
|
|
403
|
+
name: 'tool2',
|
|
404
|
+
args: {},
|
|
405
|
+
isClientInitiated: false,
|
|
406
|
+
prompt_id: 'prompt-id-2',
|
|
407
|
+
},
|
|
408
|
+
status: 'error',
|
|
409
|
+
responseSubmittedToGemini: false,
|
|
410
|
+
response: {
|
|
411
|
+
callId: 'call2',
|
|
412
|
+
responseParts: toolCall2ResponseParts,
|
|
413
|
+
errorType: ToolErrorType.UNHANDLED_EXCEPTION, // FIX: Added missing property
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
];
|
|
417
|
+
// Capture the onComplete callback
|
|
418
|
+
let capturedOnComplete = null;
|
|
419
|
+
mockUseReactToolScheduler.mockImplementation((onComplete) => {
|
|
420
|
+
capturedOnComplete = onComplete;
|
|
421
|
+
return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted, vi.fn()];
|
|
422
|
+
});
|
|
423
|
+
renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
424
|
+
// Trigger the onComplete callback with completed tools
|
|
425
|
+
await act(async () => {
|
|
426
|
+
if (capturedOnComplete) {
|
|
427
|
+
await capturedOnComplete(completedToolCalls);
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
await waitFor(() => {
|
|
431
|
+
expect(mockMarkToolsAsSubmitted).toHaveBeenCalledTimes(1);
|
|
432
|
+
expect(mockSendMessageStream).toHaveBeenCalledTimes(1);
|
|
433
|
+
});
|
|
434
|
+
const expectedMergedResponse = [
|
|
435
|
+
...toolCall1ResponseParts,
|
|
436
|
+
...toolCall2ResponseParts,
|
|
437
|
+
];
|
|
438
|
+
expect(mockSendMessageStream).toHaveBeenCalledWith(expectedMergedResponse, expect.any(AbortSignal), 'prompt-id-2');
|
|
439
|
+
});
|
|
440
|
+
it('should handle all tool calls being cancelled', async () => {
|
|
441
|
+
const cancelledToolCalls = [
|
|
442
|
+
{
|
|
443
|
+
request: {
|
|
444
|
+
callId: '1',
|
|
445
|
+
name: 'testTool',
|
|
446
|
+
args: {},
|
|
447
|
+
isClientInitiated: false,
|
|
448
|
+
prompt_id: 'prompt-id-3',
|
|
449
|
+
},
|
|
450
|
+
status: 'cancelled',
|
|
451
|
+
response: {
|
|
452
|
+
callId: '1',
|
|
453
|
+
responseParts: [{ text: 'cancelled' }],
|
|
454
|
+
errorType: undefined, // FIX: Added missing property
|
|
455
|
+
},
|
|
456
|
+
responseSubmittedToGemini: false,
|
|
457
|
+
tool: {
|
|
458
|
+
displayName: 'mock tool',
|
|
459
|
+
},
|
|
460
|
+
invocation: {
|
|
461
|
+
getDescription: () => `Mock description`,
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
];
|
|
465
|
+
const client = new MockedGeminiClientClass(mockConfig);
|
|
466
|
+
// Capture the onComplete callback
|
|
467
|
+
let capturedOnComplete = null;
|
|
468
|
+
mockUseReactToolScheduler.mockImplementation((onComplete) => {
|
|
469
|
+
capturedOnComplete = onComplete;
|
|
470
|
+
return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted, vi.fn()];
|
|
471
|
+
});
|
|
472
|
+
renderHook(() => useGeminiStream(client, [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
473
|
+
// Trigger the onComplete callback with cancelled tools
|
|
474
|
+
await act(async () => {
|
|
475
|
+
if (capturedOnComplete) {
|
|
476
|
+
await capturedOnComplete(cancelledToolCalls);
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
await waitFor(() => {
|
|
480
|
+
expect(mockMarkToolsAsSubmitted).toHaveBeenCalledWith(['1']);
|
|
481
|
+
expect(client.addHistory).toHaveBeenCalledWith({
|
|
482
|
+
role: 'user',
|
|
483
|
+
parts: [{ text: 'cancelled' }],
|
|
484
|
+
});
|
|
485
|
+
// Ensure we do NOT call back to the API
|
|
486
|
+
expect(mockSendMessageStream).not.toHaveBeenCalled();
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
it('should group multiple cancelled tool call responses into a single history entry', async () => {
|
|
490
|
+
const cancelledToolCall1 = {
|
|
491
|
+
request: {
|
|
492
|
+
callId: 'cancel-1',
|
|
493
|
+
name: 'toolA',
|
|
494
|
+
args: {},
|
|
495
|
+
isClientInitiated: false,
|
|
496
|
+
prompt_id: 'prompt-id-7',
|
|
497
|
+
},
|
|
498
|
+
tool: {
|
|
499
|
+
name: 'toolA',
|
|
500
|
+
displayName: 'toolA',
|
|
501
|
+
description: 'descA',
|
|
502
|
+
build: vi.fn(),
|
|
503
|
+
},
|
|
504
|
+
invocation: {
|
|
505
|
+
getDescription: () => `Mock description`,
|
|
506
|
+
},
|
|
507
|
+
status: 'cancelled',
|
|
508
|
+
response: {
|
|
509
|
+
callId: 'cancel-1',
|
|
510
|
+
responseParts: [
|
|
511
|
+
{ functionResponse: { name: 'toolA', id: 'cancel-1' } },
|
|
512
|
+
],
|
|
513
|
+
resultDisplay: undefined,
|
|
514
|
+
error: undefined,
|
|
515
|
+
errorType: undefined, // FIX: Added missing property
|
|
516
|
+
},
|
|
517
|
+
responseSubmittedToGemini: false,
|
|
518
|
+
};
|
|
519
|
+
const cancelledToolCall2 = {
|
|
520
|
+
request: {
|
|
521
|
+
callId: 'cancel-2',
|
|
522
|
+
name: 'toolB',
|
|
523
|
+
args: {},
|
|
524
|
+
isClientInitiated: false,
|
|
525
|
+
prompt_id: 'prompt-id-8',
|
|
526
|
+
},
|
|
527
|
+
tool: {
|
|
528
|
+
name: 'toolB',
|
|
529
|
+
displayName: 'toolB',
|
|
530
|
+
description: 'descB',
|
|
531
|
+
build: vi.fn(),
|
|
532
|
+
},
|
|
533
|
+
invocation: {
|
|
534
|
+
getDescription: () => `Mock description`,
|
|
535
|
+
},
|
|
536
|
+
status: 'cancelled',
|
|
537
|
+
response: {
|
|
538
|
+
callId: 'cancel-2',
|
|
539
|
+
responseParts: [
|
|
540
|
+
{ functionResponse: { name: 'toolB', id: 'cancel-2' } },
|
|
541
|
+
],
|
|
542
|
+
resultDisplay: undefined,
|
|
543
|
+
error: undefined,
|
|
544
|
+
errorType: undefined, // FIX: Added missing property
|
|
545
|
+
},
|
|
546
|
+
responseSubmittedToGemini: false,
|
|
547
|
+
};
|
|
548
|
+
const allCancelledTools = [cancelledToolCall1, cancelledToolCall2];
|
|
549
|
+
const client = new MockedGeminiClientClass(mockConfig);
|
|
550
|
+
let capturedOnComplete = null;
|
|
551
|
+
mockUseReactToolScheduler.mockImplementation((onComplete) => {
|
|
552
|
+
capturedOnComplete = onComplete;
|
|
553
|
+
return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted, vi.fn()];
|
|
554
|
+
});
|
|
555
|
+
renderHook(() => useGeminiStream(client, [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
556
|
+
// Trigger the onComplete callback with multiple cancelled tools
|
|
557
|
+
await act(async () => {
|
|
558
|
+
if (capturedOnComplete) {
|
|
559
|
+
await capturedOnComplete(allCancelledTools);
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
await waitFor(() => {
|
|
563
|
+
// The tools should be marked as submitted locally
|
|
564
|
+
expect(mockMarkToolsAsSubmitted).toHaveBeenCalledWith([
|
|
565
|
+
'cancel-1',
|
|
566
|
+
'cancel-2',
|
|
567
|
+
]);
|
|
568
|
+
// Crucially, addHistory should be called only ONCE
|
|
569
|
+
expect(client.addHistory).toHaveBeenCalledTimes(1);
|
|
570
|
+
// And that single call should contain BOTH function responses
|
|
571
|
+
expect(client.addHistory).toHaveBeenCalledWith({
|
|
572
|
+
role: 'user',
|
|
573
|
+
parts: [
|
|
574
|
+
...cancelledToolCall1.response.responseParts,
|
|
575
|
+
...cancelledToolCall2.response.responseParts,
|
|
576
|
+
],
|
|
577
|
+
});
|
|
578
|
+
// No message should be sent back to the API for a turn with only cancellations
|
|
579
|
+
expect(mockSendMessageStream).not.toHaveBeenCalled();
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
it('should not flicker streaming state to Idle between tool completion and submission', async () => {
|
|
583
|
+
const toolCallResponseParts = [
|
|
584
|
+
{ text: 'tool 1 final response' },
|
|
585
|
+
];
|
|
586
|
+
const initialToolCalls = [
|
|
587
|
+
{
|
|
588
|
+
request: {
|
|
589
|
+
callId: 'call1',
|
|
590
|
+
name: 'tool1',
|
|
591
|
+
args: {},
|
|
592
|
+
isClientInitiated: false,
|
|
593
|
+
prompt_id: 'prompt-id-4',
|
|
594
|
+
},
|
|
595
|
+
status: 'executing',
|
|
596
|
+
responseSubmittedToGemini: false,
|
|
597
|
+
tool: {
|
|
598
|
+
name: 'tool1',
|
|
599
|
+
displayName: 'tool1',
|
|
600
|
+
description: 'desc',
|
|
601
|
+
build: vi.fn(),
|
|
602
|
+
},
|
|
603
|
+
invocation: {
|
|
604
|
+
getDescription: () => `Mock description`,
|
|
605
|
+
},
|
|
606
|
+
startTime: Date.now(),
|
|
607
|
+
},
|
|
608
|
+
];
|
|
609
|
+
const completedToolCalls = [
|
|
610
|
+
{
|
|
611
|
+
...initialToolCalls[0],
|
|
612
|
+
status: 'success',
|
|
613
|
+
response: {
|
|
614
|
+
callId: 'call1',
|
|
615
|
+
responseParts: toolCallResponseParts,
|
|
616
|
+
error: undefined,
|
|
617
|
+
errorType: undefined, // FIX: Added missing property
|
|
618
|
+
resultDisplay: 'Tool 1 success display',
|
|
619
|
+
},
|
|
620
|
+
endTime: Date.now(),
|
|
621
|
+
},
|
|
622
|
+
];
|
|
623
|
+
// Capture the onComplete callback
|
|
624
|
+
let capturedOnComplete = null;
|
|
625
|
+
let currentToolCalls = initialToolCalls;
|
|
626
|
+
mockUseReactToolScheduler.mockImplementation((onComplete) => {
|
|
627
|
+
capturedOnComplete = onComplete;
|
|
628
|
+
return [
|
|
629
|
+
currentToolCalls,
|
|
630
|
+
mockScheduleToolCalls,
|
|
631
|
+
mockMarkToolsAsSubmitted,
|
|
632
|
+
vi.fn(), // setToolCallsForDisplay
|
|
633
|
+
];
|
|
634
|
+
});
|
|
635
|
+
const { result, rerender } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
636
|
+
// 1. Initial state should be Responding because a tool is executing.
|
|
637
|
+
expect(result.current.streamingState).toBe(StreamingState.Responding);
|
|
638
|
+
// 2. Update the tool calls to completed state and rerender
|
|
639
|
+
currentToolCalls = completedToolCalls;
|
|
640
|
+
mockUseReactToolScheduler.mockImplementation((onComplete) => {
|
|
641
|
+
capturedOnComplete = onComplete;
|
|
642
|
+
return [
|
|
643
|
+
completedToolCalls,
|
|
644
|
+
mockScheduleToolCalls,
|
|
645
|
+
mockMarkToolsAsSubmitted,
|
|
646
|
+
vi.fn(), // setToolCallsForDisplay
|
|
647
|
+
];
|
|
648
|
+
});
|
|
649
|
+
act(() => {
|
|
650
|
+
rerender();
|
|
651
|
+
});
|
|
652
|
+
// 3. The state should *still* be Responding, not Idle.
|
|
653
|
+
// This is because the completed tool's response has not been submitted yet.
|
|
654
|
+
expect(result.current.streamingState).toBe(StreamingState.Responding);
|
|
655
|
+
// 4. Trigger the onComplete callback to simulate tool completion
|
|
656
|
+
await act(async () => {
|
|
657
|
+
if (capturedOnComplete) {
|
|
658
|
+
await capturedOnComplete(completedToolCalls);
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
// 5. Wait for submitQuery to be called
|
|
662
|
+
await waitFor(() => {
|
|
663
|
+
expect(mockSendMessageStream).toHaveBeenCalledWith(toolCallResponseParts, expect.any(AbortSignal), 'prompt-id-4');
|
|
664
|
+
});
|
|
665
|
+
// 6. After submission, the state should remain Responding until the stream completes.
|
|
666
|
+
expect(result.current.streamingState).toBe(StreamingState.Responding);
|
|
667
|
+
});
|
|
668
|
+
describe('User Cancellation', () => {
|
|
669
|
+
let keypressCallback;
|
|
670
|
+
const mockUseKeypress = useKeypress;
|
|
671
|
+
beforeEach(() => {
|
|
672
|
+
// Capture the callback passed to useKeypress
|
|
673
|
+
mockUseKeypress.mockImplementation((callback, options) => {
|
|
674
|
+
if (options.isActive) {
|
|
675
|
+
keypressCallback = callback;
|
|
676
|
+
}
|
|
677
|
+
else {
|
|
678
|
+
keypressCallback = () => { };
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
const simulateEscapeKeyPress = () => {
|
|
683
|
+
act(() => {
|
|
684
|
+
keypressCallback({ name: 'escape' });
|
|
685
|
+
});
|
|
686
|
+
};
|
|
687
|
+
it('should cancel an in-progress stream when escape is pressed', async () => {
|
|
688
|
+
const mockStream = (async function* () {
|
|
689
|
+
yield { type: 'content', value: 'Part 1' };
|
|
690
|
+
// Keep the stream open
|
|
691
|
+
await new Promise(() => { });
|
|
692
|
+
})();
|
|
693
|
+
mockSendMessageStream.mockReturnValue(mockStream);
|
|
694
|
+
const { result } = renderTestHook();
|
|
695
|
+
// Start a query
|
|
696
|
+
await act(async () => {
|
|
697
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
698
|
+
result.current.submitQuery('test query');
|
|
699
|
+
});
|
|
700
|
+
// Wait for the first part of the response
|
|
701
|
+
await waitFor(() => {
|
|
702
|
+
expect(result.current.streamingState).toBe(StreamingState.Responding);
|
|
703
|
+
});
|
|
704
|
+
// Simulate escape key press
|
|
705
|
+
simulateEscapeKeyPress();
|
|
706
|
+
// Verify cancellation message is added
|
|
707
|
+
await waitFor(() => {
|
|
708
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
709
|
+
type: MessageType.INFO,
|
|
710
|
+
text: 'Request cancelled.',
|
|
711
|
+
}, expect.any(Number));
|
|
712
|
+
});
|
|
713
|
+
// Verify state is reset
|
|
714
|
+
expect(result.current.streamingState).toBe(StreamingState.Idle);
|
|
715
|
+
});
|
|
716
|
+
it('should call onCancelSubmit handler when escape is pressed', async () => {
|
|
717
|
+
const cancelSubmitSpy = vi.fn();
|
|
718
|
+
const mockStream = (async function* () {
|
|
719
|
+
yield { type: 'content', value: 'Part 1' };
|
|
720
|
+
// Keep the stream open
|
|
721
|
+
await new Promise(() => { });
|
|
722
|
+
})();
|
|
723
|
+
mockSendMessageStream.mockReturnValue(mockStream);
|
|
724
|
+
const { result } = renderHook(() => useGeminiStream(mockConfig.getGeminiClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, cancelSubmitSpy, () => { }, 80, 24));
|
|
725
|
+
// Start a query
|
|
726
|
+
await act(async () => {
|
|
727
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
728
|
+
result.current.submitQuery('test query');
|
|
729
|
+
});
|
|
730
|
+
simulateEscapeKeyPress();
|
|
731
|
+
expect(cancelSubmitSpy).toHaveBeenCalledWith(false);
|
|
732
|
+
});
|
|
733
|
+
it('should call setShellInputFocused(false) when escape is pressed', async () => {
|
|
734
|
+
const setShellInputFocusedSpy = vi.fn();
|
|
735
|
+
const mockStream = (async function* () {
|
|
736
|
+
yield { type: 'content', value: 'Part 1' };
|
|
737
|
+
await new Promise(() => { }); // Keep stream open
|
|
738
|
+
})();
|
|
739
|
+
mockSendMessageStream.mockReturnValue(mockStream);
|
|
740
|
+
const { result } = renderHook(() => useGeminiStream(mockConfig.getGeminiClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, vi.fn(), setShellInputFocusedSpy, // Pass the spy here
|
|
741
|
+
80, 24));
|
|
742
|
+
// Start a query
|
|
743
|
+
await act(async () => {
|
|
744
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
745
|
+
result.current.submitQuery('test query');
|
|
746
|
+
});
|
|
747
|
+
simulateEscapeKeyPress();
|
|
748
|
+
expect(setShellInputFocusedSpy).toHaveBeenCalledWith(false);
|
|
749
|
+
});
|
|
750
|
+
it('should not do anything if escape is pressed when not responding', () => {
|
|
751
|
+
const { result } = renderTestHook();
|
|
752
|
+
expect(result.current.streamingState).toBe(StreamingState.Idle);
|
|
753
|
+
// Simulate escape key press
|
|
754
|
+
simulateEscapeKeyPress();
|
|
755
|
+
// No change should happen, no cancellation message
|
|
756
|
+
expect(mockAddItem).not.toHaveBeenCalledWith(expect.objectContaining({
|
|
757
|
+
text: 'Request cancelled.',
|
|
758
|
+
}), expect.any(Number));
|
|
759
|
+
});
|
|
760
|
+
it('should prevent further processing after cancellation', async () => {
|
|
761
|
+
let continueStream;
|
|
762
|
+
const streamPromise = new Promise((resolve) => {
|
|
763
|
+
continueStream = resolve;
|
|
764
|
+
});
|
|
765
|
+
const mockStream = (async function* () {
|
|
766
|
+
yield { type: 'content', value: 'Initial' };
|
|
767
|
+
await streamPromise; // Wait until we manually continue
|
|
768
|
+
yield { type: 'content', value: ' Canceled' };
|
|
769
|
+
})();
|
|
770
|
+
mockSendMessageStream.mockReturnValue(mockStream);
|
|
771
|
+
const { result } = renderTestHook();
|
|
772
|
+
await act(async () => {
|
|
773
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
774
|
+
result.current.submitQuery('long running query');
|
|
775
|
+
});
|
|
776
|
+
await waitFor(() => {
|
|
777
|
+
expect(result.current.streamingState).toBe(StreamingState.Responding);
|
|
778
|
+
});
|
|
779
|
+
// Cancel the request
|
|
780
|
+
simulateEscapeKeyPress();
|
|
781
|
+
// Allow the stream to continue
|
|
782
|
+
await act(async () => {
|
|
783
|
+
continueStream();
|
|
784
|
+
// Wait a bit to see if the second part is processed
|
|
785
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
786
|
+
});
|
|
787
|
+
// The text should not have been updated with " Canceled"
|
|
788
|
+
const lastCall = mockAddItem.mock.calls.find((call) => call[0].type === 'gemini');
|
|
789
|
+
expect(lastCall?.[0].text).toBe('Initial');
|
|
790
|
+
// The final state should be idle after cancellation
|
|
791
|
+
expect(result.current.streamingState).toBe(StreamingState.Idle);
|
|
792
|
+
});
|
|
793
|
+
it('should cancel if a tool call is in progress', async () => {
|
|
794
|
+
const toolCalls = [
|
|
795
|
+
{
|
|
796
|
+
request: { callId: 'call1', name: 'tool1', args: {} },
|
|
797
|
+
status: 'executing',
|
|
798
|
+
responseSubmittedToGemini: false,
|
|
799
|
+
tool: {
|
|
800
|
+
name: 'tool1',
|
|
801
|
+
description: 'desc1',
|
|
802
|
+
build: vi.fn().mockImplementation((_) => ({
|
|
803
|
+
getDescription: () => `Mock description`,
|
|
804
|
+
})),
|
|
805
|
+
},
|
|
806
|
+
invocation: {
|
|
807
|
+
getDescription: () => `Mock description`,
|
|
808
|
+
},
|
|
809
|
+
startTime: Date.now(),
|
|
810
|
+
liveOutput: '...',
|
|
811
|
+
},
|
|
812
|
+
];
|
|
813
|
+
const { result } = renderTestHook(toolCalls);
|
|
814
|
+
// State is `Responding` because a tool is running
|
|
815
|
+
expect(result.current.streamingState).toBe(StreamingState.Responding);
|
|
816
|
+
// Try to cancel
|
|
817
|
+
simulateEscapeKeyPress();
|
|
818
|
+
// The cancel function should be called
|
|
819
|
+
expect(mockCancelAllToolCalls).toHaveBeenCalled();
|
|
820
|
+
});
|
|
821
|
+
it('should cancel a request when a tool is awaiting confirmation', async () => {
|
|
822
|
+
const mockOnConfirm = vi.fn().mockResolvedValue(undefined);
|
|
823
|
+
const toolCalls = [
|
|
824
|
+
{
|
|
825
|
+
request: {
|
|
826
|
+
callId: 'confirm-call',
|
|
827
|
+
name: 'some_tool',
|
|
828
|
+
args: {},
|
|
829
|
+
isClientInitiated: false,
|
|
830
|
+
prompt_id: 'prompt-id-1',
|
|
831
|
+
},
|
|
832
|
+
status: 'awaiting_approval',
|
|
833
|
+
responseSubmittedToGemini: false,
|
|
834
|
+
tool: {
|
|
835
|
+
name: 'some_tool',
|
|
836
|
+
description: 'a tool',
|
|
837
|
+
build: vi.fn().mockImplementation((_) => ({
|
|
838
|
+
getDescription: () => `Mock description`,
|
|
839
|
+
})),
|
|
840
|
+
},
|
|
841
|
+
invocation: {
|
|
842
|
+
getDescription: () => `Mock description`,
|
|
843
|
+
},
|
|
844
|
+
confirmationDetails: {
|
|
845
|
+
type: 'edit',
|
|
846
|
+
title: 'Confirm Edit',
|
|
847
|
+
onConfirm: mockOnConfirm,
|
|
848
|
+
fileName: 'file.txt',
|
|
849
|
+
filePath: '/test/file.txt',
|
|
850
|
+
fileDiff: 'fake diff',
|
|
851
|
+
originalContent: 'old',
|
|
852
|
+
newContent: 'new',
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
];
|
|
856
|
+
const { result } = renderTestHook(toolCalls);
|
|
857
|
+
// State is `WaitingForConfirmation` because a tool is awaiting approval
|
|
858
|
+
expect(result.current.streamingState).toBe(StreamingState.WaitingForConfirmation);
|
|
859
|
+
// Try to cancel
|
|
860
|
+
simulateEscapeKeyPress();
|
|
861
|
+
// The imperative cancel function should be called on the scheduler
|
|
862
|
+
expect(mockCancelAllToolCalls).toHaveBeenCalled();
|
|
863
|
+
// A cancellation message should be added to history
|
|
864
|
+
await waitFor(() => {
|
|
865
|
+
expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
866
|
+
text: 'Request cancelled.',
|
|
867
|
+
}), expect.any(Number));
|
|
868
|
+
});
|
|
869
|
+
// The final state should be idle
|
|
870
|
+
expect(result.current.streamingState).toBe(StreamingState.Idle);
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
describe('Slash Command Handling', () => {
|
|
874
|
+
it('should schedule a tool call when the command processor returns a schedule_tool action', async () => {
|
|
875
|
+
const clientToolRequest = {
|
|
876
|
+
type: 'schedule_tool',
|
|
877
|
+
toolName: 'save_memory',
|
|
878
|
+
toolArgs: { fact: 'test fact' },
|
|
879
|
+
};
|
|
880
|
+
mockHandleSlashCommand.mockResolvedValue(clientToolRequest);
|
|
881
|
+
const { result } = renderTestHook();
|
|
882
|
+
await act(async () => {
|
|
883
|
+
await result.current.submitQuery('/memory add "test fact"');
|
|
884
|
+
});
|
|
885
|
+
await waitFor(() => {
|
|
886
|
+
expect(mockScheduleToolCalls).toHaveBeenCalledWith([
|
|
887
|
+
expect.objectContaining({
|
|
888
|
+
name: 'save_memory',
|
|
889
|
+
args: { fact: 'test fact' },
|
|
890
|
+
isClientInitiated: true,
|
|
891
|
+
}),
|
|
892
|
+
], expect.any(AbortSignal));
|
|
893
|
+
expect(mockSendMessageStream).not.toHaveBeenCalled();
|
|
894
|
+
});
|
|
895
|
+
});
|
|
896
|
+
it('should stop processing and not call Gemini when a command is handled without a tool call', async () => {
|
|
897
|
+
const uiOnlyCommandResult = {
|
|
898
|
+
type: 'handled',
|
|
899
|
+
};
|
|
900
|
+
mockHandleSlashCommand.mockResolvedValue(uiOnlyCommandResult);
|
|
901
|
+
const { result } = renderTestHook();
|
|
902
|
+
await act(async () => {
|
|
903
|
+
await result.current.submitQuery('/help');
|
|
904
|
+
});
|
|
905
|
+
await waitFor(() => {
|
|
906
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/help');
|
|
907
|
+
expect(mockScheduleToolCalls).not.toHaveBeenCalled();
|
|
908
|
+
expect(mockSendMessageStream).not.toHaveBeenCalled(); // No LLM call made
|
|
909
|
+
});
|
|
910
|
+
});
|
|
911
|
+
it('should call Gemini with prompt content when slash command returns a `submit_prompt` action', async () => {
|
|
912
|
+
const customCommandResult = {
|
|
913
|
+
type: 'submit_prompt',
|
|
914
|
+
content: 'This is the actual prompt from the command file.',
|
|
915
|
+
};
|
|
916
|
+
mockHandleSlashCommand.mockResolvedValue(customCommandResult);
|
|
917
|
+
const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
|
|
918
|
+
await act(async () => {
|
|
919
|
+
await result.current.submitQuery('/my-custom-command');
|
|
920
|
+
});
|
|
921
|
+
await waitFor(() => {
|
|
922
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/my-custom-command');
|
|
923
|
+
expect(localMockSendMessageStream).not.toHaveBeenCalledWith('/my-custom-command', expect.anything(), expect.anything());
|
|
924
|
+
expect(localMockSendMessageStream).toHaveBeenCalledWith('This is the actual prompt from the command file.', expect.any(AbortSignal), expect.any(String));
|
|
925
|
+
expect(mockScheduleToolCalls).not.toHaveBeenCalled();
|
|
926
|
+
});
|
|
927
|
+
});
|
|
928
|
+
it('should correctly handle a submit_prompt action with empty content', async () => {
|
|
929
|
+
const emptyPromptResult = {
|
|
930
|
+
type: 'submit_prompt',
|
|
931
|
+
content: '',
|
|
932
|
+
};
|
|
933
|
+
mockHandleSlashCommand.mockResolvedValue(emptyPromptResult);
|
|
934
|
+
const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
|
|
935
|
+
await act(async () => {
|
|
936
|
+
await result.current.submitQuery('/emptycmd');
|
|
937
|
+
});
|
|
938
|
+
await waitFor(() => {
|
|
939
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/emptycmd');
|
|
940
|
+
expect(localMockSendMessageStream).toHaveBeenCalledWith('', expect.any(AbortSignal), expect.any(String));
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
it('should not call handleSlashCommand for line comments', async () => {
|
|
944
|
+
const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
|
|
945
|
+
await act(async () => {
|
|
946
|
+
await result.current.submitQuery('// This is a line comment');
|
|
947
|
+
});
|
|
948
|
+
await waitFor(() => {
|
|
949
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
950
|
+
expect(localMockSendMessageStream).toHaveBeenCalledWith('// This is a line comment', expect.any(AbortSignal), expect.any(String));
|
|
951
|
+
});
|
|
952
|
+
});
|
|
953
|
+
it('should not call handleSlashCommand for block comments', async () => {
|
|
954
|
+
const { result, mockSendMessageStream: localMockSendMessageStream } = renderTestHook();
|
|
955
|
+
await act(async () => {
|
|
956
|
+
await result.current.submitQuery('/* This is a block comment */');
|
|
957
|
+
});
|
|
958
|
+
await waitFor(() => {
|
|
959
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
960
|
+
expect(localMockSendMessageStream).toHaveBeenCalledWith('/* This is a block comment */', expect.any(AbortSignal), expect.any(String));
|
|
961
|
+
});
|
|
962
|
+
});
|
|
963
|
+
it('should not call handleSlashCommand is shell mode is active', async () => {
|
|
964
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, () => { }, mockHandleSlashCommand, true, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
965
|
+
await act(async () => {
|
|
966
|
+
await result.current.submitQuery('/about');
|
|
967
|
+
});
|
|
968
|
+
await waitFor(() => {
|
|
969
|
+
expect(mockHandleSlashCommand).not.toHaveBeenCalled();
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
});
|
|
973
|
+
describe('Memory Refresh on save_memory', () => {
|
|
974
|
+
it('should call performMemoryRefresh when a save_memory tool call completes successfully', async () => {
|
|
975
|
+
const mockPerformMemoryRefresh = vi.fn();
|
|
976
|
+
const completedToolCall = {
|
|
977
|
+
request: {
|
|
978
|
+
callId: 'save-mem-call-1',
|
|
979
|
+
name: 'save_memory',
|
|
980
|
+
args: { fact: 'test' },
|
|
981
|
+
isClientInitiated: true,
|
|
982
|
+
prompt_id: 'prompt-id-6',
|
|
983
|
+
},
|
|
984
|
+
status: 'success',
|
|
985
|
+
responseSubmittedToGemini: false,
|
|
986
|
+
response: {
|
|
987
|
+
callId: 'save-mem-call-1',
|
|
988
|
+
responseParts: [{ text: 'Memory saved' }],
|
|
989
|
+
resultDisplay: 'Success: Memory saved',
|
|
990
|
+
error: undefined,
|
|
991
|
+
errorType: undefined, // FIX: Added missing property
|
|
992
|
+
},
|
|
993
|
+
tool: {
|
|
994
|
+
name: 'save_memory',
|
|
995
|
+
displayName: 'save_memory',
|
|
996
|
+
description: 'Saves memory',
|
|
997
|
+
build: vi.fn(),
|
|
998
|
+
},
|
|
999
|
+
invocation: {
|
|
1000
|
+
getDescription: () => `Mock description`,
|
|
1001
|
+
},
|
|
1002
|
+
};
|
|
1003
|
+
// Capture the onComplete callback
|
|
1004
|
+
let capturedOnComplete = null;
|
|
1005
|
+
mockUseReactToolScheduler.mockImplementation((onComplete) => {
|
|
1006
|
+
capturedOnComplete = onComplete;
|
|
1007
|
+
return [[], mockScheduleToolCalls, mockMarkToolsAsSubmitted, vi.fn()];
|
|
1008
|
+
});
|
|
1009
|
+
renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, mockPerformMemoryRefresh, false, () => { }, () => { }, () => { }, 80, 24));
|
|
1010
|
+
// Trigger the onComplete callback with the completed save_memory tool
|
|
1011
|
+
await act(async () => {
|
|
1012
|
+
if (capturedOnComplete) {
|
|
1013
|
+
await capturedOnComplete([completedToolCall]);
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
await waitFor(() => {
|
|
1017
|
+
expect(mockPerformMemoryRefresh).toHaveBeenCalledTimes(1);
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
1020
|
+
});
|
|
1021
|
+
describe('Error Handling', () => {
|
|
1022
|
+
it('should call parseAndFormatApiError with the correct authType on stream initialization failure', async () => {
|
|
1023
|
+
// 1. Setup
|
|
1024
|
+
const mockError = new Error('Rate limit exceeded');
|
|
1025
|
+
const mockAuthType = AuthType.LOGIN_WITH_GOOGLE;
|
|
1026
|
+
mockParseAndFormatApiError.mockClear();
|
|
1027
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1028
|
+
yield { type: 'content', value: '' };
|
|
1029
|
+
throw mockError;
|
|
1030
|
+
})());
|
|
1031
|
+
const testConfig = {
|
|
1032
|
+
...mockConfig,
|
|
1033
|
+
getContentGeneratorConfig: vi.fn(() => ({
|
|
1034
|
+
authType: mockAuthType,
|
|
1035
|
+
})),
|
|
1036
|
+
getModel: vi.fn(() => 'gemini-2.5-pro'),
|
|
1037
|
+
};
|
|
1038
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(testConfig), [], mockAddItem, testConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
1039
|
+
// 2. Action
|
|
1040
|
+
await act(async () => {
|
|
1041
|
+
await result.current.submitQuery('test query');
|
|
1042
|
+
});
|
|
1043
|
+
// 3. Assertion
|
|
1044
|
+
await waitFor(() => {
|
|
1045
|
+
expect(mockParseAndFormatApiError).toHaveBeenCalledWith('Rate limit exceeded', mockAuthType, undefined, 'gemini-2.5-pro', 'gemini-2.5-flash');
|
|
1046
|
+
});
|
|
1047
|
+
});
|
|
1048
|
+
});
|
|
1049
|
+
describe('handleApprovalModeChange', () => {
|
|
1050
|
+
it('should auto-approve all pending tool calls when switching to YOLO mode', async () => {
|
|
1051
|
+
const mockOnConfirm = vi.fn().mockResolvedValue(undefined);
|
|
1052
|
+
const awaitingApprovalToolCalls = [
|
|
1053
|
+
createMockToolCall('replace', 'call1', 'edit', mockOnConfirm),
|
|
1054
|
+
createMockToolCall('read_file', 'call2', 'info', mockOnConfirm),
|
|
1055
|
+
];
|
|
1056
|
+
const { result } = renderTestHook(awaitingApprovalToolCalls);
|
|
1057
|
+
await act(async () => {
|
|
1058
|
+
await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
|
|
1059
|
+
});
|
|
1060
|
+
// Both tool calls should be auto-approved
|
|
1061
|
+
expect(mockOnConfirm).toHaveBeenCalledTimes(2);
|
|
1062
|
+
expect(mockOnConfirm).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
|
|
1063
|
+
});
|
|
1064
|
+
it('should only auto-approve edit tools when switching to AUTO_EDIT mode', async () => {
|
|
1065
|
+
const mockOnConfirmReplace = vi.fn().mockResolvedValue(undefined);
|
|
1066
|
+
const mockOnConfirmWrite = vi.fn().mockResolvedValue(undefined);
|
|
1067
|
+
const mockOnConfirmRead = vi.fn().mockResolvedValue(undefined);
|
|
1068
|
+
const awaitingApprovalToolCalls = [
|
|
1069
|
+
createMockToolCall('replace', 'call1', 'edit', mockOnConfirmReplace),
|
|
1070
|
+
createMockToolCall('write_file', 'call2', 'edit', mockOnConfirmWrite),
|
|
1071
|
+
createMockToolCall('read_file', 'call3', 'info', mockOnConfirmRead),
|
|
1072
|
+
];
|
|
1073
|
+
const { result } = renderTestHook(awaitingApprovalToolCalls);
|
|
1074
|
+
await act(async () => {
|
|
1075
|
+
await result.current.handleApprovalModeChange(ApprovalMode.AUTO_EDIT);
|
|
1076
|
+
});
|
|
1077
|
+
// Only replace and write_file should be auto-approved
|
|
1078
|
+
expect(mockOnConfirmReplace).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
|
|
1079
|
+
expect(mockOnConfirmWrite).toHaveBeenCalledWith(ToolConfirmationOutcome.ProceedOnce);
|
|
1080
|
+
// read_file should not be auto-approved
|
|
1081
|
+
expect(mockOnConfirmRead).not.toHaveBeenCalled();
|
|
1082
|
+
});
|
|
1083
|
+
it('should not auto-approve any tools when switching to REQUIRE_CONFIRMATION mode', async () => {
|
|
1084
|
+
const mockOnConfirm = vi.fn().mockResolvedValue(undefined);
|
|
1085
|
+
const awaitingApprovalToolCalls = [
|
|
1086
|
+
createMockToolCall('replace', 'call1', 'edit', mockOnConfirm),
|
|
1087
|
+
];
|
|
1088
|
+
const { result } = renderTestHook(awaitingApprovalToolCalls);
|
|
1089
|
+
await act(async () => {
|
|
1090
|
+
await result.current.handleApprovalModeChange(ApprovalMode.DEFAULT);
|
|
1091
|
+
});
|
|
1092
|
+
// No tools should be auto-approved
|
|
1093
|
+
expect(mockOnConfirm).not.toHaveBeenCalled();
|
|
1094
|
+
});
|
|
1095
|
+
it('should handle errors gracefully when auto-approving tool calls', async () => {
|
|
1096
|
+
const debuggerSpy = vi
|
|
1097
|
+
.spyOn(debugLogger, 'warn')
|
|
1098
|
+
.mockImplementation(() => { });
|
|
1099
|
+
const mockOnConfirmSuccess = vi.fn().mockResolvedValue(undefined);
|
|
1100
|
+
const mockOnConfirmError = vi
|
|
1101
|
+
.fn()
|
|
1102
|
+
.mockRejectedValue(new Error('Approval failed'));
|
|
1103
|
+
const awaitingApprovalToolCalls = [
|
|
1104
|
+
createMockToolCall('replace', 'call1', 'edit', mockOnConfirmSuccess),
|
|
1105
|
+
createMockToolCall('write_file', 'call2', 'edit', mockOnConfirmError),
|
|
1106
|
+
];
|
|
1107
|
+
const { result } = renderTestHook(awaitingApprovalToolCalls);
|
|
1108
|
+
await act(async () => {
|
|
1109
|
+
await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
|
|
1110
|
+
});
|
|
1111
|
+
// Both confirmation methods should be called
|
|
1112
|
+
expect(mockOnConfirmSuccess).toHaveBeenCalled();
|
|
1113
|
+
expect(mockOnConfirmError).toHaveBeenCalled();
|
|
1114
|
+
// Error should be logged
|
|
1115
|
+
expect(debuggerSpy).toHaveBeenCalledWith('Failed to auto-approve tool call call2:', expect.any(Error));
|
|
1116
|
+
debuggerSpy.mockRestore();
|
|
1117
|
+
});
|
|
1118
|
+
it('should skip tool calls without confirmationDetails', async () => {
|
|
1119
|
+
const awaitingApprovalToolCalls = [
|
|
1120
|
+
{
|
|
1121
|
+
request: {
|
|
1122
|
+
callId: 'call1',
|
|
1123
|
+
name: 'replace',
|
|
1124
|
+
args: { old_string: 'old', new_string: 'new' },
|
|
1125
|
+
isClientInitiated: false,
|
|
1126
|
+
prompt_id: 'prompt-id-1',
|
|
1127
|
+
},
|
|
1128
|
+
status: 'awaiting_approval',
|
|
1129
|
+
responseSubmittedToGemini: false,
|
|
1130
|
+
// No confirmationDetails
|
|
1131
|
+
tool: {
|
|
1132
|
+
name: 'replace',
|
|
1133
|
+
displayName: 'replace',
|
|
1134
|
+
description: 'Replace text',
|
|
1135
|
+
build: vi.fn(),
|
|
1136
|
+
},
|
|
1137
|
+
invocation: {
|
|
1138
|
+
getDescription: () => 'Mock description',
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
1141
|
+
];
|
|
1142
|
+
const { result } = renderTestHook(awaitingApprovalToolCalls);
|
|
1143
|
+
// Should not throw an error
|
|
1144
|
+
await act(async () => {
|
|
1145
|
+
await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
|
|
1146
|
+
});
|
|
1147
|
+
});
|
|
1148
|
+
it('should skip tool calls without onConfirm method in confirmationDetails', async () => {
|
|
1149
|
+
const awaitingApprovalToolCalls = [
|
|
1150
|
+
{
|
|
1151
|
+
request: {
|
|
1152
|
+
callId: 'call1',
|
|
1153
|
+
name: 'replace',
|
|
1154
|
+
args: { old_string: 'old', new_string: 'new' },
|
|
1155
|
+
isClientInitiated: false,
|
|
1156
|
+
prompt_id: 'prompt-id-1',
|
|
1157
|
+
},
|
|
1158
|
+
status: 'awaiting_approval',
|
|
1159
|
+
responseSubmittedToGemini: false,
|
|
1160
|
+
confirmationDetails: {
|
|
1161
|
+
type: 'edit',
|
|
1162
|
+
title: 'Confirm Edit',
|
|
1163
|
+
// No onConfirm method
|
|
1164
|
+
fileName: 'file.txt',
|
|
1165
|
+
filePath: '/test/file.txt',
|
|
1166
|
+
fileDiff: 'fake diff',
|
|
1167
|
+
originalContent: 'old',
|
|
1168
|
+
newContent: 'new',
|
|
1169
|
+
},
|
|
1170
|
+
tool: {
|
|
1171
|
+
name: 'replace',
|
|
1172
|
+
displayName: 'replace',
|
|
1173
|
+
description: 'Replace text',
|
|
1174
|
+
build: vi.fn(),
|
|
1175
|
+
},
|
|
1176
|
+
invocation: {
|
|
1177
|
+
getDescription: () => 'Mock description',
|
|
1178
|
+
},
|
|
1179
|
+
},
|
|
1180
|
+
];
|
|
1181
|
+
const { result } = renderTestHook(awaitingApprovalToolCalls);
|
|
1182
|
+
// Should not throw an error
|
|
1183
|
+
await act(async () => {
|
|
1184
|
+
await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
|
|
1185
|
+
});
|
|
1186
|
+
});
|
|
1187
|
+
it('should only process tool calls with awaiting_approval status', async () => {
|
|
1188
|
+
const mockOnConfirmAwaiting = vi.fn().mockResolvedValue(undefined);
|
|
1189
|
+
const mockOnConfirmExecuting = vi.fn().mockResolvedValue(undefined);
|
|
1190
|
+
const mixedStatusToolCalls = [
|
|
1191
|
+
{
|
|
1192
|
+
request: {
|
|
1193
|
+
callId: 'call1',
|
|
1194
|
+
name: 'replace',
|
|
1195
|
+
args: { old_string: 'old', new_string: 'new' },
|
|
1196
|
+
isClientInitiated: false,
|
|
1197
|
+
prompt_id: 'prompt-id-1',
|
|
1198
|
+
},
|
|
1199
|
+
status: 'awaiting_approval',
|
|
1200
|
+
responseSubmittedToGemini: false,
|
|
1201
|
+
confirmationDetails: {
|
|
1202
|
+
type: 'edit',
|
|
1203
|
+
title: 'Confirm Edit',
|
|
1204
|
+
onConfirm: mockOnConfirmAwaiting,
|
|
1205
|
+
fileName: 'file.txt',
|
|
1206
|
+
filePath: '/test/file.txt',
|
|
1207
|
+
fileDiff: 'fake diff',
|
|
1208
|
+
originalContent: 'old',
|
|
1209
|
+
newContent: 'new',
|
|
1210
|
+
},
|
|
1211
|
+
tool: {
|
|
1212
|
+
name: 'replace',
|
|
1213
|
+
displayName: 'replace',
|
|
1214
|
+
description: 'Replace text',
|
|
1215
|
+
build: vi.fn(),
|
|
1216
|
+
},
|
|
1217
|
+
invocation: {
|
|
1218
|
+
getDescription: () => 'Mock description',
|
|
1219
|
+
},
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
request: {
|
|
1223
|
+
callId: 'call2',
|
|
1224
|
+
name: 'write_file',
|
|
1225
|
+
args: { path: '/test/file.txt', content: 'content' },
|
|
1226
|
+
isClientInitiated: false,
|
|
1227
|
+
prompt_id: 'prompt-id-1',
|
|
1228
|
+
},
|
|
1229
|
+
status: 'executing',
|
|
1230
|
+
responseSubmittedToGemini: false,
|
|
1231
|
+
tool: {
|
|
1232
|
+
name: 'write_file',
|
|
1233
|
+
displayName: 'write_file',
|
|
1234
|
+
description: 'Write file',
|
|
1235
|
+
build: vi.fn(),
|
|
1236
|
+
},
|
|
1237
|
+
invocation: {
|
|
1238
|
+
getDescription: () => 'Mock description',
|
|
1239
|
+
},
|
|
1240
|
+
startTime: Date.now(),
|
|
1241
|
+
liveOutput: 'Writing...',
|
|
1242
|
+
},
|
|
1243
|
+
];
|
|
1244
|
+
const { result } = renderTestHook(mixedStatusToolCalls);
|
|
1245
|
+
await act(async () => {
|
|
1246
|
+
await result.current.handleApprovalModeChange(ApprovalMode.YOLO);
|
|
1247
|
+
});
|
|
1248
|
+
// Only the awaiting_approval tool should be processed
|
|
1249
|
+
expect(mockOnConfirmAwaiting).toHaveBeenCalledTimes(1);
|
|
1250
|
+
expect(mockOnConfirmExecuting).not.toHaveBeenCalled();
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
describe('handleFinishedEvent', () => {
|
|
1254
|
+
it('should add info message for MAX_TOKENS finish reason', async () => {
|
|
1255
|
+
// Setup mock to return a stream with MAX_TOKENS finish reason
|
|
1256
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1257
|
+
yield {
|
|
1258
|
+
type: ServerGeminiEventType.Content,
|
|
1259
|
+
value: 'This is a truncated response...',
|
|
1260
|
+
};
|
|
1261
|
+
yield {
|
|
1262
|
+
type: ServerGeminiEventType.Finished,
|
|
1263
|
+
value: { reason: 'MAX_TOKENS', usageMetadata: undefined },
|
|
1264
|
+
};
|
|
1265
|
+
})());
|
|
1266
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
1267
|
+
// Submit a query
|
|
1268
|
+
await act(async () => {
|
|
1269
|
+
await result.current.submitQuery('Generate long text');
|
|
1270
|
+
});
|
|
1271
|
+
// Check that the info message was added
|
|
1272
|
+
await waitFor(() => {
|
|
1273
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1274
|
+
type: 'info',
|
|
1275
|
+
text: '⚠️ Response truncated due to token limits.',
|
|
1276
|
+
}, expect.any(Number));
|
|
1277
|
+
});
|
|
1278
|
+
});
|
|
1279
|
+
describe('ContextWindowWillOverflow event', () => {
|
|
1280
|
+
beforeEach(() => {
|
|
1281
|
+
vi.mocked(tokenLimit).mockReturnValue(100);
|
|
1282
|
+
});
|
|
1283
|
+
it.each([
|
|
1284
|
+
{
|
|
1285
|
+
name: 'without suggestion when remaining tokens are > 75% of limit',
|
|
1286
|
+
requestTokens: 20,
|
|
1287
|
+
remainingTokens: 80,
|
|
1288
|
+
expectedMessage: 'Sending this message (20 tokens) might exceed the remaining context window limit (80 tokens).',
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
name: 'with suggestion when remaining tokens are < 75% of limit',
|
|
1292
|
+
requestTokens: 30,
|
|
1293
|
+
remainingTokens: 70,
|
|
1294
|
+
expectedMessage: 'Sending this message (30 tokens) might exceed the remaining context window limit (70 tokens). Please try reducing the size of your message or use the `/compress` command to compress the chat history.',
|
|
1295
|
+
},
|
|
1296
|
+
])('should add message $name', async ({ requestTokens, remainingTokens, expectedMessage }) => {
|
|
1297
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1298
|
+
yield {
|
|
1299
|
+
type: ServerGeminiEventType.ContextWindowWillOverflow,
|
|
1300
|
+
value: {
|
|
1301
|
+
estimatedRequestTokenCount: requestTokens,
|
|
1302
|
+
remainingTokenCount: remainingTokens,
|
|
1303
|
+
},
|
|
1304
|
+
};
|
|
1305
|
+
})());
|
|
1306
|
+
const { result } = renderHookWithDefaults();
|
|
1307
|
+
await act(async () => {
|
|
1308
|
+
await result.current.submitQuery('Test overflow');
|
|
1309
|
+
});
|
|
1310
|
+
await waitFor(() => {
|
|
1311
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1312
|
+
type: 'info',
|
|
1313
|
+
text: expectedMessage,
|
|
1314
|
+
}, expect.any(Number));
|
|
1315
|
+
});
|
|
1316
|
+
});
|
|
1317
|
+
});
|
|
1318
|
+
it('should call onCancelSubmit when ContextWindowWillOverflow event is received', async () => {
|
|
1319
|
+
const onCancelSubmitSpy = vi.fn();
|
|
1320
|
+
// Setup mock to return a stream with ContextWindowWillOverflow event
|
|
1321
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1322
|
+
yield {
|
|
1323
|
+
type: ServerGeminiEventType.ContextWindowWillOverflow,
|
|
1324
|
+
value: {
|
|
1325
|
+
estimatedRequestTokenCount: 100,
|
|
1326
|
+
remainingTokenCount: 50,
|
|
1327
|
+
},
|
|
1328
|
+
};
|
|
1329
|
+
})());
|
|
1330
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, onCancelSubmitSpy, () => { }, 80, 24));
|
|
1331
|
+
// Submit a query
|
|
1332
|
+
await act(async () => {
|
|
1333
|
+
await result.current.submitQuery('Test overflow');
|
|
1334
|
+
});
|
|
1335
|
+
// Check that onCancelSubmit was called
|
|
1336
|
+
await waitFor(() => {
|
|
1337
|
+
expect(onCancelSubmitSpy).toHaveBeenCalledWith(true);
|
|
1338
|
+
});
|
|
1339
|
+
});
|
|
1340
|
+
it.each([
|
|
1341
|
+
{
|
|
1342
|
+
reason: 'STOP',
|
|
1343
|
+
shouldAddMessage: false,
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
reason: 'FINISH_REASON_UNSPECIFIED',
|
|
1347
|
+
shouldAddMessage: false,
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
reason: 'SAFETY',
|
|
1351
|
+
message: '⚠️ Response stopped due to safety reasons.',
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
reason: 'RECITATION',
|
|
1355
|
+
message: '⚠️ Response stopped due to recitation policy.',
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
reason: 'LANGUAGE',
|
|
1359
|
+
message: '⚠️ Response stopped due to unsupported language.',
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
reason: 'BLOCKLIST',
|
|
1363
|
+
message: '⚠️ Response stopped due to forbidden terms.',
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
reason: 'PROHIBITED_CONTENT',
|
|
1367
|
+
message: '⚠️ Response stopped due to prohibited content.',
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
reason: 'SPII',
|
|
1371
|
+
message: '⚠️ Response stopped due to sensitive personally identifiable information.',
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
reason: 'OTHER',
|
|
1375
|
+
message: '⚠️ Response stopped for other reasons.',
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
reason: 'MALFORMED_FUNCTION_CALL',
|
|
1379
|
+
message: '⚠️ Response stopped due to malformed function call.',
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
reason: 'IMAGE_SAFETY',
|
|
1383
|
+
message: '⚠️ Response stopped due to image safety violations.',
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
reason: 'UNEXPECTED_TOOL_CALL',
|
|
1387
|
+
message: '⚠️ Response stopped due to unexpected tool call.',
|
|
1388
|
+
},
|
|
1389
|
+
])('should handle $reason finish reason correctly', async ({ reason, shouldAddMessage = true, message }) => {
|
|
1390
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1391
|
+
yield {
|
|
1392
|
+
type: ServerGeminiEventType.Content,
|
|
1393
|
+
value: `Response for ${reason}`,
|
|
1394
|
+
};
|
|
1395
|
+
yield {
|
|
1396
|
+
type: ServerGeminiEventType.Finished,
|
|
1397
|
+
value: { reason, usageMetadata: undefined },
|
|
1398
|
+
};
|
|
1399
|
+
})());
|
|
1400
|
+
const { result } = renderHookWithDefaults();
|
|
1401
|
+
await act(async () => {
|
|
1402
|
+
await result.current.submitQuery(`Test ${reason}`);
|
|
1403
|
+
});
|
|
1404
|
+
if (shouldAddMessage) {
|
|
1405
|
+
await waitFor(() => {
|
|
1406
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1407
|
+
type: 'info',
|
|
1408
|
+
text: message,
|
|
1409
|
+
}, expect.any(Number));
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
else {
|
|
1413
|
+
// Verify state returns to idle without any info messages
|
|
1414
|
+
await waitFor(() => {
|
|
1415
|
+
expect(result.current.streamingState).toBe(StreamingState.Idle);
|
|
1416
|
+
});
|
|
1417
|
+
const infoMessages = mockAddItem.mock.calls.filter((call) => call[0].type === 'info');
|
|
1418
|
+
expect(infoMessages).toHaveLength(0);
|
|
1419
|
+
}
|
|
1420
|
+
});
|
|
1421
|
+
});
|
|
1422
|
+
it('should process @include commands, adding user turn after processing to prevent race conditions', async () => {
|
|
1423
|
+
const rawQuery = '@include file.txt Summarize this.';
|
|
1424
|
+
const processedQueryParts = [
|
|
1425
|
+
{ text: 'Summarize this with content from @file.txt' },
|
|
1426
|
+
{ text: 'File content...' },
|
|
1427
|
+
];
|
|
1428
|
+
const userMessageTimestamp = Date.now();
|
|
1429
|
+
vi.spyOn(Date, 'now').mockReturnValue(userMessageTimestamp);
|
|
1430
|
+
handleAtCommandSpy.mockResolvedValue({
|
|
1431
|
+
processedQuery: processedQueryParts,
|
|
1432
|
+
shouldProceed: true,
|
|
1433
|
+
});
|
|
1434
|
+
const { result } = renderHook(() => useGeminiStream(mockConfig.getGeminiClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, // shellModeActive
|
|
1435
|
+
vi.fn(), // getPreferredEditor
|
|
1436
|
+
vi.fn(), // onAuthError
|
|
1437
|
+
vi.fn(), // performMemoryRefresh
|
|
1438
|
+
false, // modelSwitched
|
|
1439
|
+
vi.fn(), // setModelSwitched
|
|
1440
|
+
vi.fn(), // onCancelSubmit
|
|
1441
|
+
vi.fn(), // setShellInputFocused
|
|
1442
|
+
80, // terminalWidth
|
|
1443
|
+
24));
|
|
1444
|
+
await act(async () => {
|
|
1445
|
+
await result.current.submitQuery(rawQuery);
|
|
1446
|
+
});
|
|
1447
|
+
expect(handleAtCommandSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
1448
|
+
query: rawQuery,
|
|
1449
|
+
}));
|
|
1450
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1451
|
+
type: MessageType.USER,
|
|
1452
|
+
text: rawQuery,
|
|
1453
|
+
}, userMessageTimestamp);
|
|
1454
|
+
// FIX: The expectation now matches the actual call signature.
|
|
1455
|
+
expect(mockSendMessageStream).toHaveBeenCalledWith(processedQueryParts, // Argument 1: The parts array directly
|
|
1456
|
+
expect.any(AbortSignal), // Argument 2: An AbortSignal
|
|
1457
|
+
expect.any(String));
|
|
1458
|
+
});
|
|
1459
|
+
describe('Thought Reset', () => {
|
|
1460
|
+
it('should reset thought to null when starting a new prompt', async () => {
|
|
1461
|
+
// First, simulate a response with a thought
|
|
1462
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1463
|
+
yield {
|
|
1464
|
+
type: ServerGeminiEventType.Thought,
|
|
1465
|
+
value: {
|
|
1466
|
+
subject: 'Previous thought',
|
|
1467
|
+
description: 'Old description',
|
|
1468
|
+
},
|
|
1469
|
+
};
|
|
1470
|
+
yield {
|
|
1471
|
+
type: ServerGeminiEventType.Content,
|
|
1472
|
+
value: 'Some response content',
|
|
1473
|
+
};
|
|
1474
|
+
yield {
|
|
1475
|
+
type: ServerGeminiEventType.Finished,
|
|
1476
|
+
value: { reason: 'STOP', usageMetadata: undefined },
|
|
1477
|
+
};
|
|
1478
|
+
})());
|
|
1479
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
1480
|
+
// Submit first query to set a thought
|
|
1481
|
+
await act(async () => {
|
|
1482
|
+
await result.current.submitQuery('First query');
|
|
1483
|
+
});
|
|
1484
|
+
// Wait for the first response to complete
|
|
1485
|
+
await waitFor(() => {
|
|
1486
|
+
expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
1487
|
+
type: 'gemini',
|
|
1488
|
+
text: 'Some response content',
|
|
1489
|
+
}), expect.any(Number));
|
|
1490
|
+
});
|
|
1491
|
+
// Now simulate a new response without a thought
|
|
1492
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1493
|
+
yield {
|
|
1494
|
+
type: ServerGeminiEventType.Content,
|
|
1495
|
+
value: 'New response content',
|
|
1496
|
+
};
|
|
1497
|
+
yield {
|
|
1498
|
+
type: ServerGeminiEventType.Finished,
|
|
1499
|
+
value: { reason: 'STOP', usageMetadata: undefined },
|
|
1500
|
+
};
|
|
1501
|
+
})());
|
|
1502
|
+
// Submit second query - thought should be reset
|
|
1503
|
+
await act(async () => {
|
|
1504
|
+
await result.current.submitQuery('Second query');
|
|
1505
|
+
});
|
|
1506
|
+
// The thought should be reset to null when starting the new prompt
|
|
1507
|
+
// We can verify this by checking that the LoadingIndicator would not show the previous thought
|
|
1508
|
+
// The actual thought state is internal to the hook, but we can verify the behavior
|
|
1509
|
+
// by ensuring the second response doesn't show the previous thought
|
|
1510
|
+
await waitFor(() => {
|
|
1511
|
+
expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
1512
|
+
type: 'gemini',
|
|
1513
|
+
text: 'New response content',
|
|
1514
|
+
}), expect.any(Number));
|
|
1515
|
+
});
|
|
1516
|
+
});
|
|
1517
|
+
it('should memoize pendingHistoryItems', () => {
|
|
1518
|
+
mockUseReactToolScheduler.mockReturnValue([
|
|
1519
|
+
[],
|
|
1520
|
+
mockScheduleToolCalls,
|
|
1521
|
+
mockCancelAllToolCalls,
|
|
1522
|
+
mockMarkToolsAsSubmitted,
|
|
1523
|
+
]);
|
|
1524
|
+
const { result, rerender } = renderHook(() => useGeminiStream(mockConfig.getGeminiClient(), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
1525
|
+
const firstResult = result.current.pendingHistoryItems;
|
|
1526
|
+
rerender();
|
|
1527
|
+
const secondResult = result.current.pendingHistoryItems;
|
|
1528
|
+
expect(firstResult).toStrictEqual(secondResult);
|
|
1529
|
+
const newToolCalls = [
|
|
1530
|
+
{
|
|
1531
|
+
request: { callId: 'call1', name: 'tool1', args: {} },
|
|
1532
|
+
status: 'executing',
|
|
1533
|
+
tool: {
|
|
1534
|
+
name: 'tool1',
|
|
1535
|
+
displayName: 'tool1',
|
|
1536
|
+
description: 'desc1',
|
|
1537
|
+
build: vi.fn(),
|
|
1538
|
+
},
|
|
1539
|
+
invocation: {
|
|
1540
|
+
getDescription: () => 'Mock description',
|
|
1541
|
+
},
|
|
1542
|
+
},
|
|
1543
|
+
];
|
|
1544
|
+
mockUseReactToolScheduler.mockReturnValue([
|
|
1545
|
+
newToolCalls,
|
|
1546
|
+
mockScheduleToolCalls,
|
|
1547
|
+
mockCancelAllToolCalls,
|
|
1548
|
+
mockMarkToolsAsSubmitted,
|
|
1549
|
+
]);
|
|
1550
|
+
rerender();
|
|
1551
|
+
const thirdResult = result.current.pendingHistoryItems;
|
|
1552
|
+
expect(thirdResult).not.toStrictEqual(secondResult);
|
|
1553
|
+
});
|
|
1554
|
+
it('should reset thought to null when user cancels', async () => {
|
|
1555
|
+
// Mock a stream that yields a thought then gets cancelled
|
|
1556
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1557
|
+
yield {
|
|
1558
|
+
type: ServerGeminiEventType.Thought,
|
|
1559
|
+
value: { subject: 'Some thought', description: 'Description' },
|
|
1560
|
+
};
|
|
1561
|
+
yield { type: ServerGeminiEventType.UserCancelled };
|
|
1562
|
+
})());
|
|
1563
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
1564
|
+
// Submit query
|
|
1565
|
+
await act(async () => {
|
|
1566
|
+
await result.current.submitQuery('Test query');
|
|
1567
|
+
});
|
|
1568
|
+
// Verify cancellation message was added
|
|
1569
|
+
await waitFor(() => {
|
|
1570
|
+
expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
1571
|
+
type: 'info',
|
|
1572
|
+
text: 'User cancelled the request.',
|
|
1573
|
+
}), expect.any(Number));
|
|
1574
|
+
});
|
|
1575
|
+
// Verify state is reset to idle
|
|
1576
|
+
expect(result.current.streamingState).toBe(StreamingState.Idle);
|
|
1577
|
+
});
|
|
1578
|
+
it('should reset thought to null when there is an error', async () => {
|
|
1579
|
+
// Mock a stream that yields a thought then encounters an error
|
|
1580
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1581
|
+
yield {
|
|
1582
|
+
type: ServerGeminiEventType.Thought,
|
|
1583
|
+
value: { subject: 'Some thought', description: 'Description' },
|
|
1584
|
+
};
|
|
1585
|
+
yield {
|
|
1586
|
+
type: ServerGeminiEventType.Error,
|
|
1587
|
+
value: { error: { message: 'Test error' } },
|
|
1588
|
+
};
|
|
1589
|
+
})());
|
|
1590
|
+
const { result } = renderHook(() => useGeminiStream(new MockedGeminiClientClass(mockConfig), [], mockAddItem, mockConfig, mockLoadedSettings, mockOnDebugMessage, mockHandleSlashCommand, false, () => 'vscode', () => { }, () => Promise.resolve(), false, () => { }, () => { }, () => { }, 80, 24));
|
|
1591
|
+
// Submit query
|
|
1592
|
+
await act(async () => {
|
|
1593
|
+
await result.current.submitQuery('Test query');
|
|
1594
|
+
});
|
|
1595
|
+
// Verify error message was added
|
|
1596
|
+
await waitFor(() => {
|
|
1597
|
+
expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
1598
|
+
type: 'error',
|
|
1599
|
+
}), expect.any(Number));
|
|
1600
|
+
});
|
|
1601
|
+
// Verify parseAndFormatApiError was called
|
|
1602
|
+
expect(mockParseAndFormatApiError).toHaveBeenCalledWith({ message: 'Test error' }, expect.any(String), undefined, 'gemini-2.5-pro', 'gemini-2.5-flash');
|
|
1603
|
+
});
|
|
1604
|
+
});
|
|
1605
|
+
describe('Loop Detection Confirmation', () => {
|
|
1606
|
+
beforeEach(() => {
|
|
1607
|
+
// Add mock for getLoopDetectionService to the config
|
|
1608
|
+
const mockLoopDetectionService = {
|
|
1609
|
+
disableForSession: vi.fn(),
|
|
1610
|
+
};
|
|
1611
|
+
mockConfig.getGeminiClient = vi.fn().mockReturnValue({
|
|
1612
|
+
...new MockedGeminiClientClass(mockConfig),
|
|
1613
|
+
getLoopDetectionService: () => mockLoopDetectionService,
|
|
1614
|
+
});
|
|
1615
|
+
});
|
|
1616
|
+
it('should set loopDetectionConfirmationRequest when LoopDetected event is received', async () => {
|
|
1617
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1618
|
+
yield {
|
|
1619
|
+
type: ServerGeminiEventType.Content,
|
|
1620
|
+
value: 'Some content',
|
|
1621
|
+
};
|
|
1622
|
+
yield {
|
|
1623
|
+
type: ServerGeminiEventType.LoopDetected,
|
|
1624
|
+
};
|
|
1625
|
+
})());
|
|
1626
|
+
const { result } = renderTestHook();
|
|
1627
|
+
await act(async () => {
|
|
1628
|
+
await result.current.submitQuery('test query');
|
|
1629
|
+
});
|
|
1630
|
+
await waitFor(() => {
|
|
1631
|
+
expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
|
|
1632
|
+
expect(typeof result.current.loopDetectionConfirmationRequest?.onComplete).toBe('function');
|
|
1633
|
+
});
|
|
1634
|
+
});
|
|
1635
|
+
it('should disable loop detection and show message when user selects "disable"', async () => {
|
|
1636
|
+
const mockLoopDetectionService = {
|
|
1637
|
+
disableForSession: vi.fn(),
|
|
1638
|
+
};
|
|
1639
|
+
const mockClient = {
|
|
1640
|
+
...new MockedGeminiClientClass(mockConfig),
|
|
1641
|
+
getLoopDetectionService: () => mockLoopDetectionService,
|
|
1642
|
+
};
|
|
1643
|
+
mockConfig.getGeminiClient = vi.fn().mockReturnValue(mockClient);
|
|
1644
|
+
// Mock for the initial request
|
|
1645
|
+
mockSendMessageStream.mockReturnValueOnce((async function* () {
|
|
1646
|
+
yield {
|
|
1647
|
+
type: ServerGeminiEventType.LoopDetected,
|
|
1648
|
+
};
|
|
1649
|
+
})());
|
|
1650
|
+
// Mock for the retry request
|
|
1651
|
+
mockSendMessageStream.mockReturnValueOnce((async function* () {
|
|
1652
|
+
yield {
|
|
1653
|
+
type: ServerGeminiEventType.Content,
|
|
1654
|
+
value: 'Retry successful',
|
|
1655
|
+
};
|
|
1656
|
+
yield {
|
|
1657
|
+
type: ServerGeminiEventType.Finished,
|
|
1658
|
+
value: { reason: 'STOP' },
|
|
1659
|
+
};
|
|
1660
|
+
})());
|
|
1661
|
+
const { result } = renderTestHook();
|
|
1662
|
+
await act(async () => {
|
|
1663
|
+
await result.current.submitQuery('test query');
|
|
1664
|
+
});
|
|
1665
|
+
// Wait for confirmation request to be set
|
|
1666
|
+
await waitFor(() => {
|
|
1667
|
+
expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
|
|
1668
|
+
});
|
|
1669
|
+
// Simulate user selecting "disable"
|
|
1670
|
+
await act(async () => {
|
|
1671
|
+
result.current.loopDetectionConfirmationRequest?.onComplete({
|
|
1672
|
+
userSelection: 'disable',
|
|
1673
|
+
});
|
|
1674
|
+
});
|
|
1675
|
+
// Verify loop detection was disabled
|
|
1676
|
+
expect(mockLoopDetectionService.disableForSession).toHaveBeenCalledTimes(1);
|
|
1677
|
+
// Verify confirmation request was cleared
|
|
1678
|
+
expect(result.current.loopDetectionConfirmationRequest).toBeNull();
|
|
1679
|
+
// Verify appropriate message was added
|
|
1680
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1681
|
+
type: 'info',
|
|
1682
|
+
text: 'Loop detection has been disabled for this session. Retrying request...',
|
|
1683
|
+
}, expect.any(Number));
|
|
1684
|
+
// Verify that the request was retried
|
|
1685
|
+
await waitFor(() => {
|
|
1686
|
+
expect(mockSendMessageStream).toHaveBeenCalledTimes(2);
|
|
1687
|
+
expect(mockSendMessageStream).toHaveBeenNthCalledWith(2, 'test query', expect.any(AbortSignal), expect.any(String));
|
|
1688
|
+
});
|
|
1689
|
+
});
|
|
1690
|
+
it('should keep loop detection enabled and show message when user selects "keep"', async () => {
|
|
1691
|
+
const mockLoopDetectionService = {
|
|
1692
|
+
disableForSession: vi.fn(),
|
|
1693
|
+
};
|
|
1694
|
+
const mockClient = {
|
|
1695
|
+
...new MockedGeminiClientClass(mockConfig),
|
|
1696
|
+
getLoopDetectionService: () => mockLoopDetectionService,
|
|
1697
|
+
};
|
|
1698
|
+
mockConfig.getGeminiClient = vi.fn().mockReturnValue(mockClient);
|
|
1699
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1700
|
+
yield {
|
|
1701
|
+
type: ServerGeminiEventType.LoopDetected,
|
|
1702
|
+
};
|
|
1703
|
+
})());
|
|
1704
|
+
const { result } = renderTestHook();
|
|
1705
|
+
await act(async () => {
|
|
1706
|
+
await result.current.submitQuery('test query');
|
|
1707
|
+
});
|
|
1708
|
+
// Wait for confirmation request to be set
|
|
1709
|
+
await waitFor(() => {
|
|
1710
|
+
expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
|
|
1711
|
+
});
|
|
1712
|
+
// Simulate user selecting "keep"
|
|
1713
|
+
await act(async () => {
|
|
1714
|
+
result.current.loopDetectionConfirmationRequest?.onComplete({
|
|
1715
|
+
userSelection: 'keep',
|
|
1716
|
+
});
|
|
1717
|
+
});
|
|
1718
|
+
// Verify loop detection was NOT disabled
|
|
1719
|
+
expect(mockLoopDetectionService.disableForSession).not.toHaveBeenCalled();
|
|
1720
|
+
// Verify confirmation request was cleared
|
|
1721
|
+
expect(result.current.loopDetectionConfirmationRequest).toBeNull();
|
|
1722
|
+
// Verify appropriate message was added
|
|
1723
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1724
|
+
type: 'info',
|
|
1725
|
+
text: 'A potential loop was detected. This can happen due to repetitive tool calls or other model behavior. The request has been halted.',
|
|
1726
|
+
}, expect.any(Number));
|
|
1727
|
+
// Verify that the request was NOT retried
|
|
1728
|
+
expect(mockSendMessageStream).toHaveBeenCalledTimes(1);
|
|
1729
|
+
});
|
|
1730
|
+
it('should handle multiple loop detection events properly', async () => {
|
|
1731
|
+
const { result } = renderTestHook();
|
|
1732
|
+
// First loop detection - set up fresh mock for first call
|
|
1733
|
+
mockSendMessageStream.mockReturnValueOnce((async function* () {
|
|
1734
|
+
yield {
|
|
1735
|
+
type: ServerGeminiEventType.LoopDetected,
|
|
1736
|
+
};
|
|
1737
|
+
})());
|
|
1738
|
+
// First loop detection
|
|
1739
|
+
await act(async () => {
|
|
1740
|
+
await result.current.submitQuery('first query');
|
|
1741
|
+
});
|
|
1742
|
+
await waitFor(() => {
|
|
1743
|
+
expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
|
|
1744
|
+
});
|
|
1745
|
+
// Simulate user selecting "keep" for first request
|
|
1746
|
+
await act(async () => {
|
|
1747
|
+
result.current.loopDetectionConfirmationRequest?.onComplete({
|
|
1748
|
+
userSelection: 'keep',
|
|
1749
|
+
});
|
|
1750
|
+
});
|
|
1751
|
+
expect(result.current.loopDetectionConfirmationRequest).toBeNull();
|
|
1752
|
+
// Verify first message was added
|
|
1753
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1754
|
+
type: 'info',
|
|
1755
|
+
text: 'A potential loop was detected. This can happen due to repetitive tool calls or other model behavior. The request has been halted.',
|
|
1756
|
+
}, expect.any(Number));
|
|
1757
|
+
// Second loop detection - set up fresh mock for second call
|
|
1758
|
+
mockSendMessageStream.mockReturnValueOnce((async function* () {
|
|
1759
|
+
yield {
|
|
1760
|
+
type: ServerGeminiEventType.LoopDetected,
|
|
1761
|
+
};
|
|
1762
|
+
})());
|
|
1763
|
+
// Mock for the retry request
|
|
1764
|
+
mockSendMessageStream.mockReturnValueOnce((async function* () {
|
|
1765
|
+
yield {
|
|
1766
|
+
type: ServerGeminiEventType.Content,
|
|
1767
|
+
value: 'Retry successful',
|
|
1768
|
+
};
|
|
1769
|
+
yield {
|
|
1770
|
+
type: ServerGeminiEventType.Finished,
|
|
1771
|
+
value: { reason: 'STOP' },
|
|
1772
|
+
};
|
|
1773
|
+
})());
|
|
1774
|
+
// Second loop detection
|
|
1775
|
+
await act(async () => {
|
|
1776
|
+
await result.current.submitQuery('second query');
|
|
1777
|
+
});
|
|
1778
|
+
await waitFor(() => {
|
|
1779
|
+
expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
|
|
1780
|
+
});
|
|
1781
|
+
// Simulate user selecting "disable" for second request
|
|
1782
|
+
await act(async () => {
|
|
1783
|
+
result.current.loopDetectionConfirmationRequest?.onComplete({
|
|
1784
|
+
userSelection: 'disable',
|
|
1785
|
+
});
|
|
1786
|
+
});
|
|
1787
|
+
expect(result.current.loopDetectionConfirmationRequest).toBeNull();
|
|
1788
|
+
// Verify second message was added
|
|
1789
|
+
expect(mockAddItem).toHaveBeenCalledWith({
|
|
1790
|
+
type: 'info',
|
|
1791
|
+
text: 'Loop detection has been disabled for this session. Retrying request...',
|
|
1792
|
+
}, expect.any(Number));
|
|
1793
|
+
// Verify that the request was retried
|
|
1794
|
+
await waitFor(() => {
|
|
1795
|
+
expect(mockSendMessageStream).toHaveBeenCalledTimes(3); // 1st query, 2nd query, retry of 2nd query
|
|
1796
|
+
expect(mockSendMessageStream).toHaveBeenNthCalledWith(3, 'second query', expect.any(AbortSignal), expect.any(String));
|
|
1797
|
+
});
|
|
1798
|
+
});
|
|
1799
|
+
it('should process LoopDetected event after moving pending history to history', async () => {
|
|
1800
|
+
mockSendMessageStream.mockReturnValue((async function* () {
|
|
1801
|
+
yield {
|
|
1802
|
+
type: ServerGeminiEventType.Content,
|
|
1803
|
+
value: 'Some response content',
|
|
1804
|
+
};
|
|
1805
|
+
yield {
|
|
1806
|
+
type: ServerGeminiEventType.LoopDetected,
|
|
1807
|
+
};
|
|
1808
|
+
})());
|
|
1809
|
+
const { result } = renderTestHook();
|
|
1810
|
+
await act(async () => {
|
|
1811
|
+
await result.current.submitQuery('test query');
|
|
1812
|
+
});
|
|
1813
|
+
// Verify that the content was added to history before the loop detection dialog
|
|
1814
|
+
await waitFor(() => {
|
|
1815
|
+
expect(mockAddItem).toHaveBeenCalledWith(expect.objectContaining({
|
|
1816
|
+
type: 'gemini',
|
|
1817
|
+
text: 'Some response content',
|
|
1818
|
+
}), expect.any(Number));
|
|
1819
|
+
});
|
|
1820
|
+
// Then verify loop detection confirmation request was set
|
|
1821
|
+
await waitFor(() => {
|
|
1822
|
+
expect(result.current.loopDetectionConfirmationRequest).not.toBeNull();
|
|
1823
|
+
});
|
|
1824
|
+
});
|
|
1825
|
+
});
|
|
1826
|
+
});
|
|
1827
|
+
//# sourceMappingURL=useGeminiStream.test.js.map
|