@zgsm/costrict-cli 0.21.0-nightly.20251213.977248e09
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,1916 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
7
|
+
import stripAnsi from 'strip-ansi';
|
|
8
|
+
import { act } from 'react';
|
|
9
|
+
import { renderHook } from '../../../test-utils/render.js';
|
|
10
|
+
import { useTextBuffer, offsetToLogicalPos, logicalPosToOffset, textBufferReducer, findWordEndInLine, findNextWordStartInLine, isWordCharStrict, } from './text-buffer.js';
|
|
11
|
+
import { cpLen } from '../../utils/textUtils.js';
|
|
12
|
+
const defaultVisualLayout = {
|
|
13
|
+
visualLines: [''],
|
|
14
|
+
logicalToVisualMap: [[[0, 0]]],
|
|
15
|
+
visualToLogicalMap: [[0, 0]],
|
|
16
|
+
};
|
|
17
|
+
const initialState = {
|
|
18
|
+
lines: [''],
|
|
19
|
+
cursorRow: 0,
|
|
20
|
+
cursorCol: 0,
|
|
21
|
+
preferredCol: null,
|
|
22
|
+
undoStack: [],
|
|
23
|
+
redoStack: [],
|
|
24
|
+
clipboard: null,
|
|
25
|
+
selectionAnchor: null,
|
|
26
|
+
viewportWidth: 80,
|
|
27
|
+
viewportHeight: 24,
|
|
28
|
+
visualLayout: defaultVisualLayout,
|
|
29
|
+
};
|
|
30
|
+
describe('textBufferReducer', () => {
|
|
31
|
+
it('should return the initial state if state is undefined', () => {
|
|
32
|
+
const action = { type: 'unknown_action' };
|
|
33
|
+
const state = textBufferReducer(initialState, action);
|
|
34
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
35
|
+
expect(state).toEqual(initialState);
|
|
36
|
+
});
|
|
37
|
+
describe('set_text action', () => {
|
|
38
|
+
it('should set new text and move cursor to the end', () => {
|
|
39
|
+
const action = {
|
|
40
|
+
type: 'set_text',
|
|
41
|
+
payload: 'hello\nworld',
|
|
42
|
+
};
|
|
43
|
+
const state = textBufferReducer(initialState, action);
|
|
44
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
45
|
+
expect(state.lines).toEqual(['hello', 'world']);
|
|
46
|
+
expect(state.cursorRow).toBe(1);
|
|
47
|
+
expect(state.cursorCol).toBe(5);
|
|
48
|
+
expect(state.undoStack.length).toBe(1);
|
|
49
|
+
});
|
|
50
|
+
it('should not create an undo snapshot if pushToUndo is false', () => {
|
|
51
|
+
const action = {
|
|
52
|
+
type: 'set_text',
|
|
53
|
+
payload: 'no undo',
|
|
54
|
+
pushToUndo: false,
|
|
55
|
+
};
|
|
56
|
+
const state = textBufferReducer(initialState, action);
|
|
57
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
58
|
+
expect(state.lines).toEqual(['no undo']);
|
|
59
|
+
expect(state.undoStack.length).toBe(0);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('insert action', () => {
|
|
63
|
+
it('should insert a character', () => {
|
|
64
|
+
const action = { type: 'insert', payload: 'a' };
|
|
65
|
+
const state = textBufferReducer(initialState, action);
|
|
66
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
67
|
+
expect(state.lines).toEqual(['a']);
|
|
68
|
+
expect(state.cursorCol).toBe(1);
|
|
69
|
+
});
|
|
70
|
+
it('should insert a newline', () => {
|
|
71
|
+
const stateWithText = { ...initialState, lines: ['hello'] };
|
|
72
|
+
const action = { type: 'insert', payload: '\n' };
|
|
73
|
+
const state = textBufferReducer(stateWithText, action);
|
|
74
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
75
|
+
expect(state.lines).toEqual(['', 'hello']);
|
|
76
|
+
expect(state.cursorRow).toBe(1);
|
|
77
|
+
expect(state.cursorCol).toBe(0);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
describe('insert action with options', () => {
|
|
81
|
+
it('should filter input using inputFilter option', () => {
|
|
82
|
+
const action = { type: 'insert', payload: 'a1b2c3' };
|
|
83
|
+
const options = {
|
|
84
|
+
inputFilter: (text) => text.replace(/[0-9]/g, ''),
|
|
85
|
+
};
|
|
86
|
+
const state = textBufferReducer(initialState, action, options);
|
|
87
|
+
expect(state.lines).toEqual(['abc']);
|
|
88
|
+
expect(state.cursorCol).toBe(3);
|
|
89
|
+
});
|
|
90
|
+
it('should strip newlines when singleLine option is true', () => {
|
|
91
|
+
const action = {
|
|
92
|
+
type: 'insert',
|
|
93
|
+
payload: 'hello\nworld',
|
|
94
|
+
};
|
|
95
|
+
const options = { singleLine: true };
|
|
96
|
+
const state = textBufferReducer(initialState, action, options);
|
|
97
|
+
expect(state.lines).toEqual(['helloworld']);
|
|
98
|
+
expect(state.cursorCol).toBe(10);
|
|
99
|
+
});
|
|
100
|
+
it('should apply both inputFilter and singleLine options', () => {
|
|
101
|
+
const action = {
|
|
102
|
+
type: 'insert',
|
|
103
|
+
payload: 'h\ne\nl\nl\no\n1\n2\n3',
|
|
104
|
+
};
|
|
105
|
+
const options = {
|
|
106
|
+
singleLine: true,
|
|
107
|
+
inputFilter: (text) => text.replace(/[0-9]/g, ''),
|
|
108
|
+
};
|
|
109
|
+
const state = textBufferReducer(initialState, action, options);
|
|
110
|
+
expect(state.lines).toEqual(['hello']);
|
|
111
|
+
expect(state.cursorCol).toBe(5);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
describe('backspace action', () => {
|
|
115
|
+
it('should remove a character', () => {
|
|
116
|
+
const stateWithText = {
|
|
117
|
+
...initialState,
|
|
118
|
+
lines: ['a'],
|
|
119
|
+
cursorRow: 0,
|
|
120
|
+
cursorCol: 1,
|
|
121
|
+
};
|
|
122
|
+
const action = { type: 'backspace' };
|
|
123
|
+
const state = textBufferReducer(stateWithText, action);
|
|
124
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
125
|
+
expect(state.lines).toEqual(['']);
|
|
126
|
+
expect(state.cursorCol).toBe(0);
|
|
127
|
+
});
|
|
128
|
+
it('should join lines if at the beginning of a line', () => {
|
|
129
|
+
const stateWithText = {
|
|
130
|
+
...initialState,
|
|
131
|
+
lines: ['hello', 'world'],
|
|
132
|
+
cursorRow: 1,
|
|
133
|
+
cursorCol: 0,
|
|
134
|
+
};
|
|
135
|
+
const action = { type: 'backspace' };
|
|
136
|
+
const state = textBufferReducer(stateWithText, action);
|
|
137
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
138
|
+
expect(state.lines).toEqual(['helloworld']);
|
|
139
|
+
expect(state.cursorRow).toBe(0);
|
|
140
|
+
expect(state.cursorCol).toBe(5);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
describe('undo/redo actions', () => {
|
|
144
|
+
it('should undo and redo a change', () => {
|
|
145
|
+
// 1. Insert text
|
|
146
|
+
const insertAction = {
|
|
147
|
+
type: 'insert',
|
|
148
|
+
payload: 'test',
|
|
149
|
+
};
|
|
150
|
+
const stateAfterInsert = textBufferReducer(initialState, insertAction);
|
|
151
|
+
expect(stateAfterInsert).toHaveOnlyValidCharacters();
|
|
152
|
+
expect(stateAfterInsert.lines).toEqual(['test']);
|
|
153
|
+
expect(stateAfterInsert.undoStack.length).toBe(1);
|
|
154
|
+
// 2. Undo
|
|
155
|
+
const undoAction = { type: 'undo' };
|
|
156
|
+
const stateAfterUndo = textBufferReducer(stateAfterInsert, undoAction);
|
|
157
|
+
expect(stateAfterUndo).toHaveOnlyValidCharacters();
|
|
158
|
+
expect(stateAfterUndo.lines).toEqual(['']);
|
|
159
|
+
expect(stateAfterUndo.undoStack.length).toBe(0);
|
|
160
|
+
expect(stateAfterUndo.redoStack.length).toBe(1);
|
|
161
|
+
// 3. Redo
|
|
162
|
+
const redoAction = { type: 'redo' };
|
|
163
|
+
const stateAfterRedo = textBufferReducer(stateAfterUndo, redoAction);
|
|
164
|
+
expect(stateAfterRedo).toHaveOnlyValidCharacters();
|
|
165
|
+
expect(stateAfterRedo.lines).toEqual(['test']);
|
|
166
|
+
expect(stateAfterRedo.undoStack.length).toBe(1);
|
|
167
|
+
expect(stateAfterRedo.redoStack.length).toBe(0);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
describe('create_undo_snapshot action', () => {
|
|
171
|
+
it('should create a snapshot without changing state', () => {
|
|
172
|
+
const stateWithText = {
|
|
173
|
+
...initialState,
|
|
174
|
+
lines: ['hello'],
|
|
175
|
+
cursorRow: 0,
|
|
176
|
+
cursorCol: 5,
|
|
177
|
+
};
|
|
178
|
+
const action = { type: 'create_undo_snapshot' };
|
|
179
|
+
const state = textBufferReducer(stateWithText, action);
|
|
180
|
+
expect(state).toHaveOnlyValidCharacters();
|
|
181
|
+
expect(state.lines).toEqual(['hello']);
|
|
182
|
+
expect(state.cursorRow).toBe(0);
|
|
183
|
+
expect(state.cursorCol).toBe(5);
|
|
184
|
+
expect(state.undoStack.length).toBe(1);
|
|
185
|
+
expect(state.undoStack[0].lines).toEqual(['hello']);
|
|
186
|
+
expect(state.undoStack[0].cursorRow).toBe(0);
|
|
187
|
+
expect(state.undoStack[0].cursorCol).toBe(5);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
describe('delete_word_left action', () => {
|
|
191
|
+
const createSingleLineState = (text, col) => ({
|
|
192
|
+
...initialState,
|
|
193
|
+
lines: [text],
|
|
194
|
+
cursorRow: 0,
|
|
195
|
+
cursorCol: col,
|
|
196
|
+
});
|
|
197
|
+
it.each([
|
|
198
|
+
{
|
|
199
|
+
input: 'hello world',
|
|
200
|
+
cursorCol: 11,
|
|
201
|
+
expectedLines: ['hello '],
|
|
202
|
+
expectedCol: 6,
|
|
203
|
+
desc: 'simple word',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
input: 'path/to/file',
|
|
207
|
+
cursorCol: 12,
|
|
208
|
+
expectedLines: ['path/to/'],
|
|
209
|
+
expectedCol: 8,
|
|
210
|
+
desc: 'path segment',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
input: 'variable_name',
|
|
214
|
+
cursorCol: 13,
|
|
215
|
+
expectedLines: ['variable_'],
|
|
216
|
+
expectedCol: 9,
|
|
217
|
+
desc: 'variable_name parts',
|
|
218
|
+
},
|
|
219
|
+
])('should delete $desc', ({ input, cursorCol, expectedLines, expectedCol }) => {
|
|
220
|
+
const state = textBufferReducer(createSingleLineState(input, cursorCol), { type: 'delete_word_left' });
|
|
221
|
+
expect(state.lines).toEqual(expectedLines);
|
|
222
|
+
expect(state.cursorCol).toBe(expectedCol);
|
|
223
|
+
});
|
|
224
|
+
it('should act like backspace at the beginning of a line', () => {
|
|
225
|
+
const stateWithText = {
|
|
226
|
+
...initialState,
|
|
227
|
+
lines: ['hello', 'world'],
|
|
228
|
+
cursorRow: 1,
|
|
229
|
+
cursorCol: 0,
|
|
230
|
+
};
|
|
231
|
+
const state = textBufferReducer(stateWithText, {
|
|
232
|
+
type: 'delete_word_left',
|
|
233
|
+
});
|
|
234
|
+
expect(state.lines).toEqual(['helloworld']);
|
|
235
|
+
expect(state.cursorRow).toBe(0);
|
|
236
|
+
expect(state.cursorCol).toBe(5);
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
describe('delete_word_right action', () => {
|
|
240
|
+
const createSingleLineState = (text, col) => ({
|
|
241
|
+
...initialState,
|
|
242
|
+
lines: [text],
|
|
243
|
+
cursorRow: 0,
|
|
244
|
+
cursorCol: col,
|
|
245
|
+
});
|
|
246
|
+
it.each([
|
|
247
|
+
{
|
|
248
|
+
input: 'hello world',
|
|
249
|
+
cursorCol: 0,
|
|
250
|
+
expectedLines: ['world'],
|
|
251
|
+
expectedCol: 0,
|
|
252
|
+
desc: 'simple word',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
input: 'variable_name',
|
|
256
|
+
cursorCol: 0,
|
|
257
|
+
expectedLines: ['_name'],
|
|
258
|
+
expectedCol: 0,
|
|
259
|
+
desc: 'variable_name parts',
|
|
260
|
+
},
|
|
261
|
+
])('should delete $desc', ({ input, cursorCol, expectedLines, expectedCol }) => {
|
|
262
|
+
const state = textBufferReducer(createSingleLineState(input, cursorCol), { type: 'delete_word_right' });
|
|
263
|
+
expect(state.lines).toEqual(expectedLines);
|
|
264
|
+
expect(state.cursorCol).toBe(expectedCol);
|
|
265
|
+
});
|
|
266
|
+
it('should delete path segments progressively', () => {
|
|
267
|
+
const stateWithText = {
|
|
268
|
+
...initialState,
|
|
269
|
+
lines: ['path/to/file'],
|
|
270
|
+
cursorRow: 0,
|
|
271
|
+
cursorCol: 0,
|
|
272
|
+
};
|
|
273
|
+
let state = textBufferReducer(stateWithText, {
|
|
274
|
+
type: 'delete_word_right',
|
|
275
|
+
});
|
|
276
|
+
expect(state.lines).toEqual(['/to/file']);
|
|
277
|
+
state = textBufferReducer(state, { type: 'delete_word_right' });
|
|
278
|
+
expect(state.lines).toEqual(['to/file']);
|
|
279
|
+
});
|
|
280
|
+
it('should act like delete at the end of a line', () => {
|
|
281
|
+
const stateWithText = {
|
|
282
|
+
...initialState,
|
|
283
|
+
lines: ['hello', 'world'],
|
|
284
|
+
cursorRow: 0,
|
|
285
|
+
cursorCol: 5,
|
|
286
|
+
};
|
|
287
|
+
const state = textBufferReducer(stateWithText, {
|
|
288
|
+
type: 'delete_word_right',
|
|
289
|
+
});
|
|
290
|
+
expect(state.lines).toEqual(['helloworld']);
|
|
291
|
+
expect(state.cursorRow).toBe(0);
|
|
292
|
+
expect(state.cursorCol).toBe(5);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
const getBufferState = (result) => {
|
|
297
|
+
expect(result.current).toHaveOnlyValidCharacters();
|
|
298
|
+
return {
|
|
299
|
+
text: result.current.text,
|
|
300
|
+
lines: [...result.current.lines], // Clone for safety
|
|
301
|
+
cursor: [...result.current.cursor],
|
|
302
|
+
allVisualLines: [...result.current.allVisualLines],
|
|
303
|
+
viewportVisualLines: [...result.current.viewportVisualLines],
|
|
304
|
+
visualCursor: [...result.current.visualCursor],
|
|
305
|
+
visualScrollRow: result.current.visualScrollRow,
|
|
306
|
+
preferredCol: result.current.preferredCol,
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
describe('useTextBuffer', () => {
|
|
310
|
+
let viewport;
|
|
311
|
+
beforeEach(() => {
|
|
312
|
+
viewport = { width: 10, height: 3 }; // Default viewport for tests
|
|
313
|
+
});
|
|
314
|
+
describe('Initialization', () => {
|
|
315
|
+
it('should initialize with empty text and cursor at (0,0) by default', () => {
|
|
316
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
317
|
+
const state = getBufferState(result);
|
|
318
|
+
expect(state.text).toBe('');
|
|
319
|
+
expect(state.lines).toEqual(['']);
|
|
320
|
+
expect(state.cursor).toEqual([0, 0]);
|
|
321
|
+
expect(state.allVisualLines).toEqual(['']);
|
|
322
|
+
expect(state.viewportVisualLines).toEqual(['']);
|
|
323
|
+
expect(state.visualCursor).toEqual([0, 0]);
|
|
324
|
+
expect(state.visualScrollRow).toBe(0);
|
|
325
|
+
});
|
|
326
|
+
it('should initialize with provided initialText', () => {
|
|
327
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
328
|
+
initialText: 'hello',
|
|
329
|
+
viewport,
|
|
330
|
+
isValidPath: () => false,
|
|
331
|
+
}));
|
|
332
|
+
const state = getBufferState(result);
|
|
333
|
+
expect(state.text).toBe('hello');
|
|
334
|
+
expect(state.lines).toEqual(['hello']);
|
|
335
|
+
expect(state.cursor).toEqual([0, 0]); // Default cursor if offset not given
|
|
336
|
+
expect(state.allVisualLines).toEqual(['hello']);
|
|
337
|
+
expect(state.viewportVisualLines).toEqual(['hello']);
|
|
338
|
+
expect(state.visualCursor).toEqual([0, 0]);
|
|
339
|
+
});
|
|
340
|
+
it('should initialize with initialText and initialCursorOffset', () => {
|
|
341
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
342
|
+
initialText: 'hello\nworld',
|
|
343
|
+
initialCursorOffset: 7, // Should be at 'o' in 'world'
|
|
344
|
+
viewport,
|
|
345
|
+
isValidPath: () => false,
|
|
346
|
+
}));
|
|
347
|
+
const state = getBufferState(result);
|
|
348
|
+
expect(state.text).toBe('hello\nworld');
|
|
349
|
+
expect(state.lines).toEqual(['hello', 'world']);
|
|
350
|
+
expect(state.cursor).toEqual([1, 1]); // Logical cursor at 'o' in "world"
|
|
351
|
+
expect(state.allVisualLines).toEqual(['hello', 'world']);
|
|
352
|
+
expect(state.viewportVisualLines).toEqual(['hello', 'world']);
|
|
353
|
+
expect(state.visualCursor[0]).toBe(1); // On the second visual line
|
|
354
|
+
expect(state.visualCursor[1]).toBe(1); // At 'o' in "world"
|
|
355
|
+
});
|
|
356
|
+
it('should wrap visual lines', () => {
|
|
357
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
358
|
+
initialText: 'The quick brown fox jumps over the lazy dog.',
|
|
359
|
+
initialCursorOffset: 2, // After '好'
|
|
360
|
+
viewport: { width: 15, height: 4 },
|
|
361
|
+
isValidPath: () => false,
|
|
362
|
+
}));
|
|
363
|
+
const state = getBufferState(result);
|
|
364
|
+
expect(state.allVisualLines).toEqual([
|
|
365
|
+
'The quick',
|
|
366
|
+
'brown fox',
|
|
367
|
+
'jumps over the',
|
|
368
|
+
'lazy dog.',
|
|
369
|
+
]);
|
|
370
|
+
});
|
|
371
|
+
it('should wrap visual lines with multiple spaces', () => {
|
|
372
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
373
|
+
initialText: 'The quick brown fox jumps over the lazy dog.',
|
|
374
|
+
viewport: { width: 15, height: 4 },
|
|
375
|
+
isValidPath: () => false,
|
|
376
|
+
}));
|
|
377
|
+
const state = getBufferState(result);
|
|
378
|
+
// Including multiple spaces at the end of the lines like this is
|
|
379
|
+
// consistent with Google docs behavior and makes it intuitive to edit
|
|
380
|
+
// the spaces as needed.
|
|
381
|
+
expect(state.allVisualLines).toEqual([
|
|
382
|
+
'The quick ',
|
|
383
|
+
'brown fox ',
|
|
384
|
+
'jumps over the',
|
|
385
|
+
'lazy dog.',
|
|
386
|
+
]);
|
|
387
|
+
});
|
|
388
|
+
it('should wrap visual lines even without spaces', () => {
|
|
389
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
390
|
+
initialText: '123456789012345ABCDEFG', // 4 chars, 12 bytes
|
|
391
|
+
viewport: { width: 15, height: 2 },
|
|
392
|
+
isValidPath: () => false,
|
|
393
|
+
}));
|
|
394
|
+
const state = getBufferState(result);
|
|
395
|
+
// Including multiple spaces at the end of the lines like this is
|
|
396
|
+
// consistent with Google docs behavior and makes it intuitive to edit
|
|
397
|
+
// the spaces as needed.
|
|
398
|
+
expect(state.allVisualLines).toEqual(['123456789012345', 'ABCDEFG']);
|
|
399
|
+
});
|
|
400
|
+
it('should initialize with multi-byte unicode characters and correct cursor offset', () => {
|
|
401
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
402
|
+
initialText: '你好世界', // 4 chars, 12 bytes
|
|
403
|
+
initialCursorOffset: 2, // After '好'
|
|
404
|
+
viewport: { width: 5, height: 2 },
|
|
405
|
+
isValidPath: () => false,
|
|
406
|
+
}));
|
|
407
|
+
const state = getBufferState(result);
|
|
408
|
+
expect(state.text).toBe('你好世界');
|
|
409
|
+
expect(state.lines).toEqual(['你好世界']);
|
|
410
|
+
expect(state.cursor).toEqual([0, 2]);
|
|
411
|
+
// Visual: "你好" (width 4), "世"界" (width 4) with viewport width 5
|
|
412
|
+
expect(state.allVisualLines).toEqual(['你好', '世界']);
|
|
413
|
+
expect(state.visualCursor).toEqual([1, 0]);
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
describe('Basic Editing', () => {
|
|
417
|
+
it('insert: should insert a character and update cursor', () => {
|
|
418
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
419
|
+
act(() => result.current.insert('a'));
|
|
420
|
+
let state = getBufferState(result);
|
|
421
|
+
expect(state.text).toBe('a');
|
|
422
|
+
expect(state.cursor).toEqual([0, 1]);
|
|
423
|
+
expect(state.visualCursor).toEqual([0, 1]);
|
|
424
|
+
act(() => result.current.insert('b'));
|
|
425
|
+
state = getBufferState(result);
|
|
426
|
+
expect(state.text).toBe('ab');
|
|
427
|
+
expect(state.cursor).toEqual([0, 2]);
|
|
428
|
+
expect(state.visualCursor).toEqual([0, 2]);
|
|
429
|
+
});
|
|
430
|
+
it('insert: should insert text in the middle of a line', () => {
|
|
431
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
432
|
+
initialText: 'abc',
|
|
433
|
+
viewport,
|
|
434
|
+
isValidPath: () => false,
|
|
435
|
+
}));
|
|
436
|
+
act(() => result.current.move('right'));
|
|
437
|
+
act(() => result.current.insert('-NEW-'));
|
|
438
|
+
const state = getBufferState(result);
|
|
439
|
+
expect(state.text).toBe('a-NEW-bc');
|
|
440
|
+
expect(state.cursor).toEqual([0, 6]);
|
|
441
|
+
});
|
|
442
|
+
it('newline: should create a new line and move cursor', () => {
|
|
443
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
444
|
+
initialText: 'ab',
|
|
445
|
+
viewport,
|
|
446
|
+
isValidPath: () => false,
|
|
447
|
+
}));
|
|
448
|
+
act(() => result.current.move('end')); // cursor at [0,2]
|
|
449
|
+
act(() => result.current.newline());
|
|
450
|
+
const state = getBufferState(result);
|
|
451
|
+
expect(state.text).toBe('ab\n');
|
|
452
|
+
expect(state.lines).toEqual(['ab', '']);
|
|
453
|
+
expect(state.cursor).toEqual([1, 0]);
|
|
454
|
+
expect(state.allVisualLines).toEqual(['ab', '']);
|
|
455
|
+
expect(state.viewportVisualLines).toEqual(['ab', '']); // viewport height 3
|
|
456
|
+
expect(state.visualCursor).toEqual([1, 0]); // On the new visual line
|
|
457
|
+
});
|
|
458
|
+
it('backspace: should delete char to the left or merge lines', () => {
|
|
459
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
460
|
+
initialText: 'a\nb',
|
|
461
|
+
viewport,
|
|
462
|
+
isValidPath: () => false,
|
|
463
|
+
}));
|
|
464
|
+
act(() => {
|
|
465
|
+
result.current.move('down');
|
|
466
|
+
});
|
|
467
|
+
act(() => {
|
|
468
|
+
result.current.move('end'); // cursor to [1,1] (end of 'b')
|
|
469
|
+
});
|
|
470
|
+
act(() => result.current.backspace()); // delete 'b'
|
|
471
|
+
let state = getBufferState(result);
|
|
472
|
+
expect(state.text).toBe('a\n');
|
|
473
|
+
expect(state.cursor).toEqual([1, 0]);
|
|
474
|
+
act(() => result.current.backspace()); // merge lines
|
|
475
|
+
state = getBufferState(result);
|
|
476
|
+
expect(state.text).toBe('a');
|
|
477
|
+
expect(state.cursor).toEqual([0, 1]); // cursor after 'a'
|
|
478
|
+
expect(state.allVisualLines).toEqual(['a']);
|
|
479
|
+
expect(state.viewportVisualLines).toEqual(['a']);
|
|
480
|
+
expect(state.visualCursor).toEqual([0, 1]);
|
|
481
|
+
});
|
|
482
|
+
it('del: should delete char to the right or merge lines', () => {
|
|
483
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
484
|
+
initialText: 'a\nb',
|
|
485
|
+
viewport,
|
|
486
|
+
isValidPath: () => false,
|
|
487
|
+
}));
|
|
488
|
+
// cursor at [0,0]
|
|
489
|
+
act(() => result.current.del()); // delete 'a'
|
|
490
|
+
let state = getBufferState(result);
|
|
491
|
+
expect(state.text).toBe('\nb');
|
|
492
|
+
expect(state.cursor).toEqual([0, 0]);
|
|
493
|
+
act(() => result.current.del()); // merge lines (deletes newline)
|
|
494
|
+
state = getBufferState(result);
|
|
495
|
+
expect(state.text).toBe('b');
|
|
496
|
+
expect(state.cursor).toEqual([0, 0]);
|
|
497
|
+
expect(state.allVisualLines).toEqual(['b']);
|
|
498
|
+
expect(state.viewportVisualLines).toEqual(['b']);
|
|
499
|
+
expect(state.visualCursor).toEqual([0, 0]);
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
describe('Drag and Drop File Paths', () => {
|
|
503
|
+
it('should prepend @ to a valid file path on insert', () => {
|
|
504
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => true }));
|
|
505
|
+
const filePath = '/path/to/a/valid/file.txt';
|
|
506
|
+
act(() => result.current.insert(filePath, { paste: true }));
|
|
507
|
+
expect(getBufferState(result).text).toBe(`@${filePath} `);
|
|
508
|
+
});
|
|
509
|
+
it('should not prepend @ to an invalid file path on insert', () => {
|
|
510
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
511
|
+
const notAPath = 'this is just some long text';
|
|
512
|
+
act(() => result.current.insert(notAPath, { paste: true }));
|
|
513
|
+
expect(getBufferState(result).text).toBe(notAPath);
|
|
514
|
+
});
|
|
515
|
+
it('should handle quoted paths', () => {
|
|
516
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => true }));
|
|
517
|
+
const filePath = "'/path/to/a/valid/file.txt'";
|
|
518
|
+
act(() => result.current.insert(filePath, { paste: true }));
|
|
519
|
+
expect(getBufferState(result).text).toBe(`@/path/to/a/valid/file.txt `);
|
|
520
|
+
});
|
|
521
|
+
it('should not prepend @ to short text that is not a path', () => {
|
|
522
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => true }));
|
|
523
|
+
const shortText = 'ab';
|
|
524
|
+
act(() => result.current.insert(shortText, { paste: true }));
|
|
525
|
+
expect(getBufferState(result).text).toBe(shortText);
|
|
526
|
+
});
|
|
527
|
+
it('should prepend @ to multiple valid file paths on insert', () => {
|
|
528
|
+
// Use Set to model reality: individual paths exist, combined string doesn't
|
|
529
|
+
const validPaths = new Set(['/path/to/file1.txt', '/path/to/file2.txt']);
|
|
530
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: (p) => validPaths.has(p) }));
|
|
531
|
+
const filePaths = '/path/to/file1.txt /path/to/file2.txt';
|
|
532
|
+
act(() => result.current.insert(filePaths, { paste: true }));
|
|
533
|
+
expect(getBufferState(result).text).toBe('@/path/to/file1.txt @/path/to/file2.txt ');
|
|
534
|
+
});
|
|
535
|
+
it('should handle multiple paths with escaped spaces', () => {
|
|
536
|
+
// Use Set to model reality: individual paths exist, combined string doesn't
|
|
537
|
+
const validPaths = new Set(['/path/to/my file.txt', '/other/path.txt']);
|
|
538
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: (p) => validPaths.has(p) }));
|
|
539
|
+
const filePaths = '/path/to/my\\ file.txt /other/path.txt';
|
|
540
|
+
act(() => result.current.insert(filePaths, { paste: true }));
|
|
541
|
+
expect(getBufferState(result).text).toBe('@/path/to/my\\ file.txt @/other/path.txt ');
|
|
542
|
+
});
|
|
543
|
+
it('should only prepend @ to valid paths in multi-path paste', () => {
|
|
544
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
545
|
+
viewport,
|
|
546
|
+
isValidPath: (p) => p.endsWith('.txt'),
|
|
547
|
+
}));
|
|
548
|
+
const filePaths = '/valid/file.txt /invalid/file.jpg';
|
|
549
|
+
act(() => result.current.insert(filePaths, { paste: true }));
|
|
550
|
+
expect(getBufferState(result).text).toBe('@/valid/file.txt /invalid/file.jpg ');
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
describe('Shell Mode Behavior', () => {
|
|
554
|
+
it('should not prepend @ to valid file paths when shellModeActive is true', () => {
|
|
555
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
556
|
+
viewport,
|
|
557
|
+
isValidPath: () => true,
|
|
558
|
+
shellModeActive: true,
|
|
559
|
+
}));
|
|
560
|
+
const filePath = '/path/to/a/valid/file.txt';
|
|
561
|
+
act(() => result.current.insert(filePath, { paste: true }));
|
|
562
|
+
expect(getBufferState(result).text).toBe(filePath); // No @ prefix
|
|
563
|
+
});
|
|
564
|
+
it('should not prepend @ to quoted paths when shellModeActive is true', () => {
|
|
565
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
566
|
+
viewport,
|
|
567
|
+
isValidPath: () => true,
|
|
568
|
+
shellModeActive: true,
|
|
569
|
+
}));
|
|
570
|
+
const quotedFilePath = "'/path/to/a/valid/file.txt'";
|
|
571
|
+
act(() => result.current.insert(quotedFilePath, { paste: true }));
|
|
572
|
+
expect(getBufferState(result).text).toBe(quotedFilePath); // No @ prefix, keeps quotes
|
|
573
|
+
});
|
|
574
|
+
it('should behave normally with invalid paths when shellModeActive is true', () => {
|
|
575
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
576
|
+
viewport,
|
|
577
|
+
isValidPath: () => false,
|
|
578
|
+
shellModeActive: true,
|
|
579
|
+
}));
|
|
580
|
+
const notAPath = 'this is just some text';
|
|
581
|
+
act(() => result.current.insert(notAPath, { paste: true }));
|
|
582
|
+
expect(getBufferState(result).text).toBe(notAPath);
|
|
583
|
+
});
|
|
584
|
+
it('should behave normally with short text when shellModeActive is true', () => {
|
|
585
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
586
|
+
viewport,
|
|
587
|
+
isValidPath: () => true,
|
|
588
|
+
shellModeActive: true,
|
|
589
|
+
}));
|
|
590
|
+
const shortText = 'ls';
|
|
591
|
+
act(() => result.current.insert(shortText, { paste: true }));
|
|
592
|
+
expect(getBufferState(result).text).toBe(shortText); // No @ prefix for short text
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
describe('Cursor Movement', () => {
|
|
596
|
+
it('move: left/right should work within and across visual lines (due to wrapping)', () => {
|
|
597
|
+
// Text: "long line1next line2" (20 chars)
|
|
598
|
+
// Viewport width 5. Word wrapping should produce:
|
|
599
|
+
// "long " (5)
|
|
600
|
+
// "line1" (5)
|
|
601
|
+
// "next " (5)
|
|
602
|
+
// "line2" (5)
|
|
603
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
604
|
+
initialText: 'long line1next line2', // Corrected: was 'long line1next line2'
|
|
605
|
+
viewport: { width: 5, height: 4 },
|
|
606
|
+
isValidPath: () => false,
|
|
607
|
+
}));
|
|
608
|
+
// Initial cursor [0,0] logical, visual [0,0] ("l" of "long ")
|
|
609
|
+
act(() => result.current.move('right')); // visual [0,1] ("o")
|
|
610
|
+
expect(getBufferState(result).visualCursor).toEqual([0, 1]);
|
|
611
|
+
act(() => result.current.move('right')); // visual [0,2] ("n")
|
|
612
|
+
act(() => result.current.move('right')); // visual [0,3] ("g")
|
|
613
|
+
act(() => result.current.move('right')); // visual [0,4] (" ")
|
|
614
|
+
expect(getBufferState(result).visualCursor).toEqual([0, 4]);
|
|
615
|
+
act(() => result.current.move('right')); // visual [1,0] ("l" of "line1")
|
|
616
|
+
expect(getBufferState(result).visualCursor).toEqual([1, 0]);
|
|
617
|
+
expect(getBufferState(result).cursor).toEqual([0, 5]); // logical cursor
|
|
618
|
+
act(() => result.current.move('left')); // visual [0,4] (" " of "long ")
|
|
619
|
+
expect(getBufferState(result).visualCursor).toEqual([0, 4]);
|
|
620
|
+
expect(getBufferState(result).cursor).toEqual([0, 4]); // logical cursor
|
|
621
|
+
});
|
|
622
|
+
it('move: up/down should preserve preferred visual column', () => {
|
|
623
|
+
const text = 'abcde\nxy\n12345';
|
|
624
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
625
|
+
initialText: text,
|
|
626
|
+
viewport,
|
|
627
|
+
isValidPath: () => false,
|
|
628
|
+
}));
|
|
629
|
+
expect(result.current.allVisualLines).toEqual(['abcde', 'xy', '12345']);
|
|
630
|
+
// Place cursor at the end of "abcde" -> logical [0,5]
|
|
631
|
+
act(() => {
|
|
632
|
+
result.current.move('home'); // to [0,0]
|
|
633
|
+
});
|
|
634
|
+
for (let i = 0; i < 5; i++) {
|
|
635
|
+
act(() => {
|
|
636
|
+
result.current.move('right'); // to [0,5]
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
expect(getBufferState(result).cursor).toEqual([0, 5]);
|
|
640
|
+
expect(getBufferState(result).visualCursor).toEqual([0, 5]);
|
|
641
|
+
// Set preferredCol by moving up then down to the same spot, then test.
|
|
642
|
+
act(() => {
|
|
643
|
+
result.current.move('down'); // to xy, logical [1,2], visual [1,2], preferredCol should be 5
|
|
644
|
+
});
|
|
645
|
+
let state = getBufferState(result);
|
|
646
|
+
expect(state.cursor).toEqual([1, 2]); // Logical cursor at end of 'xy'
|
|
647
|
+
expect(state.visualCursor).toEqual([1, 2]); // Visual cursor at end of 'xy'
|
|
648
|
+
expect(state.preferredCol).toBe(5);
|
|
649
|
+
act(() => result.current.move('down')); // to '12345', preferredCol=5.
|
|
650
|
+
state = getBufferState(result);
|
|
651
|
+
expect(state.cursor).toEqual([2, 5]); // Logical cursor at end of '12345'
|
|
652
|
+
expect(state.visualCursor).toEqual([2, 5]); // Visual cursor at end of '12345'
|
|
653
|
+
expect(state.preferredCol).toBe(5); // Preferred col is maintained
|
|
654
|
+
act(() => result.current.move('left')); // preferredCol should reset
|
|
655
|
+
state = getBufferState(result);
|
|
656
|
+
expect(state.preferredCol).toBe(null);
|
|
657
|
+
});
|
|
658
|
+
it('move: home/end should go to visual line start/end', () => {
|
|
659
|
+
const initialText = 'line one\nsecond line';
|
|
660
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
661
|
+
initialText,
|
|
662
|
+
viewport: { width: 5, height: 5 },
|
|
663
|
+
isValidPath: () => false,
|
|
664
|
+
}));
|
|
665
|
+
expect(result.current.allVisualLines).toEqual([
|
|
666
|
+
'line',
|
|
667
|
+
'one',
|
|
668
|
+
'secon',
|
|
669
|
+
'd',
|
|
670
|
+
'line',
|
|
671
|
+
]);
|
|
672
|
+
// Initial cursor [0,0] (start of "line")
|
|
673
|
+
act(() => result.current.move('down')); // visual cursor from [0,0] to [1,0] ("o" of "one")
|
|
674
|
+
act(() => result.current.move('right')); // visual cursor to [1,1] ("n" of "one")
|
|
675
|
+
expect(getBufferState(result).visualCursor).toEqual([1, 1]);
|
|
676
|
+
act(() => result.current.move('home')); // visual cursor to [1,0] (start of "one")
|
|
677
|
+
expect(getBufferState(result).visualCursor).toEqual([1, 0]);
|
|
678
|
+
act(() => result.current.move('end')); // visual cursor to [1,3] (end of "one")
|
|
679
|
+
expect(getBufferState(result).visualCursor).toEqual([1, 3]); // "one" is 3 chars
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
describe('Visual Layout & Viewport', () => {
|
|
683
|
+
it('should wrap long lines correctly into visualLines', () => {
|
|
684
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
685
|
+
initialText: 'This is a very long line of text.', // 33 chars
|
|
686
|
+
viewport: { width: 10, height: 5 },
|
|
687
|
+
isValidPath: () => false,
|
|
688
|
+
}));
|
|
689
|
+
const state = getBufferState(result);
|
|
690
|
+
// Expected visual lines with word wrapping (viewport width 10):
|
|
691
|
+
// "This is a"
|
|
692
|
+
// "very long"
|
|
693
|
+
// "line of"
|
|
694
|
+
// "text."
|
|
695
|
+
expect(state.allVisualLines.length).toBe(4);
|
|
696
|
+
expect(state.allVisualLines[0]).toBe('This is a');
|
|
697
|
+
expect(state.allVisualLines[1]).toBe('very long');
|
|
698
|
+
expect(state.allVisualLines[2]).toBe('line of');
|
|
699
|
+
expect(state.allVisualLines[3]).toBe('text.');
|
|
700
|
+
});
|
|
701
|
+
it('should update visualScrollRow when visualCursor moves out of viewport', () => {
|
|
702
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
703
|
+
initialText: 'l1\nl2\nl3\nl4\nl5',
|
|
704
|
+
viewport: { width: 5, height: 3 }, // Can show 3 visual lines
|
|
705
|
+
isValidPath: () => false,
|
|
706
|
+
}));
|
|
707
|
+
// Initial: l1, l2, l3 visible. visualScrollRow = 0. visualCursor = [0,0]
|
|
708
|
+
expect(getBufferState(result).visualScrollRow).toBe(0);
|
|
709
|
+
expect(getBufferState(result).allVisualLines).toEqual([
|
|
710
|
+
'l1',
|
|
711
|
+
'l2',
|
|
712
|
+
'l3',
|
|
713
|
+
'l4',
|
|
714
|
+
'l5',
|
|
715
|
+
]);
|
|
716
|
+
expect(getBufferState(result).viewportVisualLines).toEqual([
|
|
717
|
+
'l1',
|
|
718
|
+
'l2',
|
|
719
|
+
'l3',
|
|
720
|
+
]);
|
|
721
|
+
act(() => result.current.move('down')); // vc=[1,0]
|
|
722
|
+
act(() => result.current.move('down')); // vc=[2,0] (l3)
|
|
723
|
+
expect(getBufferState(result).visualScrollRow).toBe(0);
|
|
724
|
+
act(() => result.current.move('down')); // vc=[3,0] (l4) - scroll should happen
|
|
725
|
+
// Now: l2, l3, l4 visible. visualScrollRow = 1.
|
|
726
|
+
let state = getBufferState(result);
|
|
727
|
+
expect(state.visualScrollRow).toBe(1);
|
|
728
|
+
expect(state.allVisualLines).toEqual(['l1', 'l2', 'l3', 'l4', 'l5']);
|
|
729
|
+
expect(state.viewportVisualLines).toEqual(['l2', 'l3', 'l4']);
|
|
730
|
+
expect(state.visualCursor).toEqual([3, 0]);
|
|
731
|
+
act(() => result.current.move('up')); // vc=[2,0] (l3)
|
|
732
|
+
act(() => result.current.move('up')); // vc=[1,0] (l2)
|
|
733
|
+
expect(getBufferState(result).visualScrollRow).toBe(1);
|
|
734
|
+
act(() => result.current.move('up')); // vc=[0,0] (l1) - scroll up
|
|
735
|
+
// Now: l1, l2, l3 visible. visualScrollRow = 0
|
|
736
|
+
state = getBufferState(result); // Assign to the existing `state` variable
|
|
737
|
+
expect(state.visualScrollRow).toBe(0);
|
|
738
|
+
expect(state.allVisualLines).toEqual(['l1', 'l2', 'l3', 'l4', 'l5']);
|
|
739
|
+
expect(state.viewportVisualLines).toEqual(['l1', 'l2', 'l3']);
|
|
740
|
+
expect(state.visualCursor).toEqual([0, 0]);
|
|
741
|
+
});
|
|
742
|
+
});
|
|
743
|
+
describe('Undo/Redo', () => {
|
|
744
|
+
it('should undo and redo an insert operation', () => {
|
|
745
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
746
|
+
act(() => result.current.insert('a'));
|
|
747
|
+
expect(getBufferState(result).text).toBe('a');
|
|
748
|
+
act(() => result.current.undo());
|
|
749
|
+
expect(getBufferState(result).text).toBe('');
|
|
750
|
+
expect(getBufferState(result).cursor).toEqual([0, 0]);
|
|
751
|
+
act(() => result.current.redo());
|
|
752
|
+
expect(getBufferState(result).text).toBe('a');
|
|
753
|
+
expect(getBufferState(result).cursor).toEqual([0, 1]);
|
|
754
|
+
});
|
|
755
|
+
it('should undo and redo a newline operation', () => {
|
|
756
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
757
|
+
initialText: 'test',
|
|
758
|
+
viewport,
|
|
759
|
+
isValidPath: () => false,
|
|
760
|
+
}));
|
|
761
|
+
act(() => result.current.move('end'));
|
|
762
|
+
act(() => result.current.newline());
|
|
763
|
+
expect(getBufferState(result).text).toBe('test\n');
|
|
764
|
+
act(() => result.current.undo());
|
|
765
|
+
expect(getBufferState(result).text).toBe('test');
|
|
766
|
+
expect(getBufferState(result).cursor).toEqual([0, 4]);
|
|
767
|
+
act(() => result.current.redo());
|
|
768
|
+
expect(getBufferState(result).text).toBe('test\n');
|
|
769
|
+
expect(getBufferState(result).cursor).toEqual([1, 0]);
|
|
770
|
+
});
|
|
771
|
+
});
|
|
772
|
+
describe('Unicode Handling', () => {
|
|
773
|
+
it('insert: should correctly handle multi-byte unicode characters', () => {
|
|
774
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
775
|
+
act(() => result.current.insert('你好'));
|
|
776
|
+
const state = getBufferState(result);
|
|
777
|
+
expect(state.text).toBe('你好');
|
|
778
|
+
expect(state.cursor).toEqual([0, 2]); // Cursor is 2 (char count)
|
|
779
|
+
expect(state.visualCursor).toEqual([0, 2]);
|
|
780
|
+
});
|
|
781
|
+
it('backspace: should correctly delete multi-byte unicode characters', () => {
|
|
782
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
783
|
+
initialText: '你好',
|
|
784
|
+
viewport,
|
|
785
|
+
isValidPath: () => false,
|
|
786
|
+
}));
|
|
787
|
+
act(() => result.current.move('end')); // cursor at [0,2]
|
|
788
|
+
act(() => result.current.backspace()); // delete '好'
|
|
789
|
+
let state = getBufferState(result);
|
|
790
|
+
expect(state.text).toBe('你');
|
|
791
|
+
expect(state.cursor).toEqual([0, 1]);
|
|
792
|
+
act(() => result.current.backspace()); // delete '你'
|
|
793
|
+
state = getBufferState(result);
|
|
794
|
+
expect(state.text).toBe('');
|
|
795
|
+
expect(state.cursor).toEqual([0, 0]);
|
|
796
|
+
});
|
|
797
|
+
it('move: left/right should treat multi-byte chars as single units for visual cursor', () => {
|
|
798
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
799
|
+
initialText: '🐶🐱',
|
|
800
|
+
viewport: { width: 5, height: 1 },
|
|
801
|
+
isValidPath: () => false,
|
|
802
|
+
}));
|
|
803
|
+
// Initial: visualCursor [0,0]
|
|
804
|
+
act(() => result.current.move('right')); // visualCursor [0,1] (after 🐶)
|
|
805
|
+
let state = getBufferState(result);
|
|
806
|
+
expect(state.cursor).toEqual([0, 1]);
|
|
807
|
+
expect(state.visualCursor).toEqual([0, 1]);
|
|
808
|
+
act(() => result.current.move('right')); // visualCursor [0,2] (after 🐱)
|
|
809
|
+
state = getBufferState(result);
|
|
810
|
+
expect(state.cursor).toEqual([0, 2]);
|
|
811
|
+
expect(state.visualCursor).toEqual([0, 2]);
|
|
812
|
+
act(() => result.current.move('left')); // visualCursor [0,1] (before 🐱 / after 🐶)
|
|
813
|
+
state = getBufferState(result);
|
|
814
|
+
expect(state.cursor).toEqual([0, 1]);
|
|
815
|
+
expect(state.visualCursor).toEqual([0, 1]);
|
|
816
|
+
});
|
|
817
|
+
it('moveToVisualPosition: should correctly handle wide characters (Chinese)', () => {
|
|
818
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
819
|
+
initialText: '你好', // 2 chars, width 4
|
|
820
|
+
viewport: { width: 10, height: 1 },
|
|
821
|
+
isValidPath: () => false,
|
|
822
|
+
}));
|
|
823
|
+
// '你' (width 2): visual 0-1. '好' (width 2): visual 2-3.
|
|
824
|
+
// Click on '你' (first half, x=0) -> index 0
|
|
825
|
+
act(() => result.current.moveToVisualPosition(0, 0));
|
|
826
|
+
expect(getBufferState(result).cursor).toEqual([0, 0]);
|
|
827
|
+
// Click on '你' (second half, x=1) -> index 1 (after first char)
|
|
828
|
+
act(() => result.current.moveToVisualPosition(0, 1));
|
|
829
|
+
expect(getBufferState(result).cursor).toEqual([0, 1]);
|
|
830
|
+
// Click on '好' (first half, x=2) -> index 1 (before second char)
|
|
831
|
+
act(() => result.current.moveToVisualPosition(0, 2));
|
|
832
|
+
expect(getBufferState(result).cursor).toEqual([0, 1]);
|
|
833
|
+
// Click on '好' (second half, x=3) -> index 2 (after second char)
|
|
834
|
+
act(() => result.current.moveToVisualPosition(0, 3));
|
|
835
|
+
expect(getBufferState(result).cursor).toEqual([0, 2]);
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
describe('handleInput', () => {
|
|
839
|
+
it('should insert printable characters', () => {
|
|
840
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
841
|
+
act(() => result.current.handleInput({
|
|
842
|
+
name: 'h',
|
|
843
|
+
ctrl: false,
|
|
844
|
+
meta: false,
|
|
845
|
+
shift: false,
|
|
846
|
+
paste: false,
|
|
847
|
+
insertable: true,
|
|
848
|
+
sequence: 'h',
|
|
849
|
+
}));
|
|
850
|
+
act(() => result.current.handleInput({
|
|
851
|
+
name: 'i',
|
|
852
|
+
ctrl: false,
|
|
853
|
+
meta: false,
|
|
854
|
+
shift: false,
|
|
855
|
+
paste: false,
|
|
856
|
+
insertable: true,
|
|
857
|
+
sequence: 'i',
|
|
858
|
+
}));
|
|
859
|
+
expect(getBufferState(result).text).toBe('hi');
|
|
860
|
+
});
|
|
861
|
+
it('should handle "Enter" key as newline', () => {
|
|
862
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
863
|
+
act(() => result.current.handleInput({
|
|
864
|
+
name: 'return',
|
|
865
|
+
ctrl: false,
|
|
866
|
+
meta: false,
|
|
867
|
+
shift: false,
|
|
868
|
+
paste: false,
|
|
869
|
+
insertable: true,
|
|
870
|
+
sequence: '\r',
|
|
871
|
+
}));
|
|
872
|
+
expect(getBufferState(result).lines).toEqual(['', '']);
|
|
873
|
+
});
|
|
874
|
+
it('should do nothing for a tab key press', () => {
|
|
875
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
876
|
+
act(() => result.current.handleInput({
|
|
877
|
+
name: 'tab',
|
|
878
|
+
ctrl: false,
|
|
879
|
+
meta: false,
|
|
880
|
+
shift: false,
|
|
881
|
+
paste: false,
|
|
882
|
+
insertable: false,
|
|
883
|
+
sequence: '\t',
|
|
884
|
+
}));
|
|
885
|
+
expect(getBufferState(result).text).toBe('');
|
|
886
|
+
});
|
|
887
|
+
it('should do nothing for a shift tab key press', () => {
|
|
888
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
889
|
+
act(() => result.current.handleInput({
|
|
890
|
+
name: 'tab',
|
|
891
|
+
ctrl: false,
|
|
892
|
+
meta: false,
|
|
893
|
+
shift: true,
|
|
894
|
+
paste: false,
|
|
895
|
+
insertable: false,
|
|
896
|
+
sequence: '\u001b[9;2u',
|
|
897
|
+
}));
|
|
898
|
+
expect(getBufferState(result).text).toBe('');
|
|
899
|
+
});
|
|
900
|
+
it('should handle "Backspace" key', () => {
|
|
901
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
902
|
+
initialText: 'a',
|
|
903
|
+
viewport,
|
|
904
|
+
isValidPath: () => false,
|
|
905
|
+
}));
|
|
906
|
+
act(() => result.current.move('end'));
|
|
907
|
+
act(() => result.current.handleInput({
|
|
908
|
+
name: 'backspace',
|
|
909
|
+
ctrl: false,
|
|
910
|
+
meta: false,
|
|
911
|
+
shift: false,
|
|
912
|
+
paste: false,
|
|
913
|
+
insertable: false,
|
|
914
|
+
sequence: '\x7f',
|
|
915
|
+
}));
|
|
916
|
+
expect(getBufferState(result).text).toBe('');
|
|
917
|
+
});
|
|
918
|
+
it('should handle multiple delete characters in one input', () => {
|
|
919
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
920
|
+
initialText: 'abcde',
|
|
921
|
+
viewport,
|
|
922
|
+
isValidPath: () => false,
|
|
923
|
+
}));
|
|
924
|
+
act(() => result.current.move('end')); // cursor at the end
|
|
925
|
+
expect(getBufferState(result).cursor).toEqual([0, 5]);
|
|
926
|
+
act(() => {
|
|
927
|
+
result.current.handleInput({
|
|
928
|
+
name: 'backspace',
|
|
929
|
+
ctrl: false,
|
|
930
|
+
meta: false,
|
|
931
|
+
shift: false,
|
|
932
|
+
paste: false,
|
|
933
|
+
insertable: false,
|
|
934
|
+
sequence: '\x7f',
|
|
935
|
+
});
|
|
936
|
+
result.current.handleInput({
|
|
937
|
+
name: 'backspace',
|
|
938
|
+
ctrl: false,
|
|
939
|
+
meta: false,
|
|
940
|
+
shift: false,
|
|
941
|
+
paste: false,
|
|
942
|
+
insertable: false,
|
|
943
|
+
sequence: '\x7f',
|
|
944
|
+
});
|
|
945
|
+
result.current.handleInput({
|
|
946
|
+
name: 'backspace',
|
|
947
|
+
ctrl: false,
|
|
948
|
+
meta: false,
|
|
949
|
+
shift: false,
|
|
950
|
+
paste: false,
|
|
951
|
+
insertable: false,
|
|
952
|
+
sequence: '\x7f',
|
|
953
|
+
});
|
|
954
|
+
});
|
|
955
|
+
expect(getBufferState(result).text).toBe('ab');
|
|
956
|
+
expect(getBufferState(result).cursor).toEqual([0, 2]);
|
|
957
|
+
});
|
|
958
|
+
it('should handle inserts that contain delete characters', () => {
|
|
959
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
960
|
+
initialText: 'abcde',
|
|
961
|
+
viewport,
|
|
962
|
+
isValidPath: () => false,
|
|
963
|
+
}));
|
|
964
|
+
act(() => result.current.move('end')); // cursor at the end
|
|
965
|
+
expect(getBufferState(result).cursor).toEqual([0, 5]);
|
|
966
|
+
act(() => {
|
|
967
|
+
result.current.insert('\x7f\x7f\x7f');
|
|
968
|
+
});
|
|
969
|
+
expect(getBufferState(result).text).toBe('ab');
|
|
970
|
+
expect(getBufferState(result).cursor).toEqual([0, 2]);
|
|
971
|
+
});
|
|
972
|
+
it('should handle inserts with a mix of regular and delete characters', () => {
|
|
973
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
974
|
+
initialText: 'abcde',
|
|
975
|
+
viewport,
|
|
976
|
+
isValidPath: () => false,
|
|
977
|
+
}));
|
|
978
|
+
act(() => result.current.move('end')); // cursor at the end
|
|
979
|
+
expect(getBufferState(result).cursor).toEqual([0, 5]);
|
|
980
|
+
act(() => {
|
|
981
|
+
result.current.insert('\x7fI\x7f\x7fNEW');
|
|
982
|
+
});
|
|
983
|
+
expect(getBufferState(result).text).toBe('abcNEW');
|
|
984
|
+
expect(getBufferState(result).cursor).toEqual([0, 6]);
|
|
985
|
+
});
|
|
986
|
+
it('should handle arrow keys for movement', () => {
|
|
987
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
988
|
+
initialText: 'ab',
|
|
989
|
+
viewport,
|
|
990
|
+
isValidPath: () => false,
|
|
991
|
+
}));
|
|
992
|
+
act(() => result.current.move('end')); // cursor [0,2]
|
|
993
|
+
act(() => result.current.handleInput({
|
|
994
|
+
name: 'left',
|
|
995
|
+
ctrl: false,
|
|
996
|
+
meta: false,
|
|
997
|
+
shift: false,
|
|
998
|
+
paste: false,
|
|
999
|
+
insertable: false,
|
|
1000
|
+
sequence: '\x1b[D',
|
|
1001
|
+
})); // cursor [0,1]
|
|
1002
|
+
expect(getBufferState(result).cursor).toEqual([0, 1]);
|
|
1003
|
+
act(() => result.current.handleInput({
|
|
1004
|
+
name: 'right',
|
|
1005
|
+
ctrl: false,
|
|
1006
|
+
meta: false,
|
|
1007
|
+
shift: false,
|
|
1008
|
+
paste: false,
|
|
1009
|
+
insertable: false,
|
|
1010
|
+
sequence: '\x1b[C',
|
|
1011
|
+
})); // cursor [0,2]
|
|
1012
|
+
expect(getBufferState(result).cursor).toEqual([0, 2]);
|
|
1013
|
+
});
|
|
1014
|
+
it('should strip ANSI escape codes when pasting text', () => {
|
|
1015
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1016
|
+
const textWithAnsi = '\x1B[31mHello\x1B[0m \x1B[32mWorld\x1B[0m';
|
|
1017
|
+
// Simulate pasting by calling handleInput with a string longer than 1 char
|
|
1018
|
+
act(() => result.current.handleInput({
|
|
1019
|
+
name: '',
|
|
1020
|
+
ctrl: false,
|
|
1021
|
+
meta: false,
|
|
1022
|
+
shift: false,
|
|
1023
|
+
paste: false,
|
|
1024
|
+
insertable: true,
|
|
1025
|
+
sequence: textWithAnsi,
|
|
1026
|
+
}));
|
|
1027
|
+
expect(getBufferState(result).text).toBe('Hello World');
|
|
1028
|
+
});
|
|
1029
|
+
it('should handle VSCode terminal Shift+Enter as newline', () => {
|
|
1030
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1031
|
+
act(() => result.current.handleInput({
|
|
1032
|
+
name: 'return',
|
|
1033
|
+
ctrl: false,
|
|
1034
|
+
meta: false,
|
|
1035
|
+
shift: true,
|
|
1036
|
+
paste: false,
|
|
1037
|
+
insertable: true,
|
|
1038
|
+
sequence: '\r',
|
|
1039
|
+
})); // Simulates Shift+Enter in VSCode terminal
|
|
1040
|
+
expect(getBufferState(result).lines).toEqual(['', '']);
|
|
1041
|
+
});
|
|
1042
|
+
it('should correctly handle repeated pasting of long text', () => {
|
|
1043
|
+
const longText = `not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
|
|
1044
|
+
|
|
1045
|
+
Why do we use it?
|
|
1046
|
+
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
|
|
1047
|
+
|
|
1048
|
+
Where does it come from?
|
|
1049
|
+
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lore
|
|
1050
|
+
`;
|
|
1051
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1052
|
+
// Simulate pasting the long text multiple times
|
|
1053
|
+
act(() => {
|
|
1054
|
+
result.current.insert(longText, { paste: true });
|
|
1055
|
+
result.current.insert(longText, { paste: true });
|
|
1056
|
+
result.current.insert(longText, { paste: true });
|
|
1057
|
+
});
|
|
1058
|
+
const state = getBufferState(result);
|
|
1059
|
+
// Check that the text is the result of three concatenations.
|
|
1060
|
+
expect(state.lines).toStrictEqual((longText + longText + longText).split('\n'));
|
|
1061
|
+
const expectedCursorPos = offsetToLogicalPos(state.text, state.text.length);
|
|
1062
|
+
expect(state.cursor).toEqual(expectedCursorPos);
|
|
1063
|
+
});
|
|
1064
|
+
});
|
|
1065
|
+
// More tests would be needed for:
|
|
1066
|
+
// - setText, replaceRange
|
|
1067
|
+
// - deleteWordLeft, deleteWordRight
|
|
1068
|
+
// - More complex undo/redo scenarios
|
|
1069
|
+
// - Selection and clipboard (copy/paste) - might need clipboard API mocks or internal state check
|
|
1070
|
+
// - openInExternalEditor (heavy mocking of fs, child_process, os)
|
|
1071
|
+
// - All edge cases for visual scrolling and wrapping with different viewport sizes and text content.
|
|
1072
|
+
describe('replaceRange', () => {
|
|
1073
|
+
it('should replace a single-line range with single-line text', () => {
|
|
1074
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1075
|
+
initialText: '@pac',
|
|
1076
|
+
viewport,
|
|
1077
|
+
isValidPath: () => false,
|
|
1078
|
+
}));
|
|
1079
|
+
act(() => result.current.replaceRange(0, 1, 0, 4, 'packages'));
|
|
1080
|
+
const state = getBufferState(result);
|
|
1081
|
+
expect(state.text).toBe('@packages');
|
|
1082
|
+
expect(state.cursor).toEqual([0, 9]); // cursor after 'typescript'
|
|
1083
|
+
});
|
|
1084
|
+
it('should replace a multi-line range with single-line text', () => {
|
|
1085
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1086
|
+
initialText: 'hello\nworld\nagain',
|
|
1087
|
+
viewport,
|
|
1088
|
+
isValidPath: () => false,
|
|
1089
|
+
}));
|
|
1090
|
+
act(() => result.current.replaceRange(0, 2, 1, 3, ' new ')); // replace 'llo\nwor' with ' new '
|
|
1091
|
+
const state = getBufferState(result);
|
|
1092
|
+
expect(state.text).toBe('he new ld\nagain');
|
|
1093
|
+
expect(state.cursor).toEqual([0, 7]); // cursor after ' new '
|
|
1094
|
+
});
|
|
1095
|
+
it('should delete a range when replacing with an empty string', () => {
|
|
1096
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1097
|
+
initialText: 'hello world',
|
|
1098
|
+
viewport,
|
|
1099
|
+
isValidPath: () => false,
|
|
1100
|
+
}));
|
|
1101
|
+
act(() => result.current.replaceRange(0, 5, 0, 11, '')); // delete ' world'
|
|
1102
|
+
const state = getBufferState(result);
|
|
1103
|
+
expect(state.text).toBe('hello');
|
|
1104
|
+
expect(state.cursor).toEqual([0, 5]);
|
|
1105
|
+
});
|
|
1106
|
+
it('should handle replacing at the beginning of the text', () => {
|
|
1107
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1108
|
+
initialText: 'world',
|
|
1109
|
+
viewport,
|
|
1110
|
+
isValidPath: () => false,
|
|
1111
|
+
}));
|
|
1112
|
+
act(() => result.current.replaceRange(0, 0, 0, 0, 'hello '));
|
|
1113
|
+
const state = getBufferState(result);
|
|
1114
|
+
expect(state.text).toBe('hello world');
|
|
1115
|
+
expect(state.cursor).toEqual([0, 6]);
|
|
1116
|
+
});
|
|
1117
|
+
it('should handle replacing at the end of the text', () => {
|
|
1118
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1119
|
+
initialText: 'hello',
|
|
1120
|
+
viewport,
|
|
1121
|
+
isValidPath: () => false,
|
|
1122
|
+
}));
|
|
1123
|
+
act(() => result.current.replaceRange(0, 5, 0, 5, ' world'));
|
|
1124
|
+
const state = getBufferState(result);
|
|
1125
|
+
expect(state.text).toBe('hello world');
|
|
1126
|
+
expect(state.cursor).toEqual([0, 11]);
|
|
1127
|
+
});
|
|
1128
|
+
it('should handle replacing the entire buffer content', () => {
|
|
1129
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1130
|
+
initialText: 'old text',
|
|
1131
|
+
viewport,
|
|
1132
|
+
isValidPath: () => false,
|
|
1133
|
+
}));
|
|
1134
|
+
act(() => result.current.replaceRange(0, 0, 0, 8, 'new text'));
|
|
1135
|
+
const state = getBufferState(result);
|
|
1136
|
+
expect(state.text).toBe('new text');
|
|
1137
|
+
expect(state.cursor).toEqual([0, 8]);
|
|
1138
|
+
});
|
|
1139
|
+
it('should correctly replace with unicode characters', () => {
|
|
1140
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1141
|
+
initialText: 'hello *** world',
|
|
1142
|
+
viewport,
|
|
1143
|
+
isValidPath: () => false,
|
|
1144
|
+
}));
|
|
1145
|
+
act(() => result.current.replaceRange(0, 6, 0, 9, '你好'));
|
|
1146
|
+
const state = getBufferState(result);
|
|
1147
|
+
expect(state.text).toBe('hello 你好 world');
|
|
1148
|
+
expect(state.cursor).toEqual([0, 8]); // after '你好'
|
|
1149
|
+
});
|
|
1150
|
+
it('should handle invalid range by returning false and not changing text', () => {
|
|
1151
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1152
|
+
initialText: 'test',
|
|
1153
|
+
viewport,
|
|
1154
|
+
isValidPath: () => false,
|
|
1155
|
+
}));
|
|
1156
|
+
act(() => {
|
|
1157
|
+
result.current.replaceRange(0, 5, 0, 3, 'fail'); // startCol > endCol in same line
|
|
1158
|
+
});
|
|
1159
|
+
expect(getBufferState(result).text).toBe('test');
|
|
1160
|
+
act(() => {
|
|
1161
|
+
result.current.replaceRange(1, 0, 0, 0, 'fail'); // startRow > endRow
|
|
1162
|
+
});
|
|
1163
|
+
expect(getBufferState(result).text).toBe('test');
|
|
1164
|
+
});
|
|
1165
|
+
it('replaceRange: multiple lines with a single character', () => {
|
|
1166
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1167
|
+
initialText: 'first\nsecond\nthird',
|
|
1168
|
+
viewport,
|
|
1169
|
+
isValidPath: () => false,
|
|
1170
|
+
}));
|
|
1171
|
+
act(() => result.current.replaceRange(0, 2, 2, 3, 'X')); // Replace 'rst\nsecond\nthi'
|
|
1172
|
+
const state = getBufferState(result);
|
|
1173
|
+
expect(state.text).toBe('fiXrd');
|
|
1174
|
+
expect(state.cursor).toEqual([0, 3]); // After 'X'
|
|
1175
|
+
});
|
|
1176
|
+
it('should replace a single-line range with multi-line text', () => {
|
|
1177
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1178
|
+
initialText: 'one two three',
|
|
1179
|
+
viewport,
|
|
1180
|
+
isValidPath: () => false,
|
|
1181
|
+
}));
|
|
1182
|
+
// Replace "two" with "new\nline"
|
|
1183
|
+
act(() => result.current.replaceRange(0, 4, 0, 7, 'new\nline'));
|
|
1184
|
+
const state = getBufferState(result);
|
|
1185
|
+
expect(state.lines).toEqual(['one new', 'line three']);
|
|
1186
|
+
expect(state.text).toBe('one new\nline three');
|
|
1187
|
+
expect(state.cursor).toEqual([1, 4]); // cursor after 'line'
|
|
1188
|
+
});
|
|
1189
|
+
});
|
|
1190
|
+
describe('Input Sanitization', () => {
|
|
1191
|
+
const createInput = (sequence) => ({
|
|
1192
|
+
name: '',
|
|
1193
|
+
ctrl: false,
|
|
1194
|
+
meta: false,
|
|
1195
|
+
shift: false,
|
|
1196
|
+
paste: false,
|
|
1197
|
+
insertable: true,
|
|
1198
|
+
sequence,
|
|
1199
|
+
});
|
|
1200
|
+
it.each([
|
|
1201
|
+
{
|
|
1202
|
+
input: '\x1B[31mHello\x1B[0m \x1B[32mWorld\x1B[0m',
|
|
1203
|
+
expected: 'Hello World',
|
|
1204
|
+
desc: 'ANSI escape codes',
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
input: 'H\x07e\x08l\x0Bl\x0Co',
|
|
1208
|
+
expected: 'Hello',
|
|
1209
|
+
desc: 'control characters',
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
input: '\u001B[4mH\u001B[0mello',
|
|
1213
|
+
expected: 'Hello',
|
|
1214
|
+
desc: 'mixed ANSI and control characters',
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
input: '\u001B[4mPasted\u001B[4m Text',
|
|
1218
|
+
expected: 'Pasted Text',
|
|
1219
|
+
desc: 'pasted text with ANSI',
|
|
1220
|
+
},
|
|
1221
|
+
])('should strip $desc from input', ({ input, expected }) => {
|
|
1222
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1223
|
+
act(() => result.current.handleInput(createInput(input)));
|
|
1224
|
+
expect(getBufferState(result).text).toBe(expected);
|
|
1225
|
+
});
|
|
1226
|
+
it('should not strip standard characters or newlines', () => {
|
|
1227
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1228
|
+
const validText = 'Hello World\nThis is a test.';
|
|
1229
|
+
act(() => result.current.handleInput(createInput(validText)));
|
|
1230
|
+
expect(getBufferState(result).text).toBe(validText);
|
|
1231
|
+
});
|
|
1232
|
+
it('should sanitize large text (>5000 chars) and strip unsafe characters', () => {
|
|
1233
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1234
|
+
const unsafeChars = '\x07\x08\x0B\x0C';
|
|
1235
|
+
const largeTextWithUnsafe = 'safe text'.repeat(600) + unsafeChars + 'more safe text';
|
|
1236
|
+
expect(largeTextWithUnsafe.length).toBeGreaterThan(5000);
|
|
1237
|
+
act(() => result.current.handleInput({
|
|
1238
|
+
name: '',
|
|
1239
|
+
ctrl: false,
|
|
1240
|
+
meta: false,
|
|
1241
|
+
shift: false,
|
|
1242
|
+
paste: false,
|
|
1243
|
+
insertable: true,
|
|
1244
|
+
sequence: largeTextWithUnsafe,
|
|
1245
|
+
}));
|
|
1246
|
+
const resultText = getBufferState(result).text;
|
|
1247
|
+
expect(resultText).not.toContain('\x07');
|
|
1248
|
+
expect(resultText).not.toContain('\x08');
|
|
1249
|
+
expect(resultText).not.toContain('\x0B');
|
|
1250
|
+
expect(resultText).not.toContain('\x0C');
|
|
1251
|
+
expect(resultText).toContain('safe text');
|
|
1252
|
+
expect(resultText).toContain('more safe text');
|
|
1253
|
+
});
|
|
1254
|
+
it('should sanitize large ANSI text (>5000 chars) and strip escape codes', () => {
|
|
1255
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1256
|
+
const largeTextWithAnsi = '\x1B[31m' +
|
|
1257
|
+
'red text'.repeat(800) +
|
|
1258
|
+
'\x1B[0m' +
|
|
1259
|
+
'\x1B[32m' +
|
|
1260
|
+
'green text'.repeat(200) +
|
|
1261
|
+
'\x1B[0m';
|
|
1262
|
+
expect(largeTextWithAnsi.length).toBeGreaterThan(5000);
|
|
1263
|
+
act(() => result.current.handleInput({
|
|
1264
|
+
name: '',
|
|
1265
|
+
ctrl: false,
|
|
1266
|
+
meta: false,
|
|
1267
|
+
shift: false,
|
|
1268
|
+
paste: false,
|
|
1269
|
+
insertable: true,
|
|
1270
|
+
sequence: largeTextWithAnsi,
|
|
1271
|
+
}));
|
|
1272
|
+
const resultText = getBufferState(result).text;
|
|
1273
|
+
expect(resultText).not.toContain('\x1B[31m');
|
|
1274
|
+
expect(resultText).not.toContain('\x1B[32m');
|
|
1275
|
+
expect(resultText).not.toContain('\x1B[0m');
|
|
1276
|
+
expect(resultText).toContain('red text');
|
|
1277
|
+
expect(resultText).toContain('green text');
|
|
1278
|
+
});
|
|
1279
|
+
it('should not strip popular emojis', () => {
|
|
1280
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath: () => false }));
|
|
1281
|
+
const emojis = '🐍🐳🦀🦄';
|
|
1282
|
+
act(() => result.current.handleInput({
|
|
1283
|
+
name: '',
|
|
1284
|
+
ctrl: false,
|
|
1285
|
+
meta: false,
|
|
1286
|
+
shift: false,
|
|
1287
|
+
paste: false,
|
|
1288
|
+
insertable: true,
|
|
1289
|
+
sequence: emojis,
|
|
1290
|
+
}));
|
|
1291
|
+
expect(getBufferState(result).text).toBe(emojis);
|
|
1292
|
+
});
|
|
1293
|
+
});
|
|
1294
|
+
describe('inputFilter', () => {
|
|
1295
|
+
it('should filter input based on the provided filter function', () => {
|
|
1296
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1297
|
+
viewport,
|
|
1298
|
+
isValidPath: () => false,
|
|
1299
|
+
inputFilter: (text) => text.replace(/[^0-9]/g, ''),
|
|
1300
|
+
}));
|
|
1301
|
+
act(() => result.current.insert('a1b2c3'));
|
|
1302
|
+
expect(getBufferState(result).text).toBe('123');
|
|
1303
|
+
});
|
|
1304
|
+
it('should handle empty result from filter', () => {
|
|
1305
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1306
|
+
viewport,
|
|
1307
|
+
isValidPath: () => false,
|
|
1308
|
+
inputFilter: (text) => text.replace(/[^0-9]/g, ''),
|
|
1309
|
+
}));
|
|
1310
|
+
act(() => result.current.insert('abc'));
|
|
1311
|
+
expect(getBufferState(result).text).toBe('');
|
|
1312
|
+
});
|
|
1313
|
+
it('should filter pasted text', () => {
|
|
1314
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1315
|
+
viewport,
|
|
1316
|
+
isValidPath: () => false,
|
|
1317
|
+
inputFilter: (text) => text.toUpperCase(),
|
|
1318
|
+
}));
|
|
1319
|
+
act(() => result.current.insert('hello', { paste: true }));
|
|
1320
|
+
expect(getBufferState(result).text).toBe('HELLO');
|
|
1321
|
+
});
|
|
1322
|
+
it('should not filter newlines if they are allowed by the filter', () => {
|
|
1323
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1324
|
+
viewport,
|
|
1325
|
+
isValidPath: () => false,
|
|
1326
|
+
inputFilter: (text) => text, // Allow everything including newlines
|
|
1327
|
+
}));
|
|
1328
|
+
act(() => result.current.insert('a\nb'));
|
|
1329
|
+
// The insert function splits by newline and inserts separately if it detects them.
|
|
1330
|
+
// If the filter allows them, they should be handled correctly by the subsequent logic in insert.
|
|
1331
|
+
expect(getBufferState(result).text).toBe('a\nb');
|
|
1332
|
+
});
|
|
1333
|
+
it('should filter before newline check in insert', () => {
|
|
1334
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1335
|
+
viewport,
|
|
1336
|
+
isValidPath: () => false,
|
|
1337
|
+
inputFilter: (text) => text.replace(/\n/g, ''), // Filter out newlines
|
|
1338
|
+
}));
|
|
1339
|
+
act(() => result.current.insert('a\nb'));
|
|
1340
|
+
expect(getBufferState(result).text).toBe('ab');
|
|
1341
|
+
});
|
|
1342
|
+
});
|
|
1343
|
+
describe('stripAnsi', () => {
|
|
1344
|
+
it('should correctly strip ANSI escape codes', () => {
|
|
1345
|
+
const textWithAnsi = '\x1B[31mHello\x1B[0m World';
|
|
1346
|
+
expect(stripAnsi(textWithAnsi)).toBe('Hello World');
|
|
1347
|
+
});
|
|
1348
|
+
it('should handle multiple ANSI codes', () => {
|
|
1349
|
+
const textWithMultipleAnsi = '\x1B[1m\x1B[34mBold Blue\x1B[0m Text';
|
|
1350
|
+
expect(stripAnsi(textWithMultipleAnsi)).toBe('Bold Blue Text');
|
|
1351
|
+
});
|
|
1352
|
+
it('should not modify text without ANSI codes', () => {
|
|
1353
|
+
const plainText = 'Plain text';
|
|
1354
|
+
expect(stripAnsi(plainText)).toBe('Plain text');
|
|
1355
|
+
});
|
|
1356
|
+
it('should handle empty string', () => {
|
|
1357
|
+
expect(stripAnsi('')).toBe('');
|
|
1358
|
+
});
|
|
1359
|
+
});
|
|
1360
|
+
describe('Memoization', () => {
|
|
1361
|
+
it('should keep action references stable across re-renders', () => {
|
|
1362
|
+
// We pass a stable `isValidPath` so that callbacks that depend on it
|
|
1363
|
+
// are not recreated on every render.
|
|
1364
|
+
const isValidPath = () => false;
|
|
1365
|
+
const { result, rerender } = renderHook(() => useTextBuffer({ viewport, isValidPath }));
|
|
1366
|
+
const initialInsert = result.current.insert;
|
|
1367
|
+
const initialBackspace = result.current.backspace;
|
|
1368
|
+
const initialMove = result.current.move;
|
|
1369
|
+
const initialHandleInput = result.current.handleInput;
|
|
1370
|
+
rerender();
|
|
1371
|
+
expect(result.current.insert).toBe(initialInsert);
|
|
1372
|
+
expect(result.current.backspace).toBe(initialBackspace);
|
|
1373
|
+
expect(result.current.move).toBe(initialMove);
|
|
1374
|
+
expect(result.current.handleInput).toBe(initialHandleInput);
|
|
1375
|
+
});
|
|
1376
|
+
it('should have memoized actions that operate on the latest state', () => {
|
|
1377
|
+
const isValidPath = () => false;
|
|
1378
|
+
const { result } = renderHook(() => useTextBuffer({ viewport, isValidPath }));
|
|
1379
|
+
// Store a reference to the memoized insert function.
|
|
1380
|
+
const memoizedInsert = result.current.insert;
|
|
1381
|
+
// Update the buffer state.
|
|
1382
|
+
act(() => {
|
|
1383
|
+
result.current.insert('hello');
|
|
1384
|
+
});
|
|
1385
|
+
expect(getBufferState(result).text).toBe('hello');
|
|
1386
|
+
// Now, call the original memoized function reference.
|
|
1387
|
+
act(() => {
|
|
1388
|
+
memoizedInsert(' world');
|
|
1389
|
+
});
|
|
1390
|
+
// It should have operated on the updated state.
|
|
1391
|
+
expect(getBufferState(result).text).toBe('hello world');
|
|
1392
|
+
});
|
|
1393
|
+
});
|
|
1394
|
+
describe('singleLine mode', () => {
|
|
1395
|
+
it('should not insert a newline character when singleLine is true', () => {
|
|
1396
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1397
|
+
viewport,
|
|
1398
|
+
isValidPath: () => false,
|
|
1399
|
+
singleLine: true,
|
|
1400
|
+
}));
|
|
1401
|
+
act(() => result.current.insert('\n'));
|
|
1402
|
+
const state = getBufferState(result);
|
|
1403
|
+
expect(state.text).toBe('');
|
|
1404
|
+
expect(state.lines).toEqual(['']);
|
|
1405
|
+
});
|
|
1406
|
+
it('should not create a new line when newline() is called and singleLine is true', () => {
|
|
1407
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1408
|
+
initialText: 'ab',
|
|
1409
|
+
viewport,
|
|
1410
|
+
isValidPath: () => false,
|
|
1411
|
+
singleLine: true,
|
|
1412
|
+
}));
|
|
1413
|
+
act(() => result.current.move('end')); // cursor at [0,2]
|
|
1414
|
+
act(() => result.current.newline());
|
|
1415
|
+
const state = getBufferState(result);
|
|
1416
|
+
expect(state.text).toBe('ab');
|
|
1417
|
+
expect(state.lines).toEqual(['ab']);
|
|
1418
|
+
expect(state.cursor).toEqual([0, 2]);
|
|
1419
|
+
});
|
|
1420
|
+
it('should not handle "Enter" key as newline when singleLine is true', () => {
|
|
1421
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1422
|
+
viewport,
|
|
1423
|
+
isValidPath: () => false,
|
|
1424
|
+
singleLine: true,
|
|
1425
|
+
}));
|
|
1426
|
+
act(() => result.current.handleInput({
|
|
1427
|
+
name: 'return',
|
|
1428
|
+
ctrl: false,
|
|
1429
|
+
meta: false,
|
|
1430
|
+
shift: false,
|
|
1431
|
+
paste: false,
|
|
1432
|
+
insertable: true,
|
|
1433
|
+
sequence: '\r',
|
|
1434
|
+
}));
|
|
1435
|
+
expect(getBufferState(result).lines).toEqual(['']);
|
|
1436
|
+
});
|
|
1437
|
+
it('should not print anything for function keys when singleLine is true', () => {
|
|
1438
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1439
|
+
viewport,
|
|
1440
|
+
isValidPath: () => false,
|
|
1441
|
+
singleLine: true,
|
|
1442
|
+
}));
|
|
1443
|
+
act(() => result.current.handleInput({
|
|
1444
|
+
name: 'f1',
|
|
1445
|
+
ctrl: false,
|
|
1446
|
+
meta: false,
|
|
1447
|
+
shift: false,
|
|
1448
|
+
paste: false,
|
|
1449
|
+
insertable: false,
|
|
1450
|
+
sequence: '\u001bOP',
|
|
1451
|
+
}));
|
|
1452
|
+
expect(getBufferState(result).lines).toEqual(['']);
|
|
1453
|
+
});
|
|
1454
|
+
it('should strip newlines from pasted text when singleLine is true', () => {
|
|
1455
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1456
|
+
viewport,
|
|
1457
|
+
isValidPath: () => false,
|
|
1458
|
+
singleLine: true,
|
|
1459
|
+
}));
|
|
1460
|
+
act(() => result.current.insert('hello\nworld', { paste: true }));
|
|
1461
|
+
const state = getBufferState(result);
|
|
1462
|
+
expect(state.text).toBe('helloworld');
|
|
1463
|
+
expect(state.lines).toEqual(['helloworld']);
|
|
1464
|
+
});
|
|
1465
|
+
});
|
|
1466
|
+
});
|
|
1467
|
+
describe('offsetToLogicalPos', () => {
|
|
1468
|
+
it.each([
|
|
1469
|
+
{ text: 'any text', offset: 0, expected: [0, 0], desc: 'offset 0' },
|
|
1470
|
+
{ text: 'hello', offset: 0, expected: [0, 0], desc: 'single line start' },
|
|
1471
|
+
{ text: 'hello', offset: 2, expected: [0, 2], desc: 'single line middle' },
|
|
1472
|
+
{ text: 'hello', offset: 5, expected: [0, 5], desc: 'single line end' },
|
|
1473
|
+
{ text: 'hello', offset: 10, expected: [0, 5], desc: 'beyond end clamps' },
|
|
1474
|
+
{
|
|
1475
|
+
text: 'a\n\nc',
|
|
1476
|
+
offset: 0,
|
|
1477
|
+
expected: [0, 0],
|
|
1478
|
+
desc: 'empty lines - first char',
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
text: 'a\n\nc',
|
|
1482
|
+
offset: 1,
|
|
1483
|
+
expected: [0, 1],
|
|
1484
|
+
desc: 'empty lines - end of first',
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
text: 'a\n\nc',
|
|
1488
|
+
offset: 2,
|
|
1489
|
+
expected: [1, 0],
|
|
1490
|
+
desc: 'empty lines - empty line',
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
text: 'a\n\nc',
|
|
1494
|
+
offset: 3,
|
|
1495
|
+
expected: [2, 0],
|
|
1496
|
+
desc: 'empty lines - last line start',
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
text: 'a\n\nc',
|
|
1500
|
+
offset: 4,
|
|
1501
|
+
expected: [2, 1],
|
|
1502
|
+
desc: 'empty lines - last line end',
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
text: 'hello\n',
|
|
1506
|
+
offset: 5,
|
|
1507
|
+
expected: [0, 5],
|
|
1508
|
+
desc: 'newline end - before newline',
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
text: 'hello\n',
|
|
1512
|
+
offset: 6,
|
|
1513
|
+
expected: [1, 0],
|
|
1514
|
+
desc: 'newline end - after newline',
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
text: 'hello\n',
|
|
1518
|
+
offset: 7,
|
|
1519
|
+
expected: [1, 0],
|
|
1520
|
+
desc: 'newline end - beyond',
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
text: '\nhello',
|
|
1524
|
+
offset: 0,
|
|
1525
|
+
expected: [0, 0],
|
|
1526
|
+
desc: 'newline start - first line',
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
text: '\nhello',
|
|
1530
|
+
offset: 1,
|
|
1531
|
+
expected: [1, 0],
|
|
1532
|
+
desc: 'newline start - second line',
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
text: '\nhello',
|
|
1536
|
+
offset: 3,
|
|
1537
|
+
expected: [1, 2],
|
|
1538
|
+
desc: 'newline start - middle of second',
|
|
1539
|
+
},
|
|
1540
|
+
{ text: '', offset: 0, expected: [0, 0], desc: 'empty string at 0' },
|
|
1541
|
+
{ text: '', offset: 5, expected: [0, 0], desc: 'empty string beyond' },
|
|
1542
|
+
{
|
|
1543
|
+
text: '你好\n世界',
|
|
1544
|
+
offset: 0,
|
|
1545
|
+
expected: [0, 0],
|
|
1546
|
+
desc: 'unicode - start',
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
text: '你好\n世界',
|
|
1550
|
+
offset: 1,
|
|
1551
|
+
expected: [0, 1],
|
|
1552
|
+
desc: 'unicode - after first char',
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
text: '你好\n世界',
|
|
1556
|
+
offset: 2,
|
|
1557
|
+
expected: [0, 2],
|
|
1558
|
+
desc: 'unicode - end first line',
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
text: '你好\n世界',
|
|
1562
|
+
offset: 3,
|
|
1563
|
+
expected: [1, 0],
|
|
1564
|
+
desc: 'unicode - second line start',
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
text: '你好\n世界',
|
|
1568
|
+
offset: 4,
|
|
1569
|
+
expected: [1, 1],
|
|
1570
|
+
desc: 'unicode - second line middle',
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
text: '你好\n世界',
|
|
1574
|
+
offset: 5,
|
|
1575
|
+
expected: [1, 2],
|
|
1576
|
+
desc: 'unicode - second line end',
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
text: '你好\n世界',
|
|
1580
|
+
offset: 6,
|
|
1581
|
+
expected: [1, 2],
|
|
1582
|
+
desc: 'unicode - beyond',
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
text: 'abc\ndef',
|
|
1586
|
+
offset: 3,
|
|
1587
|
+
expected: [0, 3],
|
|
1588
|
+
desc: 'at newline - end of line',
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
text: 'abc\ndef',
|
|
1592
|
+
offset: 4,
|
|
1593
|
+
expected: [1, 0],
|
|
1594
|
+
desc: 'at newline - after newline',
|
|
1595
|
+
},
|
|
1596
|
+
{ text: '🐶🐱', offset: 0, expected: [0, 0], desc: 'emoji - start' },
|
|
1597
|
+
{ text: '🐶🐱', offset: 1, expected: [0, 1], desc: 'emoji - middle' },
|
|
1598
|
+
{ text: '🐶🐱', offset: 2, expected: [0, 2], desc: 'emoji - end' },
|
|
1599
|
+
])('should handle $desc', ({ text, offset, expected }) => {
|
|
1600
|
+
expect(offsetToLogicalPos(text, offset)).toEqual(expected);
|
|
1601
|
+
});
|
|
1602
|
+
describe('multi-line text', () => {
|
|
1603
|
+
const text = 'hello\nworld\n123';
|
|
1604
|
+
it.each([
|
|
1605
|
+
{ offset: 0, expected: [0, 0], desc: 'start of first line' },
|
|
1606
|
+
{ offset: 3, expected: [0, 3], desc: 'middle of first line' },
|
|
1607
|
+
{ offset: 5, expected: [0, 5], desc: 'end of first line' },
|
|
1608
|
+
{ offset: 6, expected: [1, 0], desc: 'start of second line' },
|
|
1609
|
+
{ offset: 8, expected: [1, 2], desc: 'middle of second line' },
|
|
1610
|
+
{ offset: 11, expected: [1, 5], desc: 'end of second line' },
|
|
1611
|
+
{ offset: 12, expected: [2, 0], desc: 'start of third line' },
|
|
1612
|
+
{ offset: 13, expected: [2, 1], desc: 'middle of third line' },
|
|
1613
|
+
{ offset: 15, expected: [2, 3], desc: 'end of third line' },
|
|
1614
|
+
{ offset: 20, expected: [2, 3], desc: 'beyond end' },
|
|
1615
|
+
])('should return $expected for $desc (offset $offset)', ({ offset, expected }) => {
|
|
1616
|
+
expect(offsetToLogicalPos(text, offset)).toEqual(expected);
|
|
1617
|
+
});
|
|
1618
|
+
});
|
|
1619
|
+
});
|
|
1620
|
+
describe('logicalPosToOffset', () => {
|
|
1621
|
+
it('should convert row/col position to offset correctly', () => {
|
|
1622
|
+
const lines = ['hello', 'world', '123'];
|
|
1623
|
+
// Line 0: "hello" (5 chars)
|
|
1624
|
+
expect(logicalPosToOffset(lines, 0, 0)).toBe(0); // Start of 'hello'
|
|
1625
|
+
expect(logicalPosToOffset(lines, 0, 3)).toBe(3); // 'l' in 'hello'
|
|
1626
|
+
expect(logicalPosToOffset(lines, 0, 5)).toBe(5); // End of 'hello'
|
|
1627
|
+
// Line 1: "world" (5 chars), offset starts at 6 (5 + 1 for newline)
|
|
1628
|
+
expect(logicalPosToOffset(lines, 1, 0)).toBe(6); // Start of 'world'
|
|
1629
|
+
expect(logicalPosToOffset(lines, 1, 2)).toBe(8); // 'r' in 'world'
|
|
1630
|
+
expect(logicalPosToOffset(lines, 1, 5)).toBe(11); // End of 'world'
|
|
1631
|
+
// Line 2: "123" (3 chars), offset starts at 12 (5 + 1 + 5 + 1)
|
|
1632
|
+
expect(logicalPosToOffset(lines, 2, 0)).toBe(12); // Start of '123'
|
|
1633
|
+
expect(logicalPosToOffset(lines, 2, 1)).toBe(13); // '2' in '123'
|
|
1634
|
+
expect(logicalPosToOffset(lines, 2, 3)).toBe(15); // End of '123'
|
|
1635
|
+
});
|
|
1636
|
+
it('should handle empty lines', () => {
|
|
1637
|
+
const lines = ['a', '', 'c'];
|
|
1638
|
+
expect(logicalPosToOffset(lines, 0, 0)).toBe(0); // 'a'
|
|
1639
|
+
expect(logicalPosToOffset(lines, 0, 1)).toBe(1); // End of 'a'
|
|
1640
|
+
expect(logicalPosToOffset(lines, 1, 0)).toBe(2); // Empty line
|
|
1641
|
+
expect(logicalPosToOffset(lines, 2, 0)).toBe(3); // 'c'
|
|
1642
|
+
expect(logicalPosToOffset(lines, 2, 1)).toBe(4); // End of 'c'
|
|
1643
|
+
});
|
|
1644
|
+
it('should handle single empty line', () => {
|
|
1645
|
+
const lines = [''];
|
|
1646
|
+
expect(logicalPosToOffset(lines, 0, 0)).toBe(0);
|
|
1647
|
+
});
|
|
1648
|
+
it('should be inverse of offsetToLogicalPos', () => {
|
|
1649
|
+
const lines = ['hello', 'world', '123'];
|
|
1650
|
+
const text = lines.join('\n');
|
|
1651
|
+
// Test round-trip conversion
|
|
1652
|
+
for (let offset = 0; offset <= text.length; offset++) {
|
|
1653
|
+
const [row, col] = offsetToLogicalPos(text, offset);
|
|
1654
|
+
const convertedOffset = logicalPosToOffset(lines, row, col);
|
|
1655
|
+
expect(convertedOffset).toBe(offset);
|
|
1656
|
+
}
|
|
1657
|
+
});
|
|
1658
|
+
it('should handle out-of-bounds positions', () => {
|
|
1659
|
+
const lines = ['hello'];
|
|
1660
|
+
// Beyond end of line
|
|
1661
|
+
expect(logicalPosToOffset(lines, 0, 10)).toBe(5); // Clamps to end of line
|
|
1662
|
+
// Beyond array bounds - should clamp to the last line
|
|
1663
|
+
expect(logicalPosToOffset(lines, 5, 0)).toBe(0); // Clamps to start of last line (row 0)
|
|
1664
|
+
expect(logicalPosToOffset(lines, 5, 10)).toBe(5); // Clamps to end of last line
|
|
1665
|
+
});
|
|
1666
|
+
});
|
|
1667
|
+
const createTestState = (lines, cursorRow, cursorCol, viewportWidth = 80) => {
|
|
1668
|
+
const text = lines.join('\n');
|
|
1669
|
+
let state = textBufferReducer(initialState, {
|
|
1670
|
+
type: 'set_text',
|
|
1671
|
+
payload: text,
|
|
1672
|
+
});
|
|
1673
|
+
state = textBufferReducer(state, {
|
|
1674
|
+
type: 'set_cursor',
|
|
1675
|
+
payload: { cursorRow, cursorCol, preferredCol: null },
|
|
1676
|
+
});
|
|
1677
|
+
state = textBufferReducer(state, {
|
|
1678
|
+
type: 'set_viewport',
|
|
1679
|
+
payload: { width: viewportWidth, height: 24 },
|
|
1680
|
+
});
|
|
1681
|
+
return state;
|
|
1682
|
+
};
|
|
1683
|
+
describe('textBufferReducer vim operations', () => {
|
|
1684
|
+
describe('vim_delete_line', () => {
|
|
1685
|
+
it('should delete a single line including newline in multi-line text', () => {
|
|
1686
|
+
const state = createTestState(['line1', 'line2', 'line3'], 1, 2);
|
|
1687
|
+
const action = {
|
|
1688
|
+
type: 'vim_delete_line',
|
|
1689
|
+
payload: { count: 1 },
|
|
1690
|
+
};
|
|
1691
|
+
const result = textBufferReducer(state, action);
|
|
1692
|
+
expect(result).toHaveOnlyValidCharacters();
|
|
1693
|
+
// After deleting line2, we should have line1 and line3, with cursor on line3 (now at index 1)
|
|
1694
|
+
expect(result.lines).toEqual(['line1', 'line3']);
|
|
1695
|
+
expect(result.cursorRow).toBe(1);
|
|
1696
|
+
expect(result.cursorCol).toBe(0);
|
|
1697
|
+
});
|
|
1698
|
+
it('should delete multiple lines when count > 1', () => {
|
|
1699
|
+
const state = createTestState(['line1', 'line2', 'line3', 'line4'], 1, 0);
|
|
1700
|
+
const action = {
|
|
1701
|
+
type: 'vim_delete_line',
|
|
1702
|
+
payload: { count: 2 },
|
|
1703
|
+
};
|
|
1704
|
+
const result = textBufferReducer(state, action);
|
|
1705
|
+
expect(result).toHaveOnlyValidCharacters();
|
|
1706
|
+
// Should delete line2 and line3, leaving line1 and line4
|
|
1707
|
+
expect(result.lines).toEqual(['line1', 'line4']);
|
|
1708
|
+
expect(result.cursorRow).toBe(1);
|
|
1709
|
+
expect(result.cursorCol).toBe(0);
|
|
1710
|
+
});
|
|
1711
|
+
it('should clear single line content when only one line exists', () => {
|
|
1712
|
+
const state = createTestState(['only line'], 0, 5);
|
|
1713
|
+
const action = {
|
|
1714
|
+
type: 'vim_delete_line',
|
|
1715
|
+
payload: { count: 1 },
|
|
1716
|
+
};
|
|
1717
|
+
const result = textBufferReducer(state, action);
|
|
1718
|
+
expect(result).toHaveOnlyValidCharacters();
|
|
1719
|
+
// Should clear the line content but keep the line
|
|
1720
|
+
expect(result.lines).toEqual(['']);
|
|
1721
|
+
expect(result.cursorRow).toBe(0);
|
|
1722
|
+
expect(result.cursorCol).toBe(0);
|
|
1723
|
+
});
|
|
1724
|
+
it('should handle deleting the last line properly', () => {
|
|
1725
|
+
const state = createTestState(['line1', 'line2'], 1, 0);
|
|
1726
|
+
const action = {
|
|
1727
|
+
type: 'vim_delete_line',
|
|
1728
|
+
payload: { count: 1 },
|
|
1729
|
+
};
|
|
1730
|
+
const result = textBufferReducer(state, action);
|
|
1731
|
+
expect(result).toHaveOnlyValidCharacters();
|
|
1732
|
+
// Should delete the last line completely, not leave empty line
|
|
1733
|
+
expect(result.lines).toEqual(['line1']);
|
|
1734
|
+
expect(result.cursorRow).toBe(0);
|
|
1735
|
+
expect(result.cursorCol).toBe(0);
|
|
1736
|
+
});
|
|
1737
|
+
it('should handle deleting all lines and maintain valid state for subsequent paste', () => {
|
|
1738
|
+
const state = createTestState(['line1', 'line2', 'line3', 'line4'], 0, 0);
|
|
1739
|
+
// Delete all 4 lines with 4dd
|
|
1740
|
+
const deleteAction = {
|
|
1741
|
+
type: 'vim_delete_line',
|
|
1742
|
+
payload: { count: 4 },
|
|
1743
|
+
};
|
|
1744
|
+
const afterDelete = textBufferReducer(state, deleteAction);
|
|
1745
|
+
expect(afterDelete).toHaveOnlyValidCharacters();
|
|
1746
|
+
// After deleting all lines, should have one empty line
|
|
1747
|
+
expect(afterDelete.lines).toEqual(['']);
|
|
1748
|
+
expect(afterDelete.cursorRow).toBe(0);
|
|
1749
|
+
expect(afterDelete.cursorCol).toBe(0);
|
|
1750
|
+
// Now paste multiline content - this should work correctly
|
|
1751
|
+
const pasteAction = {
|
|
1752
|
+
type: 'insert',
|
|
1753
|
+
payload: 'new1\nnew2\nnew3\nnew4',
|
|
1754
|
+
};
|
|
1755
|
+
const afterPaste = textBufferReducer(afterDelete, pasteAction);
|
|
1756
|
+
expect(afterPaste).toHaveOnlyValidCharacters();
|
|
1757
|
+
// All lines including the first one should be present
|
|
1758
|
+
expect(afterPaste.lines).toEqual(['new1', 'new2', 'new3', 'new4']);
|
|
1759
|
+
expect(afterPaste.cursorRow).toBe(3);
|
|
1760
|
+
expect(afterPaste.cursorCol).toBe(4);
|
|
1761
|
+
});
|
|
1762
|
+
});
|
|
1763
|
+
});
|
|
1764
|
+
describe('Unicode helper functions', () => {
|
|
1765
|
+
describe('findWordEndInLine with Unicode', () => {
|
|
1766
|
+
it('should handle combining characters', () => {
|
|
1767
|
+
// café with combining accent
|
|
1768
|
+
const cafeWithCombining = 'cafe\u0301';
|
|
1769
|
+
const result = findWordEndInLine(cafeWithCombining + ' test', 0);
|
|
1770
|
+
expect(result).toBe(3); // End of 'café' at base character 'e', not combining accent
|
|
1771
|
+
});
|
|
1772
|
+
it('should handle precomposed characters with diacritics', () => {
|
|
1773
|
+
// café with precomposed é (U+00E9)
|
|
1774
|
+
const cafePrecomposed = 'café';
|
|
1775
|
+
const result = findWordEndInLine(cafePrecomposed + ' test', 0);
|
|
1776
|
+
expect(result).toBe(3); // End of 'café' at precomposed character 'é'
|
|
1777
|
+
});
|
|
1778
|
+
it('should return null when no word end found', () => {
|
|
1779
|
+
const result = findWordEndInLine(' ', 0);
|
|
1780
|
+
expect(result).toBeNull(); // No word end found in whitespace-only string string
|
|
1781
|
+
});
|
|
1782
|
+
});
|
|
1783
|
+
describe('findNextWordStartInLine with Unicode', () => {
|
|
1784
|
+
it('should handle right-to-left text', () => {
|
|
1785
|
+
const result = findNextWordStartInLine('hello مرحبا world', 0);
|
|
1786
|
+
expect(result).toBe(6); // Start of Arabic word
|
|
1787
|
+
});
|
|
1788
|
+
it('should handle Chinese characters', () => {
|
|
1789
|
+
const result = findNextWordStartInLine('hello 你好 world', 0);
|
|
1790
|
+
expect(result).toBe(6); // Start of Chinese word
|
|
1791
|
+
});
|
|
1792
|
+
it('should return null at end of line', () => {
|
|
1793
|
+
const result = findNextWordStartInLine('hello', 10);
|
|
1794
|
+
expect(result).toBeNull();
|
|
1795
|
+
});
|
|
1796
|
+
it('should handle combining characters', () => {
|
|
1797
|
+
// café with combining accent + next word
|
|
1798
|
+
const textWithCombining = 'cafe\u0301 test';
|
|
1799
|
+
const result = findNextWordStartInLine(textWithCombining, 0);
|
|
1800
|
+
expect(result).toBe(6); // Start of 'test' after 'café ' (combining char makes string longer)
|
|
1801
|
+
});
|
|
1802
|
+
it('should handle precomposed characters with diacritics', () => {
|
|
1803
|
+
// café with precomposed é + next word
|
|
1804
|
+
const textPrecomposed = 'café test';
|
|
1805
|
+
const result = findNextWordStartInLine(textPrecomposed, 0);
|
|
1806
|
+
expect(result).toBe(5); // Start of 'test' after 'café '
|
|
1807
|
+
});
|
|
1808
|
+
});
|
|
1809
|
+
describe('isWordCharStrict with Unicode', () => {
|
|
1810
|
+
it('should return true for ASCII word characters', () => {
|
|
1811
|
+
expect(isWordCharStrict('a')).toBe(true);
|
|
1812
|
+
expect(isWordCharStrict('Z')).toBe(true);
|
|
1813
|
+
expect(isWordCharStrict('0')).toBe(true);
|
|
1814
|
+
expect(isWordCharStrict('_')).toBe(true);
|
|
1815
|
+
});
|
|
1816
|
+
it('should return false for punctuation', () => {
|
|
1817
|
+
expect(isWordCharStrict('.')).toBe(false);
|
|
1818
|
+
expect(isWordCharStrict(',')).toBe(false);
|
|
1819
|
+
expect(isWordCharStrict('!')).toBe(false);
|
|
1820
|
+
});
|
|
1821
|
+
it('should return true for non-Latin scripts', () => {
|
|
1822
|
+
expect(isWordCharStrict('你')).toBe(true); // Chinese character
|
|
1823
|
+
expect(isWordCharStrict('م')).toBe(true); // Arabic character
|
|
1824
|
+
});
|
|
1825
|
+
it('should return false for whitespace', () => {
|
|
1826
|
+
expect(isWordCharStrict(' ')).toBe(false);
|
|
1827
|
+
expect(isWordCharStrict('\t')).toBe(false);
|
|
1828
|
+
});
|
|
1829
|
+
});
|
|
1830
|
+
describe('cpLen with Unicode', () => {
|
|
1831
|
+
it('should handle combining characters', () => {
|
|
1832
|
+
expect(cpLen('é')).toBe(1); // Precomposed
|
|
1833
|
+
expect(cpLen('e\u0301')).toBe(2); // e + combining acute
|
|
1834
|
+
});
|
|
1835
|
+
it('should handle Chinese and Arabic text', () => {
|
|
1836
|
+
expect(cpLen('hello 你好 world')).toBe(14); // 5 + 1 + 2 + 1 + 5 = 14
|
|
1837
|
+
expect(cpLen('hello مرحبا world')).toBe(17);
|
|
1838
|
+
});
|
|
1839
|
+
});
|
|
1840
|
+
describe('useTextBuffer CJK Navigation', () => {
|
|
1841
|
+
const viewport = { width: 80, height: 24 };
|
|
1842
|
+
it('should navigate by word in Chinese', () => {
|
|
1843
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1844
|
+
initialText: '你好世界',
|
|
1845
|
+
initialCursorOffset: 4, // End of string
|
|
1846
|
+
viewport,
|
|
1847
|
+
isValidPath: () => false,
|
|
1848
|
+
}));
|
|
1849
|
+
// Initial state: cursor at end (index 2 in code points if 4 is length? wait. length is 2 code points? No. '你好世界' length is 4.)
|
|
1850
|
+
// '你好世界' length is 4. Code points length is 4.
|
|
1851
|
+
// Move word left
|
|
1852
|
+
act(() => {
|
|
1853
|
+
result.current.move('wordLeft');
|
|
1854
|
+
});
|
|
1855
|
+
// Should be at start of "世界" (index 2)
|
|
1856
|
+
// "你好世界" -> "你好" | "世界"
|
|
1857
|
+
expect(result.current.cursor[1]).toBe(2);
|
|
1858
|
+
// Move word left again
|
|
1859
|
+
act(() => {
|
|
1860
|
+
result.current.move('wordLeft');
|
|
1861
|
+
});
|
|
1862
|
+
// Should be at start of "你好" (index 0)
|
|
1863
|
+
expect(result.current.cursor[1]).toBe(0);
|
|
1864
|
+
// Move word left again (should stay at 0)
|
|
1865
|
+
act(() => {
|
|
1866
|
+
result.current.move('wordLeft');
|
|
1867
|
+
});
|
|
1868
|
+
expect(result.current.cursor[1]).toBe(0);
|
|
1869
|
+
// Move word right
|
|
1870
|
+
act(() => {
|
|
1871
|
+
result.current.move('wordRight');
|
|
1872
|
+
});
|
|
1873
|
+
// Should be at end of "你好" (index 2)
|
|
1874
|
+
expect(result.current.cursor[1]).toBe(2);
|
|
1875
|
+
// Move word right again
|
|
1876
|
+
act(() => {
|
|
1877
|
+
result.current.move('wordRight');
|
|
1878
|
+
});
|
|
1879
|
+
// Should be at end of "世界" (index 4)
|
|
1880
|
+
expect(result.current.cursor[1]).toBe(4);
|
|
1881
|
+
// Move word right again (should stay at end)
|
|
1882
|
+
act(() => {
|
|
1883
|
+
result.current.move('wordRight');
|
|
1884
|
+
});
|
|
1885
|
+
expect(result.current.cursor[1]).toBe(4);
|
|
1886
|
+
});
|
|
1887
|
+
it('should navigate mixed English and Chinese', () => {
|
|
1888
|
+
const { result } = renderHook(() => useTextBuffer({
|
|
1889
|
+
initialText: 'Hello你好World',
|
|
1890
|
+
initialCursorOffset: 10, // End
|
|
1891
|
+
viewport,
|
|
1892
|
+
isValidPath: () => false,
|
|
1893
|
+
}));
|
|
1894
|
+
// Hello (5) + 你好 (2) + World (5) = 12 chars.
|
|
1895
|
+
// initialCursorOffset 10? 'Hello你好World'.length is 12.
|
|
1896
|
+
// Let's set it to end.
|
|
1897
|
+
act(() => {
|
|
1898
|
+
result.current.move('end');
|
|
1899
|
+
});
|
|
1900
|
+
expect(result.current.cursor[1]).toBe(12);
|
|
1901
|
+
// wordLeft -> start of "World" (index 7)
|
|
1902
|
+
act(() => result.current.move('wordLeft'));
|
|
1903
|
+
expect(result.current.cursor[1]).toBe(7);
|
|
1904
|
+
// wordLeft -> start of "你好" (index 5)
|
|
1905
|
+
act(() => result.current.move('wordLeft'));
|
|
1906
|
+
expect(result.current.cursor[1]).toBe(5);
|
|
1907
|
+
// wordLeft -> start of "Hello" (index 0)
|
|
1908
|
+
act(() => result.current.move('wordLeft'));
|
|
1909
|
+
expect(result.current.cursor[1]).toBe(0);
|
|
1910
|
+
// wordLeft -> start of line (should stay at 0)
|
|
1911
|
+
act(() => result.current.move('wordLeft'));
|
|
1912
|
+
expect(result.current.cursor[1]).toBe(0);
|
|
1913
|
+
});
|
|
1914
|
+
});
|
|
1915
|
+
});
|
|
1916
|
+
//# sourceMappingURL=text-buffer.test.js.map
|