@machina.ai/cell-cli 1.20.2-rc1 → 1.25.0-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +5 -4
- package/dist/src/commands/extensions/configure.d.ts +13 -0
- package/dist/src/commands/extensions/configure.js +131 -0
- package/dist/src/commands/extensions/configure.js.map +1 -0
- package/dist/src/commands/extensions/configure.test.d.ts +1 -0
- package/dist/src/commands/extensions/configure.test.js +197 -0
- package/dist/src/commands/extensions/configure.test.js.map +1 -0
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/disable.test.js.map +1 -1
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/enable.test.js.map +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js.map +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.test.ts +4 -12
- package/dist/src/commands/extensions/install.js +7 -31
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +21 -3
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.test.js.map +1 -1
- package/dist/src/commands/extensions/list.test.js +0 -1
- package/dist/src/commands/extensions/list.test.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
- package/dist/src/commands/extensions/update.test.js.map +1 -1
- package/dist/src/commands/extensions/utils.d.ts +14 -0
- package/dist/src/commands/extensions/utils.js +33 -0
- package/dist/src/commands/extensions/utils.js.map +1 -0
- package/dist/src/commands/extensions/validate.js +1 -1
- package/dist/src/commands/extensions/validate.js.map +1 -1
- package/dist/src/commands/extensions/validate.test.js +1 -1
- package/dist/src/commands/extensions/validate.test.js.map +1 -1
- package/dist/src/commands/extensions.js +2 -0
- package/dist/src/commands/extensions.js.map +1 -1
- 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.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.js +4 -2
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/add.test.js +24 -2
- package/dist/src/commands/mcp/add.test.js.map +1 -1
- package/dist/src/commands/mcp/list.js +7 -1
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/skills/disable.d.ts +14 -0
- package/dist/src/commands/skills/disable.js +45 -0
- package/dist/src/commands/skills/disable.js.map +1 -0
- package/dist/src/commands/skills/disable.test.d.ts +6 -0
- package/dist/src/commands/skills/disable.test.js +80 -0
- package/dist/src/commands/skills/disable.test.js.map +1 -0
- package/dist/src/commands/skills/enable.d.ts +12 -0
- package/dist/src/commands/skills/enable.js +35 -0
- package/dist/src/commands/skills/enable.js.map +1 -0
- package/dist/src/commands/skills/enable.test.d.ts +6 -0
- package/dist/src/commands/skills/enable.test.js +107 -0
- package/dist/src/commands/skills/enable.test.js.map +1 -0
- package/dist/src/commands/skills/install.d.ts +14 -0
- package/dist/src/commands/skills/install.js +61 -0
- package/dist/src/commands/skills/install.js.map +1 -0
- package/dist/src/commands/skills/install.test.d.ts +6 -0
- package/dist/src/commands/skills/install.test.js +57 -0
- package/dist/src/commands/skills/install.test.js.map +1 -0
- package/dist/src/commands/skills/list.d.ts +10 -0
- package/dist/src/commands/skills/list.js +60 -0
- package/dist/src/commands/skills/list.js.map +1 -0
- package/dist/src/commands/skills/list.test.d.ts +6 -0
- package/dist/src/commands/skills/list.test.js +136 -0
- package/dist/src/commands/skills/list.test.js.map +1 -0
- package/dist/src/commands/skills/uninstall.d.ts +13 -0
- package/dist/src/commands/skills/uninstall.js +56 -0
- package/dist/src/commands/skills/uninstall.js.map +1 -0
- package/dist/src/commands/skills/uninstall.test.d.ts +6 -0
- package/dist/src/commands/skills/uninstall.test.js +61 -0
- package/dist/src/commands/skills/uninstall.test.js.map +1 -0
- package/dist/src/commands/skills.d.ts +7 -0
- package/dist/src/commands/skills.js +30 -0
- package/dist/src/commands/skills.js.map +1 -0
- package/dist/src/commands/skills.test.d.ts +6 -0
- package/dist/src/commands/skills.test.js +49 -0
- package/dist/src/commands/skills.test.js.map +1 -0
- package/dist/src/config/config.d.ts +10 -3
- package/dist/src/config/config.js +101 -34
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +225 -16
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager-agents.test.d.ts +6 -0
- package/dist/src/config/extension-manager-agents.test.js +115 -0
- package/dist/src/config/extension-manager-agents.test.js.map +1 -0
- package/dist/src/config/extension-manager-scope.test.js +164 -0
- package/dist/src/config/extension-manager-scope.test.js.map +1 -0
- package/dist/src/config/extension-manager-skills.test.js +150 -0
- package/dist/src/config/extension-manager-skills.test.js.map +1 -0
- package/dist/src/config/extension-manager.d.ts +7 -1
- package/dist/src/config/extension-manager.js +202 -37
- package/dist/src/config/extension-manager.js.map +1 -1
- package/dist/src/config/extension.test.js +178 -13
- package/dist/src/config/extension.test.js.map +1 -1
- package/dist/src/config/extensions/consent.d.ts +5 -3
- package/dist/src/config/extensions/consent.js +33 -7
- package/dist/src/config/extensions/consent.js.map +1 -1
- package/dist/src/config/extensions/consent.test.js +114 -10
- package/dist/src/config/extensions/consent.test.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.d.ts +9 -1
- package/dist/src/config/extensions/extensionSettings.js +107 -17
- package/dist/src/config/extensions/extensionSettings.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.test.js +189 -54
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -1
- package/dist/src/config/extensions/extensionUpdates.test.js +231 -0
- package/dist/src/config/extensions/extensionUpdates.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +4 -1
- package/dist/src/config/extensions/github.js +33 -7
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +190 -2
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/github_fetch.js.map +1 -1
- package/dist/src/config/extensions/storage.js +2 -2
- package/dist/src/config/extensions/storage.js.map +1 -1
- package/dist/src/config/extensions/update.js +1 -1
- package/dist/src/config/extensions/update.js.map +1 -1
- package/dist/src/config/extensions/update.test.js +8 -8
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +14 -2
- package/dist/src/config/keyBindings.js +89 -11
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/policy-engine.integration.test.js +13 -1
- package/dist/src/config/policy-engine.integration.test.js.map +1 -1
- 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 +370 -0
- package/dist/src/config/settings-validation.test.js.map +1 -0
- package/dist/src/config/settings.d.ts +9 -7
- package/dist/src/config/settings.js +138 -233
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +245 -571
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +459 -35
- package/dist/src/config/settingsSchema.js +541 -32
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +22 -4
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- 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/settings_validation_warning.test.d.ts +6 -0
- package/dist/src/config/settings_validation_warning.test.js +123 -0
- package/dist/src/config/settings_validation_warning.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +1 -0
- package/dist/src/config/trustedFolders.js +18 -4
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +45 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/gemini.js +135 -69
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +85 -99
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.js +7 -0
- package/dist/src/gemini_cleanup.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +3 -3
- package/dist/src/generated/git-commit.js +3 -3
- package/dist/src/nonInteractiveCli.js +59 -9
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +114 -21
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +66 -8
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +70 -12
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FeedbackService.js.map +1 -1
- package/dist/src/services/FileCommandLoader.js +6 -6
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/FileCommandLoader.test.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +1 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +40 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.js +13 -11
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.test.js +93 -61
- package/dist/src/services/prompt-processors/shellProcessor.test.js.map +1 -1
- package/dist/src/test-utils/render.js +5 -2
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/App.test.js +2 -2
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.js +200 -94
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +405 -69
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.test.js +18 -7
- package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.js +36 -3
- package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.test.js +26 -2
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.d.ts +4 -1
- package/dist/src/ui/auth/AuthDialog.js +11 -4
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +19 -2
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthInProgress.test.js +16 -6
- package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -1
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.d.ts +10 -0
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js +27 -0
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js.map +1 -0
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +68 -0
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +1 -0
- package/dist/src/ui/auth/useAuth.js +9 -4
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/auth/useAuth.test.js +2 -2
- package/dist/src/ui/auth/useAuth.test.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +3 -4
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.test.js +7 -10
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
- package/dist/src/ui/commands/agentsCommand.js +79 -0
- package/dist/src/ui/commands/agentsCommand.js.map +1 -0
- package/dist/src/ui/commands/agentsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/agentsCommand.test.js +91 -0
- package/dist/src/ui/commands/agentsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.js +30 -3
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/authCommand.test.js +72 -4
- package/dist/src/ui/commands/authCommand.test.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +37 -6
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.test.js +86 -5
- package/dist/src/ui/commands/bugCommand.test.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +1 -2
- package/dist/src/ui/commands/chatCommand.js +52 -52
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.test.js +95 -69
- package/dist/src/ui/commands/chatCommand.test.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +22 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.test.js +6 -0
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.js +1 -1
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +27 -10
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.js +49 -11
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +194 -24
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.js +217 -27
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.js +1 -1
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.test.js +1 -1
- package/dist/src/ui/commands/helpCommand.test.js.map +1 -1
- package/dist/src/ui/commands/hooksCommand.d.ts +7 -0
- package/dist/src/ui/commands/hooksCommand.js +342 -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 +575 -0
- package/dist/src/ui/commands/hooksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.test.js.map +1 -1
- package/dist/src/ui/commands/initCommand.js +10 -50
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.test.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +34 -16
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.js +43 -6
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +19 -33
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.test.js +112 -16
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.js +10 -5
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.test.js +12 -1
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +1 -1
- package/dist/src/ui/commands/restoreCommand.js +38 -33
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.test.js +6 -6
- package/dist/src/ui/commands/restoreCommand.test.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.d.ts +7 -0
- package/dist/src/ui/commands/skillsCommand.js +235 -0
- package/dist/src/ui/commands/skillsCommand.js.map +1 -0
- package/dist/src/ui/commands/skillsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/skillsCommand.test.js +405 -0
- package/dist/src/ui/commands/skillsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.js +6 -10
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.test.js +20 -3
- package/dist/src/ui/commands/statsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/terminalSetupCommand.js +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +2 -2
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.test.js +2 -2
- package/dist/src/ui/commands/toolsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +16 -38
- package/dist/src/ui/commands/types.js +1 -0
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.js +1 -1
- package/dist/src/ui/components/AnsiOutput.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +8 -0
- package/dist/src/ui/components/AppHeader.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +6 -6
- package/dist/src/ui/components/AsciiArt.js +6 -6
- package/dist/src/ui/components/Composer.js +7 -7
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +23 -4
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js +12 -5
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.test.js +56 -25
- package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js +3 -3
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js +2 -12
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +3 -3
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +2 -1
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.test.js +10 -2
- package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.js +20 -14
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +12 -2
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.js +6 -6
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +3 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -1
- package/dist/src/ui/components/Header.js +3 -1
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Header.test.js +3 -1
- package/dist/src/ui/components/Header.test.js.map +1 -1
- package/dist/src/ui/components/Help.js +1 -1
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +4 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +21 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/HookStatusDisplay.d.ts +12 -0
- package/dist/src/ui/components/HookStatusDisplay.js +20 -0
- package/dist/src/ui/components/HookStatusDisplay.js.map +1 -0
- package/dist/src/ui/components/HookStatusDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HookStatusDisplay.test.js +51 -0
- package/dist/src/ui/components/HookStatusDisplay.test.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js +3 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +4 -3
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +77 -26
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +307 -7
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/LogoutConfirmationDialog.d.ts +15 -0
- package/dist/src/ui/components/LogoutConfirmationDialog.js +37 -0
- package/dist/src/ui/components/LogoutConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/LogoutConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/LogoutConfirmationDialog.test.js +59 -0
- package/dist/src/ui/components/LogoutConfirmationDialog.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.js +12 -10
- package/dist/src/ui/components/MainContent.js.map +1 -1
- package/dist/src/ui/components/MainContent.test.js +19 -9
- package/dist/src/ui/components/MainContent.test.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +122 -41
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +171 -148
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js +68 -14
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js +62 -4
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.d.ts +2 -2
- package/dist/src/ui/components/MultiFolderTrustDialog.js +3 -2
- package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js +9 -9
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.js +5 -4
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/Notifications.test.js +1 -0
- package/dist/src/ui/components/Notifications.test.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.d.ts +1 -3
- package/dist/src/ui/components/ProQuotaDialog.js +16 -32
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +43 -29
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.js +2 -0
- package/dist/src/ui/components/SessionBrowser.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.js +166 -77
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +118 -13
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +4 -4
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +4 -4
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.js +66 -21
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +44 -7
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StatusDisplay.d.ts +11 -0
- package/dist/src/ui/components/StatusDisplay.js +40 -0
- package/dist/src/ui/components/StatusDisplay.js.map +1 -0
- package/dist/src/ui/components/StatusDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/StatusDisplay.test.js +144 -0
- package/dist/src/ui/components/StatusDisplay.test.js.map +1 -0
- package/dist/src/ui/components/StickyHeader.d.ts +2 -0
- package/dist/src/ui/components/StickyHeader.js +1 -1
- package/dist/src/ui/components/StickyHeader.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +7 -2
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/Table.d.ts +21 -0
- package/dist/src/ui/components/Table.js +7 -0
- package/dist/src/ui/components/Table.js.map +1 -0
- package/dist/src/ui/components/Table.test.d.ts +6 -0
- package/dist/src/ui/components/Table.test.js +53 -0
- package/dist/src/ui/components/Table.test.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.js +63 -17
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +66 -1
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +5 -13
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js +26 -17
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.js +8 -5
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +55 -24
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +40 -4
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +45 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +6 -2
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +1 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.js +22 -16
- package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js +36 -18
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +134 -0
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +2 -38
- package/dist/src/ui/components/shared/MaxSizedBox.js +34 -418
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +48 -133
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +4 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +11 -10
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +40 -4
- package/dist/src/ui/components/shared/text-buffer.js +279 -102
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +247 -1
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js +3 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -1
- package/dist/src/ui/components/views/AgentsStatus.d.ts +13 -0
- package/dist/src/ui/components/views/AgentsStatus.js +23 -0
- package/dist/src/ui/components/views/AgentsStatus.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.js +3 -2
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.test.js +37 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
- package/dist/src/ui/components/views/HooksList.d.ts +24 -0
- package/dist/src/ui/components/views/HooksList.js +28 -0
- package/dist/src/ui/components/views/HooksList.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +2 -1
- package/dist/src/ui/components/views/McpStatus.js +18 -3
- package/dist/src/ui/components/views/McpStatus.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +23 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/components/views/SkillsList.d.ts +13 -0
- package/dist/src/ui/components/views/SkillsList.js +17 -0
- package/dist/src/ui/components/views/SkillsList.js.map +1 -0
- package/dist/src/ui/components/views/SkillsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/SkillsList.test.js +97 -0
- package/dist/src/ui/components/views/SkillsList.test.js.map +1 -0
- package/dist/src/ui/constants/tips.js +1 -5
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/constants.d.ts +4 -3
- package/dist/src/ui/constants.js +5 -6
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +1 -0
- package/dist/src/ui/contexts/KeypressContext.js +84 -6
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +136 -9
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +1 -0
- package/dist/src/ui/contexts/SessionContext.js +2 -1
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.test.js +3 -0
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +3 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +5 -1
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/contexts/VimModeContext.js +1 -1
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +7 -6
- package/dist/src/ui/hooks/atCommandProcessor.js +156 -29
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +133 -35
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.js +183 -0
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +2 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +21 -7
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +2 -3
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +83 -2
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.js +21 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion_agents.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAtCompletion_agents.test.js +85 -0
- package/dist/src/ui/hooks/useAtCompletion_agents.test.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +2 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +5 -4
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +3 -0
- package/dist/src/ui/hooks/useCommandCompletion.js +13 -8
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +88 -2
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.js +7 -7
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +20 -4
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +14 -19
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +31 -23
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +2 -1
- package/dist/src/ui/hooks/useGeminiStream.js +102 -71
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +294 -10
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +3 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.d.ts +1 -1
- package/dist/src/ui/hooks/useHistoryManager.js +1 -1
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.js +16 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -1
- package/dist/src/ui/hooks/useHookDisplayState.d.ts +7 -0
- package/dist/src/ui/hooks/useHookDisplayState.js +83 -0
- package/dist/src/ui/hooks/useHookDisplayState.js.map +1 -0
- package/dist/src/ui/hooks/useHookDisplayState.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHookDisplayState.test.js +180 -0
- package/dist/src/ui/hooks/useHookDisplayState.test.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js +2 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.js +6 -4
- package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +2 -2
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +2 -2
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +2 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +7 -3
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +15 -4
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +10 -3
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +5 -16
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js +3 -9
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.js +1 -2
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.js +19 -18
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +29 -23
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useRewind.d.ts +14 -0
- package/dist/src/ui/hooks/useRewind.js +31 -0
- package/dist/src/ui/hooks/useRewind.js.map +1 -0
- package/dist/src/ui/hooks/useRewind.test.d.ts +6 -0
- package/dist/src/ui/hooks/useRewind.test.js +100 -0
- package/dist/src/ui/hooks/useRewind.test.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.js +2 -1
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.test.js +2 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.js +3 -3
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.test.js +4 -10
- package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.js +1 -0
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.js +5 -3
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +2 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +29 -11
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +115 -5
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/{utils/version.d.ts → ui/hooks/useSnowfall.d.ts} +1 -1
- package/dist/src/ui/hooks/useSnowfall.js +126 -0
- package/dist/src/ui/hooks/useSnowfall.js.map +1 -0
- package/dist/src/ui/hooks/useSnowfall.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSnowfall.test.js +88 -0
- package/dist/src/ui/hooks/useSnowfall.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +86 -53
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.js +7 -0
- package/dist/src/ui/hooks/vim.test.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +79 -53
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +1 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/color-utils.d.ts +1 -0
- package/dist/src/ui/themes/color-utils.js +13 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -1
- package/dist/src/ui/themes/color-utils.test.js +20 -1
- package/dist/src/ui/themes/color-utils.test.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +1 -1
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +5 -0
- package/dist/src/ui/themes/theme-manager.js +9 -3
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.js +7 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +12 -0
- package/dist/src/ui/themes/theme.js +34 -4
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/theme.test.js +23 -0
- package/dist/src/ui/themes/theme.test.js.map +1 -1
- package/dist/src/ui/types.d.ts +48 -5
- package/dist/src/ui/types.js +5 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +2 -2
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.test.js +1 -1
- package/dist/src/ui/utils/CodeColorizer.test.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.js +1 -0
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +2 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.d.ts +27 -2
- package/dist/src/ui/utils/clipboardUtils.js +148 -16
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.js +135 -13
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.windows.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.windows.test.js +52 -0
- package/dist/src/ui/utils/clipboardUtils.windows.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +1 -1
- package/dist/src/ui/utils/commandUtils.js +111 -1
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +200 -6
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/computeStats.js +2 -0
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/computeStats.test.js +9 -0
- package/dist/src/ui/utils/computeStats.test.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.d.ts +8 -0
- package/dist/src/ui/utils/directoryUtils.js +95 -3
- package/dist/src/ui/utils/directoryUtils.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.test.js +193 -3
- package/dist/src/ui/utils/directoryUtils.test.js.map +1 -1
- package/dist/src/ui/utils/highlight.d.ts +3 -2
- package/dist/src/ui/utils/highlight.js +51 -37
- package/dist/src/ui/utils/highlight.js.map +1 -1
- package/dist/src/ui/utils/highlight.test.js +75 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -1
- package/dist/src/ui/utils/historyExportUtils.d.ts +21 -0
- package/dist/src/ui/utils/historyExportUtils.js +59 -0
- package/dist/src/ui/utils/historyExportUtils.js.map +1 -0
- package/dist/src/ui/utils/rewindFileOps.d.ts +47 -0
- package/dist/src/ui/utils/rewindFileOps.js +190 -0
- package/dist/src/ui/utils/rewindFileOps.js.map +1 -0
- package/dist/src/ui/utils/rewindFileOps.test.d.ts +6 -0
- package/dist/src/ui/utils/rewindFileOps.test.js +375 -0
- package/dist/src/ui/utils/rewindFileOps.test.js.map +1 -0
- package/dist/src/ui/utils/terminalCapabilityManager.d.ts +41 -0
- package/dist/src/ui/utils/terminalCapabilityManager.js +209 -0
- package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -0
- package/dist/src/ui/utils/terminalCapabilityManager.test.d.ts +6 -0
- package/dist/src/ui/utils/terminalCapabilityManager.test.js +221 -0
- package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +1 -1
- package/dist/src/ui/utils/terminalSetup.js +21 -6
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.test.js +16 -2
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -1
- package/dist/src/ui/utils/textUtils.js +9 -1
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.js +12 -1
- package/dist/src/ui/utils/textUtils.test.js.map +1 -1
- package/dist/src/ui/utils/ui-sizing.js +1 -1
- package/dist/src/ui/utils/ui-sizing.js.map +1 -1
- package/dist/src/ui/utils/ui-sizing.test.js +2 -2
- package/dist/src/ui/utils/ui-sizing.test.js.map +1 -1
- package/dist/src/utils/activityLogger.d.ts +47 -0
- package/dist/src/utils/activityLogger.js +297 -0
- package/dist/src/utils/activityLogger.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +11 -0
- package/dist/src/utils/cleanup.js +36 -1
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/cleanup.test.js +21 -31
- package/dist/src/utils/cleanup.test.js.map +1 -1
- package/dist/src/utils/deepMerge.js +7 -2
- package/dist/src/utils/deepMerge.js.map +1 -1
- package/dist/src/utils/deepMerge.test.js +58 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/envVarResolver.test.js.map +1 -1
- package/dist/src/utils/errors.js +13 -14
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.js +115 -39
- package/dist/src/utils/errors.test.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +1 -1
- package/dist/src/utils/handleAutoUpdate.js +7 -10
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +12 -10
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
- package/dist/src/utils/installationInfo.js +1 -1
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +1 -1
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/processUtils.d.ts +1 -1
- package/dist/src/utils/processUtils.js +1 -1
- package/dist/src/utils/processUtils.js.map +1 -1
- package/dist/src/utils/readStdin.js +7 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/readStdin.test.js +4 -0
- package/dist/src/utils/readStdin.test.js.map +1 -1
- package/dist/src/utils/readStdin_safety.test.d.ts +6 -0
- package/dist/src/utils/readStdin_safety.test.js +68 -0
- package/dist/src/utils/readStdin_safety.test.js.map +1 -0
- package/dist/src/utils/relaunch.js +3 -1
- package/dist/src/utils/relaunch.js.map +1 -1
- package/dist/src/utils/relaunch.test.js +13 -7
- package/dist/src/utils/relaunch.test.js.map +1 -1
- package/dist/src/utils/resolvePath.js +3 -3
- package/dist/src/utils/resolvePath.js.map +1 -1
- package/dist/src/utils/resolvePath.test.js +3 -0
- package/dist/src/utils/resolvePath.test.js.map +1 -1
- package/dist/src/utils/sandbox.js +27 -17
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sandbox.test.js +17 -5
- package/dist/src/utils/sandbox.test.js.map +1 -1
- package/dist/src/utils/sandboxUtils.js +3 -2
- package/dist/src/utils/sandboxUtils.js.map +1 -1
- package/dist/src/utils/sandboxUtils.test.js +3 -0
- package/dist/src/utils/sandboxUtils.test.js.map +1 -1
- package/dist/src/utils/sessionCleanup.integration.test.js +2 -2
- package/dist/src/utils/sessionCleanup.integration.test.js.map +1 -1
- package/dist/src/utils/sessionCleanup.js +16 -4
- package/dist/src/utils/sessionCleanup.js.map +1 -1
- package/dist/src/utils/sessionCleanup.test.js +18 -68
- package/dist/src/utils/sessionCleanup.test.js.map +1 -1
- package/dist/src/utils/sessionUtils.d.ts +22 -0
- package/dist/src/utils/sessionUtils.js +37 -5
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +3 -3
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/sessions.js +14 -12
- package/dist/src/utils/sessions.js.map +1 -1
- package/dist/src/utils/sessions.test.js +62 -39
- package/dist/src/utils/sessions.test.js.map +1 -1
- package/dist/src/utils/settingsUtils.js +0 -5
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/skillSettings.d.ts +33 -0
- package/dist/src/utils/skillSettings.js +101 -0
- package/dist/src/utils/skillSettings.js.map +1 -0
- package/dist/src/utils/skillUtils.d.ts +29 -0
- package/dist/src/utils/skillUtils.js +144 -0
- package/dist/src/utils/skillUtils.js.map +1 -0
- package/dist/src/utils/skillUtils.test.d.ts +6 -0
- package/dist/src/utils/skillUtils.test.js +57 -0
- package/dist/src/utils/skillUtils.test.js.map +1 -0
- package/dist/src/utils/terminalTheme.d.ts +15 -0
- package/dist/src/utils/terminalTheme.js +50 -0
- package/dist/src/utils/terminalTheme.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +2 -1
- package/dist/src/utils/userStartupWarnings.js +17 -7
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.js +37 -6
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
- package/dist/src/utils/windowTitle.d.ts +13 -4
- package/dist/src/utils/windowTitle.js +65 -7
- package/dist/src/utils/windowTitle.js.map +1 -1
- package/dist/src/utils/windowTitle.test.js +183 -40
- package/dist/src/utils/windowTitle.test.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +1 -1
- package/dist/src/validateNonInterActiveAuth.js +1 -2
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +3 -4
- package/dist/src/zed-integration/fileSystemService.js +5 -10
- package/dist/src/zed-integration/fileSystemService.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.test.js +11 -21
- package/dist/src/zed-integration/fileSystemService.test.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +5 -5
- package/dist/src/zed-integration/zedIntegration.js +54 -24
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.test.js +29 -18
- package/dist/src/zed-integration/zedIntegration.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
- package/dist/src/ui/hooks/useBracketedPaste.js +0 -31
- package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
- package/dist/src/ui/utils/bracketedPaste.d.ts +0 -7
- package/dist/src/ui/utils/bracketedPaste.js +0 -15
- package/dist/src/ui/utils/bracketedPaste.js.map +0 -1
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +0 -17
- package/dist/src/ui/utils/kittyProtocolDetector.js +0 -111
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +0 -1
- package/dist/src/ui/utils/kittyProtocolDetector.test.js +0 -113
- package/dist/src/ui/utils/kittyProtocolDetector.test.js.map +0 -1
- package/dist/src/utils/version.js +0 -15
- package/dist/src/utils/version.js.map +0 -1
- package/dist/src/utils/version.test.js +0 -39
- package/dist/src/utils/version.test.js.map +0 -1
- package/dist/src/zed-integration/acp.d.ts +0 -41
- package/dist/src/zed-integration/acp.js +0 -72
- package/dist/src/zed-integration/acp.js.map +0 -1
- package/dist/src/zed-integration/acp.test.js +0 -222
- package/dist/src/zed-integration/acp.test.js.map +0 -1
- package/dist/src/zed-integration/connection.d.ts +0 -28
- package/dist/src/zed-integration/connection.js +0 -163
- package/dist/src/zed-integration/connection.js.map +0 -1
- package/dist/src/zed-integration/connection.test.js +0 -175
- package/dist/src/zed-integration/connection.test.js.map +0 -1
- package/dist/src/zed-integration/schema.d.ts +0 -11792
- package/dist/src/zed-integration/schema.js +0 -311
- package/dist/src/zed-integration/schema.js.map +0 -1
- /package/dist/src/{ui/utils/kittyProtocolDetector.test.d.ts → commands/hooks/migrate.test.d.ts} +0 -0
- /package/dist/src/{utils/version.test.d.ts → config/extension-manager-scope.test.d.ts} +0 -0
- /package/dist/src/{zed-integration/acp.test.d.ts → config/extension-manager-skills.test.d.ts} +0 -0
- /package/dist/src/{zed-integration/connection.test.d.ts → config/extensions/extensionUpdates.test.d.ts} +0 -0
|
@@ -7,18 +7,13 @@ import { spawnSync } from 'node:child_process';
|
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
import pathMod from 'node:path';
|
|
10
|
+
import * as path from 'node:path';
|
|
10
11
|
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
|
11
|
-
import { unescapePath,
|
|
12
|
+
import { coreEvents, CoreEvent, debugLogger, unescapePath, getEditorCommand, isGuiEditor, } from '@google/gemini-cli-core';
|
|
12
13
|
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, getCachedStringWidth, } from '../../utils/textUtils.js';
|
|
14
|
+
import { parsePastedPaths } from '../../utils/clipboardUtils.js';
|
|
15
|
+
import { keyMatchers, Command } from '../../keyMatchers.js';
|
|
13
16
|
import { handleVimAction } from './vim-buffer-actions.js';
|
|
14
|
-
import { enableSupportedProtocol } from '../../utils/kittyProtocolDetector.js';
|
|
15
|
-
// Simple helper for word‑wise ops.
|
|
16
|
-
function isWordChar(ch) {
|
|
17
|
-
if (ch === undefined) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return !/[\s,.;!?]/.test(ch);
|
|
21
|
-
}
|
|
22
17
|
// Helper functions for line-based word navigation
|
|
23
18
|
export const isWordCharStrict = (char) => /[\w\p{L}\p{N}]/u.test(char); // Matches a single character that is any Unicode letter, any Unicode number, or an underscore
|
|
24
19
|
export const isWhitespace = (char) => /\s/.test(char);
|
|
@@ -191,6 +186,41 @@ export const findWordEndInLine = (line, col) => {
|
|
|
191
186
|
}
|
|
192
187
|
return null;
|
|
193
188
|
};
|
|
189
|
+
// Initialize segmenter for word boundary detection
|
|
190
|
+
const segmenter = new Intl.Segmenter(undefined, { granularity: 'word' });
|
|
191
|
+
function findPrevWordBoundary(line, cursorCol) {
|
|
192
|
+
const codePoints = toCodePoints(line);
|
|
193
|
+
// Convert cursorCol (CP index) to string index
|
|
194
|
+
const prefix = codePoints.slice(0, cursorCol).join('');
|
|
195
|
+
const cursorIdx = prefix.length;
|
|
196
|
+
let targetIdx = 0;
|
|
197
|
+
for (const seg of segmenter.segment(line)) {
|
|
198
|
+
// We want the last word start strictly before the cursor.
|
|
199
|
+
// If we've reached or passed the cursor, we stop.
|
|
200
|
+
if (seg.index >= cursorIdx)
|
|
201
|
+
break;
|
|
202
|
+
if (seg.isWordLike) {
|
|
203
|
+
targetIdx = seg.index;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return toCodePoints(line.slice(0, targetIdx)).length;
|
|
207
|
+
}
|
|
208
|
+
function findNextWordBoundary(line, cursorCol) {
|
|
209
|
+
const codePoints = toCodePoints(line);
|
|
210
|
+
const prefix = codePoints.slice(0, cursorCol).join('');
|
|
211
|
+
const cursorIdx = prefix.length;
|
|
212
|
+
let targetIdx = line.length;
|
|
213
|
+
for (const seg of segmenter.segment(line)) {
|
|
214
|
+
const segEnd = seg.index + seg.segment.length;
|
|
215
|
+
if (segEnd > cursorIdx) {
|
|
216
|
+
if (seg.isWordLike) {
|
|
217
|
+
targetIdx = segEnd;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return toCodePoints(line.slice(0, targetIdx)).length;
|
|
223
|
+
}
|
|
194
224
|
// Find next word across lines
|
|
195
225
|
export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
|
|
196
226
|
// First try current line
|
|
@@ -455,24 +485,136 @@ export function logicalPosToOffset(lines, row, col) {
|
|
|
455
485
|
}
|
|
456
486
|
return offset;
|
|
457
487
|
}
|
|
488
|
+
export const imagePathRegex = /@((?:\\.|[^\s\r\n\\])+?\.(?:png|jpg|jpeg|gif|webp|svg|bmp))\b/gi;
|
|
489
|
+
export function getTransformedImagePath(filePath) {
|
|
490
|
+
const raw = filePath;
|
|
491
|
+
// Ignore leading @ when stripping directories, but keep it for simple '@file.png'
|
|
492
|
+
const withoutAt = raw.startsWith('@') ? raw.slice(1) : raw;
|
|
493
|
+
// Unescape the path to handle escaped spaces and other characters
|
|
494
|
+
const unescaped = unescapePath(withoutAt);
|
|
495
|
+
// Find last directory separator, supporting both POSIX and Windows styles
|
|
496
|
+
const lastSepIndex = Math.max(unescaped.lastIndexOf('/'), unescaped.lastIndexOf('\\'));
|
|
497
|
+
// If we saw a separator, take the segment after it; otherwise fall back to the unescaped string
|
|
498
|
+
const fileName = lastSepIndex >= 0 ? unescaped.slice(lastSepIndex + 1) : unescaped;
|
|
499
|
+
const extension = path.extname(fileName);
|
|
500
|
+
const baseName = path.basename(fileName, extension);
|
|
501
|
+
const maxBaseLength = 10;
|
|
502
|
+
const truncatedBase = baseName.length > maxBaseLength
|
|
503
|
+
? `...${baseName.slice(-maxBaseLength)}`
|
|
504
|
+
: baseName;
|
|
505
|
+
return `[Image ${truncatedBase}${extension}]`;
|
|
506
|
+
}
|
|
507
|
+
export function calculateTransformationsForLine(line) {
|
|
508
|
+
const transformations = [];
|
|
509
|
+
let match;
|
|
510
|
+
// Reset regex state to ensure clean matching from start of line
|
|
511
|
+
imagePathRegex.lastIndex = 0;
|
|
512
|
+
while ((match = imagePathRegex.exec(line)) !== null) {
|
|
513
|
+
const logicalText = match[0];
|
|
514
|
+
const logStart = cpLen(line.substring(0, match.index));
|
|
515
|
+
const logEnd = logStart + cpLen(logicalText);
|
|
516
|
+
transformations.push({
|
|
517
|
+
logStart,
|
|
518
|
+
logEnd,
|
|
519
|
+
logicalText,
|
|
520
|
+
collapsedText: getTransformedImagePath(logicalText),
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
return transformations;
|
|
524
|
+
}
|
|
525
|
+
export function calculateTransformations(lines) {
|
|
526
|
+
return lines.map((ln) => calculateTransformationsForLine(ln));
|
|
527
|
+
}
|
|
528
|
+
export function getTransformUnderCursor(row, col, spansByLine) {
|
|
529
|
+
const spans = spansByLine[row];
|
|
530
|
+
if (!spans || spans.length === 0)
|
|
531
|
+
return null;
|
|
532
|
+
for (const span of spans) {
|
|
533
|
+
if (col >= span.logStart && col <= span.logEnd) {
|
|
534
|
+
return span;
|
|
535
|
+
}
|
|
536
|
+
if (col < span.logStart)
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
return null;
|
|
540
|
+
}
|
|
541
|
+
export function calculateTransformedLine(logLine, logIndex, logicalCursor, transformations) {
|
|
542
|
+
let transformedLine = '';
|
|
543
|
+
const transformedToLogMap = [];
|
|
544
|
+
let lastLogPos = 0;
|
|
545
|
+
const cursorIsOnThisLine = logIndex === logicalCursor[0];
|
|
546
|
+
const cursorCol = logicalCursor[1];
|
|
547
|
+
for (const transform of transformations) {
|
|
548
|
+
const textBeforeTransformation = cpSlice(logLine, lastLogPos, transform.logStart);
|
|
549
|
+
transformedLine += textBeforeTransformation;
|
|
550
|
+
for (let i = 0; i < cpLen(textBeforeTransformation); i++) {
|
|
551
|
+
transformedToLogMap.push(lastLogPos + i);
|
|
552
|
+
}
|
|
553
|
+
const isExpanded = cursorIsOnThisLine &&
|
|
554
|
+
cursorCol >= transform.logStart &&
|
|
555
|
+
cursorCol <= transform.logEnd;
|
|
556
|
+
const transformedText = isExpanded
|
|
557
|
+
? transform.logicalText
|
|
558
|
+
: transform.collapsedText;
|
|
559
|
+
transformedLine += transformedText;
|
|
560
|
+
// Map transformed characters back to logical characters
|
|
561
|
+
const transformedLen = cpLen(transformedText);
|
|
562
|
+
if (isExpanded) {
|
|
563
|
+
for (let i = 0; i < transformedLen; i++) {
|
|
564
|
+
transformedToLogMap.push(transform.logStart + i);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
// Collapsed: distribute transformed positions monotonically across the raw span.
|
|
569
|
+
// This preserves ordering across wrapped slices so logicalToVisualMap has
|
|
570
|
+
// increasing startColInLogical and visual cursor mapping remains consistent.
|
|
571
|
+
const logicalLength = Math.max(0, transform.logEnd - transform.logStart);
|
|
572
|
+
for (let i = 0; i < transformedLen; i++) {
|
|
573
|
+
// Map the i-th transformed code point into [logStart, logEnd)
|
|
574
|
+
const transformationToLogicalOffset = logicalLength === 0
|
|
575
|
+
? 0
|
|
576
|
+
: Math.floor((i * logicalLength) / transformedLen);
|
|
577
|
+
const transformationToLogicalIndex = transform.logStart +
|
|
578
|
+
Math.min(transformationToLogicalOffset, Math.max(logicalLength - 1, 0));
|
|
579
|
+
transformedToLogMap.push(transformationToLogicalIndex);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
lastLogPos = transform.logEnd;
|
|
583
|
+
}
|
|
584
|
+
// Append text after last transform
|
|
585
|
+
const remainingUntransformedText = cpSlice(logLine, lastLogPos);
|
|
586
|
+
transformedLine += remainingUntransformedText;
|
|
587
|
+
for (let i = 0; i < cpLen(remainingUntransformedText); i++) {
|
|
588
|
+
transformedToLogMap.push(lastLogPos + i);
|
|
589
|
+
}
|
|
590
|
+
// For a cursor at the very end of the transformed line
|
|
591
|
+
transformedToLogMap.push(cpLen(logLine));
|
|
592
|
+
return { transformedLine, transformedToLogMap };
|
|
593
|
+
}
|
|
458
594
|
// Calculates the visual wrapping of lines and the mapping between logical and visual coordinates.
|
|
459
595
|
// This is an expensive operation and should be memoized.
|
|
460
|
-
function calculateLayout(logicalLines, viewportWidth) {
|
|
596
|
+
function calculateLayout(logicalLines, viewportWidth, logicalCursor) {
|
|
461
597
|
const visualLines = [];
|
|
462
598
|
const logicalToVisualMap = [];
|
|
463
599
|
const visualToLogicalMap = [];
|
|
600
|
+
const transformedToLogicalMaps = [];
|
|
601
|
+
const visualToTransformedMap = [];
|
|
464
602
|
logicalLines.forEach((logLine, logIndex) => {
|
|
465
603
|
logicalToVisualMap[logIndex] = [];
|
|
466
|
-
|
|
604
|
+
const transformations = calculateTransformationsForLine(logLine);
|
|
605
|
+
const { transformedLine, transformedToLogMap } = calculateTransformedLine(logLine, logIndex, logicalCursor, transformations);
|
|
606
|
+
transformedToLogicalMaps[logIndex] = transformedToLogMap;
|
|
607
|
+
if (transformedLine.length === 0) {
|
|
467
608
|
// Handle empty logical line
|
|
468
609
|
logicalToVisualMap[logIndex].push([visualLines.length, 0]);
|
|
469
610
|
visualToLogicalMap.push([logIndex, 0]);
|
|
611
|
+
visualToTransformedMap.push(0);
|
|
470
612
|
visualLines.push('');
|
|
471
613
|
}
|
|
472
614
|
else {
|
|
473
615
|
// Non-empty logical line
|
|
474
616
|
let currentPosInLogLine = 0; // Tracks position within the current logical line (code point index)
|
|
475
|
-
const codePointsInLogLine = toCodePoints(
|
|
617
|
+
const codePointsInLogLine = toCodePoints(transformedLine);
|
|
476
618
|
while (currentPosInLogLine < codePointsInLogLine.length) {
|
|
477
619
|
let currentChunk = '';
|
|
478
620
|
let currentChunkVisualWidth = 0;
|
|
@@ -542,11 +684,13 @@ function calculateLayout(logicalLines, viewportWidth) {
|
|
|
542
684
|
currentChunk = codePointsInLogLine[currentPosInLogLine];
|
|
543
685
|
numCodePointsInChunk = 1;
|
|
544
686
|
}
|
|
687
|
+
const logicalStartCol = transformedToLogMap[currentPosInLogLine] ?? 0;
|
|
545
688
|
logicalToVisualMap[logIndex].push([
|
|
546
689
|
visualLines.length,
|
|
547
|
-
|
|
690
|
+
logicalStartCol,
|
|
548
691
|
]);
|
|
549
|
-
visualToLogicalMap.push([logIndex,
|
|
692
|
+
visualToLogicalMap.push([logIndex, logicalStartCol]);
|
|
693
|
+
visualToTransformedMap.push(currentPosInLogLine);
|
|
550
694
|
visualLines.push(currentChunk);
|
|
551
695
|
const logicalStartOfThisChunk = currentPosInLogLine;
|
|
552
696
|
currentPosInLogLine += numCodePointsInChunk;
|
|
@@ -571,18 +715,21 @@ function calculateLayout(logicalLines, viewportWidth) {
|
|
|
571
715
|
logicalToVisualMap[0] = [];
|
|
572
716
|
logicalToVisualMap[0].push([0, 0]);
|
|
573
717
|
visualToLogicalMap.push([0, 0]);
|
|
718
|
+
visualToTransformedMap.push(0);
|
|
574
719
|
}
|
|
575
720
|
}
|
|
576
721
|
return {
|
|
577
722
|
visualLines,
|
|
578
723
|
logicalToVisualMap,
|
|
579
724
|
visualToLogicalMap,
|
|
725
|
+
transformedToLogicalMaps,
|
|
726
|
+
visualToTransformedMap,
|
|
580
727
|
};
|
|
581
728
|
}
|
|
582
729
|
// Calculates the visual cursor position based on a pre-calculated layout.
|
|
583
730
|
// This is a lightweight operation.
|
|
584
731
|
function calculateVisualCursorFromLayout(layout, logicalCursor) {
|
|
585
|
-
const { logicalToVisualMap, visualLines } = layout;
|
|
732
|
+
const { logicalToVisualMap, visualLines, transformedToLogicalMaps } = layout;
|
|
586
733
|
const [logicalRow, logicalCol] = logicalCursor;
|
|
587
734
|
const segmentsForLogicalLine = logicalToVisualMap[logicalRow];
|
|
588
735
|
if (!segmentsForLogicalLine || segmentsForLogicalLine.length === 0) {
|
|
@@ -607,9 +754,26 @@ function calculateVisualCursorFromLayout(layout, logicalCursor) {
|
|
|
607
754
|
}
|
|
608
755
|
}
|
|
609
756
|
const [visualRow, startColInLogical] = segmentsForLogicalLine[targetSegmentIndex];
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
757
|
+
// Find the coordinates in transformed space in order to conver to visual
|
|
758
|
+
const transformedToLogicalMap = transformedToLogicalMaps[logicalRow] ?? [];
|
|
759
|
+
let transformedCol = 0;
|
|
760
|
+
for (let i = 0; i < transformedToLogicalMap.length; i++) {
|
|
761
|
+
if (transformedToLogicalMap[i] > logicalCol) {
|
|
762
|
+
transformedCol = Math.max(0, i - 1);
|
|
763
|
+
break;
|
|
764
|
+
}
|
|
765
|
+
if (i === transformedToLogicalMap.length - 1) {
|
|
766
|
+
transformedCol = transformedToLogicalMap.length - 1;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
let startColInTransformed = 0;
|
|
770
|
+
while (startColInTransformed < transformedToLogicalMap.length &&
|
|
771
|
+
transformedToLogicalMap[startColInTransformed] < startColInLogical) {
|
|
772
|
+
startColInTransformed++;
|
|
773
|
+
}
|
|
774
|
+
const clampedTransformedCol = Math.min(transformedCol, Math.max(0, transformedToLogicalMap.length - 1));
|
|
775
|
+
const visualCol = clampedTransformedCol - startColInTransformed;
|
|
776
|
+
const clampedVisualCol = Math.min(Math.max(visualCol, 0), cpLen(visualLines[visualRow] ?? ''));
|
|
613
777
|
return [visualRow, clampedVisualCol];
|
|
614
778
|
}
|
|
615
779
|
const historyLimit = 100;
|
|
@@ -799,16 +963,25 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
799
963
|
break;
|
|
800
964
|
default: {
|
|
801
965
|
const exhaustiveCheck = dir;
|
|
802
|
-
|
|
966
|
+
debugLogger.error(`Unknown visual movement direction: ${exhaustiveCheck}`);
|
|
803
967
|
return state;
|
|
804
968
|
}
|
|
805
969
|
}
|
|
806
970
|
if (visualToLogicalMap[newVisualRow]) {
|
|
807
|
-
const [logRow,
|
|
971
|
+
const [logRow, logicalStartCol] = visualToLogicalMap[newVisualRow];
|
|
972
|
+
const transformedToLogicalMap = visualLayout.transformedToLogicalMaps?.[logRow] ?? [];
|
|
973
|
+
let transformedStartCol = 0;
|
|
974
|
+
while (transformedStartCol < transformedToLogicalMap.length &&
|
|
975
|
+
transformedToLogicalMap[transformedStartCol] < logicalStartCol) {
|
|
976
|
+
transformedStartCol++;
|
|
977
|
+
}
|
|
978
|
+
const clampedTransformedCol = Math.min(transformedStartCol + newVisualCol, Math.max(0, transformedToLogicalMap.length - 1));
|
|
979
|
+
const newLogicalCol = transformedToLogicalMap[clampedTransformedCol] ??
|
|
980
|
+
cpLen(lines[logRow] ?? '');
|
|
808
981
|
return {
|
|
809
982
|
...state,
|
|
810
983
|
cursorRow: logRow,
|
|
811
|
-
cursorCol:
|
|
984
|
+
cursorCol: newLogicalCol,
|
|
812
985
|
preferredCol: newPreferredCol,
|
|
813
986
|
};
|
|
814
987
|
}
|
|
@@ -827,25 +1000,7 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
827
1000
|
}
|
|
828
1001
|
else {
|
|
829
1002
|
const lineContent = lines[cursorRow];
|
|
830
|
-
|
|
831
|
-
let start = cursorCol;
|
|
832
|
-
let onlySpaces = true;
|
|
833
|
-
for (let i = 0; i < start; i++) {
|
|
834
|
-
if (isWordChar(arr[i])) {
|
|
835
|
-
onlySpaces = false;
|
|
836
|
-
break;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
if (onlySpaces && start > 0) {
|
|
840
|
-
start--;
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
while (start > 0 && !isWordChar(arr[start - 1]))
|
|
844
|
-
start--;
|
|
845
|
-
while (start > 0 && isWordChar(arr[start - 1]))
|
|
846
|
-
start--;
|
|
847
|
-
}
|
|
848
|
-
newCursorCol = start;
|
|
1003
|
+
newCursorCol = findPrevWordBoundary(lineContent, cursorCol);
|
|
849
1004
|
}
|
|
850
1005
|
return {
|
|
851
1006
|
...state,
|
|
@@ -855,25 +1010,20 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
855
1010
|
};
|
|
856
1011
|
}
|
|
857
1012
|
case 'wordRight': {
|
|
1013
|
+
const lineContent = lines[cursorRow] ?? '';
|
|
858
1014
|
if (cursorRow === lines.length - 1 &&
|
|
859
|
-
cursorCol === cpLen(
|
|
1015
|
+
cursorCol === cpLen(lineContent)) {
|
|
860
1016
|
return state;
|
|
861
1017
|
}
|
|
862
1018
|
let newCursorRow = cursorRow;
|
|
863
1019
|
let newCursorCol = cursorCol;
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
if (cursorCol >= arr.length) {
|
|
1020
|
+
const lineLen = cpLen(lineContent);
|
|
1021
|
+
if (cursorCol >= lineLen) {
|
|
867
1022
|
newCursorRow++;
|
|
868
1023
|
newCursorCol = 0;
|
|
869
1024
|
}
|
|
870
1025
|
else {
|
|
871
|
-
|
|
872
|
-
while (end < arr.length && !isWordChar(arr[end]))
|
|
873
|
-
end++;
|
|
874
|
-
while (end < arr.length && isWordChar(arr[end]))
|
|
875
|
-
end++;
|
|
876
|
-
newCursorCol = end;
|
|
1026
|
+
newCursorCol = findNextWordBoundary(lineContent, cursorCol);
|
|
877
1027
|
}
|
|
878
1028
|
return {
|
|
879
1029
|
...state,
|
|
@@ -1111,32 +1261,51 @@ function textBufferReducerLogic(state, action, options = {}) {
|
|
|
1111
1261
|
return handleVimAction(state, action);
|
|
1112
1262
|
default: {
|
|
1113
1263
|
const exhaustiveCheck = action;
|
|
1114
|
-
|
|
1264
|
+
debugLogger.error(`Unknown action encountered: ${exhaustiveCheck}`);
|
|
1115
1265
|
return state;
|
|
1116
1266
|
}
|
|
1117
1267
|
}
|
|
1118
1268
|
}
|
|
1119
1269
|
export function textBufferReducer(state, action, options = {}) {
|
|
1120
1270
|
const newState = textBufferReducerLogic(state, action, options);
|
|
1271
|
+
const newTransformedLines = newState.lines !== state.lines
|
|
1272
|
+
? calculateTransformations(newState.lines)
|
|
1273
|
+
: state.transformationsByLine;
|
|
1274
|
+
const oldTransform = getTransformUnderCursor(state.cursorRow, state.cursorCol, state.transformationsByLine);
|
|
1275
|
+
const newTransform = getTransformUnderCursor(newState.cursorRow, newState.cursorCol, newTransformedLines);
|
|
1276
|
+
const oldInside = oldTransform !== null;
|
|
1277
|
+
const newInside = newTransform !== null;
|
|
1278
|
+
const movedBetweenTransforms = oldTransform !== newTransform &&
|
|
1279
|
+
(oldTransform !== null || newTransform !== null);
|
|
1121
1280
|
if (newState.lines !== state.lines ||
|
|
1122
|
-
newState.viewportWidth !== state.viewportWidth
|
|
1281
|
+
newState.viewportWidth !== state.viewportWidth ||
|
|
1282
|
+
oldInside !== newInside ||
|
|
1283
|
+
movedBetweenTransforms) {
|
|
1284
|
+
const shouldResetPreferred = oldInside !== newInside || movedBetweenTransforms;
|
|
1123
1285
|
return {
|
|
1124
1286
|
...newState,
|
|
1125
|
-
|
|
1287
|
+
preferredCol: shouldResetPreferred ? null : newState.preferredCol,
|
|
1288
|
+
visualLayout: calculateLayout(newState.lines, newState.viewportWidth, [
|
|
1289
|
+
newState.cursorRow,
|
|
1290
|
+
newState.cursorCol,
|
|
1291
|
+
]),
|
|
1292
|
+
transformationsByLine: newTransformedLines,
|
|
1126
1293
|
};
|
|
1127
1294
|
}
|
|
1128
1295
|
return newState;
|
|
1129
1296
|
}
|
|
1130
1297
|
// --- End of reducer logic ---
|
|
1131
|
-
export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, inputFilter, singleLine = false, }) {
|
|
1298
|
+
export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, inputFilter, singleLine = false, getPreferredEditor, }) {
|
|
1132
1299
|
const initialState = useMemo(() => {
|
|
1133
1300
|
const lines = initialText.split('\n');
|
|
1134
1301
|
const [initialCursorRow, initialCursorCol] = calculateInitialCursorPosition(lines.length === 0 ? [''] : lines, initialCursorOffset);
|
|
1135
|
-
const
|
|
1302
|
+
const transformationsByLine = calculateTransformations(lines.length === 0 ? [''] : lines);
|
|
1303
|
+
const visualLayout = calculateLayout(lines.length === 0 ? [''] : lines, viewport.width, [initialCursorRow, initialCursorCol]);
|
|
1136
1304
|
return {
|
|
1137
1305
|
lines: lines.length === 0 ? [''] : lines,
|
|
1138
1306
|
cursorRow: initialCursorRow,
|
|
1139
1307
|
cursorCol: initialCursorCol,
|
|
1308
|
+
transformationsByLine,
|
|
1140
1309
|
preferredCol: null,
|
|
1141
1310
|
undoStack: [],
|
|
1142
1311
|
redoStack: [],
|
|
@@ -1148,10 +1317,10 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1148
1317
|
};
|
|
1149
1318
|
}, [initialText, initialCursorOffset, viewport.width, viewport.height]);
|
|
1150
1319
|
const [state, dispatch] = useReducer((s, a) => textBufferReducer(s, a, { inputFilter, singleLine }), initialState);
|
|
1151
|
-
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, } = state;
|
|
1320
|
+
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, transformationsByLine, } = state;
|
|
1152
1321
|
const text = useMemo(() => lines.join('\n'), [lines]);
|
|
1153
1322
|
const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
|
|
1154
|
-
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
1323
|
+
const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
|
|
1155
1324
|
const [visualScrollRow, setVisualScrollRow] = useState(0);
|
|
1156
1325
|
useEffect(() => {
|
|
1157
1326
|
if (onChange) {
|
|
@@ -1198,8 +1367,9 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1198
1367
|
potentialPath = quoteMatch[1];
|
|
1199
1368
|
}
|
|
1200
1369
|
potentialPath = potentialPath.trim();
|
|
1201
|
-
|
|
1202
|
-
|
|
1370
|
+
const processed = parsePastedPaths(potentialPath, isValidPath);
|
|
1371
|
+
if (processed) {
|
|
1372
|
+
ch = processed;
|
|
1203
1373
|
}
|
|
1204
1374
|
}
|
|
1205
1375
|
let currentText = '';
|
|
@@ -1353,19 +1523,32 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1353
1523
|
const vimEscapeInsertMode = useCallback(() => {
|
|
1354
1524
|
dispatch({ type: 'vim_escape_insert_mode' });
|
|
1355
1525
|
}, []);
|
|
1356
|
-
const openInExternalEditor = useCallback(async (
|
|
1357
|
-
const editor = opts.editor ??
|
|
1358
|
-
process.env['VISUAL'] ??
|
|
1359
|
-
process.env['EDITOR'] ??
|
|
1360
|
-
(process.platform === 'win32' ? 'notepad' : 'vi');
|
|
1526
|
+
const openInExternalEditor = useCallback(async () => {
|
|
1361
1527
|
const tmpDir = fs.mkdtempSync(pathMod.join(os.tmpdir(), 'gemini-edit-'));
|
|
1362
1528
|
const filePath = pathMod.join(tmpDir, 'buffer.txt');
|
|
1363
1529
|
fs.writeFileSync(filePath, text, 'utf8');
|
|
1530
|
+
let command = undefined;
|
|
1531
|
+
const args = [filePath];
|
|
1532
|
+
const preferredEditorType = getPreferredEditor?.();
|
|
1533
|
+
if (!command && preferredEditorType) {
|
|
1534
|
+
command = getEditorCommand(preferredEditorType);
|
|
1535
|
+
if (isGuiEditor(preferredEditorType)) {
|
|
1536
|
+
args.unshift('--wait');
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
if (!command) {
|
|
1540
|
+
command =
|
|
1541
|
+
(process.env['VISUAL'] ??
|
|
1542
|
+
process.env['EDITOR'] ??
|
|
1543
|
+
process.platform === 'win32')
|
|
1544
|
+
? 'notepad'
|
|
1545
|
+
: 'vi';
|
|
1546
|
+
}
|
|
1364
1547
|
dispatch({ type: 'create_undo_snapshot' });
|
|
1365
1548
|
const wasRaw = stdin?.isRaw ?? false;
|
|
1366
1549
|
try {
|
|
1367
1550
|
setRawMode?.(false);
|
|
1368
|
-
const { status, error } = spawnSync(
|
|
1551
|
+
const { status, error } = spawnSync(command, args, {
|
|
1369
1552
|
stdio: 'inherit',
|
|
1370
1553
|
});
|
|
1371
1554
|
if (error)
|
|
@@ -1377,10 +1560,9 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1377
1560
|
dispatch({ type: 'set_text', payload: newText, pushToUndo: false });
|
|
1378
1561
|
}
|
|
1379
1562
|
catch (err) {
|
|
1380
|
-
|
|
1563
|
+
coreEvents.emitFeedback('error', '[useTextBuffer] external editor error', err);
|
|
1381
1564
|
}
|
|
1382
1565
|
finally {
|
|
1383
|
-
enableSupportedProtocol();
|
|
1384
1566
|
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
1385
1567
|
if (wasRaw)
|
|
1386
1568
|
setRawMode?.(true);
|
|
@@ -1397,7 +1579,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1397
1579
|
/* ignore */
|
|
1398
1580
|
}
|
|
1399
1581
|
}
|
|
1400
|
-
}, [text, stdin, setRawMode]);
|
|
1582
|
+
}, [text, stdin, setRawMode, getPreferredEditor]);
|
|
1401
1583
|
const handleInput = useCallback((key) => {
|
|
1402
1584
|
const { sequence: input } = key;
|
|
1403
1585
|
if (key.paste) {
|
|
@@ -1413,50 +1595,33 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1413
1595
|
input === '\\r') // VSCode terminal represents shift + enter this way
|
|
1414
1596
|
)
|
|
1415
1597
|
newline();
|
|
1416
|
-
else if (
|
|
1417
|
-
move('left');
|
|
1418
|
-
else if (key.ctrl && key.name === 'b')
|
|
1598
|
+
else if (keyMatchers[Command.MOVE_LEFT](key))
|
|
1419
1599
|
move('left');
|
|
1420
|
-
else if (
|
|
1421
|
-
move('right');
|
|
1422
|
-
else if (key.ctrl && key.name === 'f')
|
|
1600
|
+
else if (keyMatchers[Command.MOVE_RIGHT](key))
|
|
1423
1601
|
move('right');
|
|
1424
1602
|
else if (key.name === 'up')
|
|
1425
1603
|
move('up');
|
|
1426
1604
|
else if (key.name === 'down')
|
|
1427
1605
|
move('down');
|
|
1428
|
-
else if ((key
|
|
1606
|
+
else if (keyMatchers[Command.MOVE_WORD_LEFT](key))
|
|
1429
1607
|
move('wordLeft');
|
|
1430
|
-
else if (
|
|
1431
|
-
move('wordLeft');
|
|
1432
|
-
else if ((key.ctrl || key.meta) && key.name === 'right')
|
|
1433
|
-
move('wordRight');
|
|
1434
|
-
else if (key.meta && key.name === 'f')
|
|
1608
|
+
else if (keyMatchers[Command.MOVE_WORD_RIGHT](key))
|
|
1435
1609
|
move('wordRight');
|
|
1436
|
-
else if (key
|
|
1610
|
+
else if (keyMatchers[Command.HOME](key))
|
|
1437
1611
|
move('home');
|
|
1438
|
-
else if (
|
|
1439
|
-
move('home');
|
|
1440
|
-
else if (key.name === 'end')
|
|
1441
|
-
move('end');
|
|
1442
|
-
else if (key.ctrl && key.name === 'e')
|
|
1612
|
+
else if (keyMatchers[Command.END](key))
|
|
1443
1613
|
move('end');
|
|
1444
|
-
else if (
|
|
1614
|
+
else if (keyMatchers[Command.DELETE_WORD_BACKWARD](key))
|
|
1445
1615
|
deleteWordLeft();
|
|
1446
|
-
else if ((key
|
|
1447
|
-
(key.name === 'backspace' || input === '\x7f'))
|
|
1448
|
-
deleteWordLeft();
|
|
1449
|
-
else if ((key.meta || key.ctrl) && key.name === 'delete')
|
|
1616
|
+
else if (keyMatchers[Command.DELETE_WORD_FORWARD](key))
|
|
1450
1617
|
deleteWordRight();
|
|
1451
|
-
else if (key
|
|
1452
|
-
input === '\x7f' ||
|
|
1453
|
-
(key.ctrl && key.name === 'h'))
|
|
1618
|
+
else if (keyMatchers[Command.DELETE_CHAR_LEFT](key))
|
|
1454
1619
|
backspace();
|
|
1455
|
-
else if (
|
|
1620
|
+
else if (keyMatchers[Command.DELETE_CHAR_RIGHT](key))
|
|
1456
1621
|
del();
|
|
1457
|
-
else if (
|
|
1622
|
+
else if (keyMatchers[Command.UNDO](key))
|
|
1458
1623
|
undo();
|
|
1459
|
-
else if (
|
|
1624
|
+
else if (keyMatchers[Command.REDO](key))
|
|
1460
1625
|
redo();
|
|
1461
1626
|
else if (key.insertable) {
|
|
1462
1627
|
insert(input, { paste: key.paste });
|
|
@@ -1489,12 +1654,16 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1489
1654
|
dispatch({ type: 'move_to_offset', payload: { offset } });
|
|
1490
1655
|
}, []);
|
|
1491
1656
|
const moveToVisualPosition = useCallback((visRow, visCol) => {
|
|
1492
|
-
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
1657
|
+
const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
|
|
1493
1658
|
// Clamp visRow to valid range
|
|
1494
1659
|
const clampedVisRow = Math.max(0, Math.min(visRow, visualLines.length - 1));
|
|
1495
1660
|
const visualLine = visualLines[clampedVisRow] || '';
|
|
1496
1661
|
if (visualToLogicalMap[clampedVisRow]) {
|
|
1497
|
-
const [logRow
|
|
1662
|
+
const [logRow] = visualToLogicalMap[clampedVisRow];
|
|
1663
|
+
const transformedToLogicalMap = transformedToLogicalMaps?.[logRow] ?? [];
|
|
1664
|
+
// Where does this visual line begin within the transformed line?
|
|
1665
|
+
const startColInTransformed = visualToTransformedMap?.[clampedVisRow] ?? 0;
|
|
1666
|
+
// Handle wide characters: convert visual X position to character offset
|
|
1498
1667
|
const codePoints = toCodePoints(visualLine);
|
|
1499
1668
|
let currentVisX = 0;
|
|
1500
1669
|
let charOffset = 0;
|
|
@@ -1513,8 +1682,10 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1513
1682
|
}
|
|
1514
1683
|
// Clamp charOffset to length
|
|
1515
1684
|
charOffset = Math.min(charOffset, codePoints.length);
|
|
1685
|
+
// Map character offset through transformations to get logical position
|
|
1686
|
+
const transformedCol = Math.min(startColInTransformed + charOffset, Math.max(0, transformedToLogicalMap.length - 1));
|
|
1516
1687
|
const newCursorRow = logRow;
|
|
1517
|
-
const newCursorCol =
|
|
1688
|
+
const newCursorCol = transformedToLogicalMap[transformedCol] ?? cpLen(lines[logRow] ?? '');
|
|
1518
1689
|
dispatch({
|
|
1519
1690
|
type: 'set_cursor',
|
|
1520
1691
|
payload: {
|
|
@@ -1524,7 +1695,7 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1524
1695
|
},
|
|
1525
1696
|
});
|
|
1526
1697
|
}
|
|
1527
|
-
}, [visualLayout]);
|
|
1698
|
+
}, [visualLayout, lines]);
|
|
1528
1699
|
const getOffset = useCallback(() => logicalPosToOffset(lines, cursorRow, cursorCol), [lines, cursorRow, cursorCol]);
|
|
1529
1700
|
const returnValue = useMemo(() => ({
|
|
1530
1701
|
lines,
|
|
@@ -1537,6 +1708,9 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1537
1708
|
visualCursor,
|
|
1538
1709
|
visualScrollRow,
|
|
1539
1710
|
visualToLogicalMap,
|
|
1711
|
+
transformedToLogicalMaps,
|
|
1712
|
+
visualToTransformedMap,
|
|
1713
|
+
transformationsByLine,
|
|
1540
1714
|
setText,
|
|
1541
1715
|
insert,
|
|
1542
1716
|
newline,
|
|
@@ -1600,6 +1774,10 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1600
1774
|
renderedVisualLines,
|
|
1601
1775
|
visualCursor,
|
|
1602
1776
|
visualScrollRow,
|
|
1777
|
+
visualToLogicalMap,
|
|
1778
|
+
transformedToLogicalMaps,
|
|
1779
|
+
visualToTransformedMap,
|
|
1780
|
+
transformationsByLine,
|
|
1603
1781
|
setText,
|
|
1604
1782
|
insert,
|
|
1605
1783
|
newline,
|
|
@@ -1651,7 +1829,6 @@ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewp
|
|
|
1651
1829
|
vimMoveToLastLine,
|
|
1652
1830
|
vimMoveToLine,
|
|
1653
1831
|
vimEscapeInsertMode,
|
|
1654
|
-
visualToLogicalMap,
|
|
1655
1832
|
]);
|
|
1656
1833
|
return returnValue;
|
|
1657
1834
|
}
|