osagent 0.1.41 → 0.1.43
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/LICENSE +73 -0
- package/README.md +310 -0
- package/cli.js +387771 -0
- package/package.json +23 -84
- package/vendor/ripgrep/COPYING +3 -0
- package/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/vendor/ripgrep/arm64-linux/rg +0 -0
- package/vendor/ripgrep/x64-darwin/rg +0 -0
- package/vendor/ripgrep/x64-linux/rg +0 -0
- package/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -29
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -102
- package/dist/src/commands/doctor.d.ts +0 -7
- package/dist/src/commands/doctor.js +0 -171
- package/dist/src/commands/doctor.js.map +0 -1
- package/dist/src/commands/extensions/disable.d.ts +0 -13
- package/dist/src/commands/extensions/disable.js +0 -56
- package/dist/src/commands/extensions/disable.js.map +0 -1
- package/dist/src/commands/extensions/enable.d.ts +0 -13
- package/dist/src/commands/extensions/enable.js +0 -59
- package/dist/src/commands/extensions/enable.js.map +0 -1
- package/dist/src/commands/extensions/examples/context/QWEN.md +0 -8
- package/dist/src/commands/extensions/examples/context/qwen-extension.json +0 -4
- package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +0 -6
- package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +0 -4
- package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +0 -5
- package/dist/src/commands/extensions/examples/mcp-server/example.ts +0 -60
- package/dist/src/commands/extensions/examples/mcp-server/package.json +0 -18
- package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +0 -11
- package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +0 -13
- package/dist/src/commands/extensions/install.d.ts +0 -14
- package/dist/src/commands/extensions/install.js +0 -78
- package/dist/src/commands/extensions/install.js.map +0 -1
- package/dist/src/commands/extensions/install.test.d.ts +0 -6
- package/dist/src/commands/extensions/install.test.js +0 -102
- package/dist/src/commands/extensions/install.test.js.map +0 -1
- package/dist/src/commands/extensions/link.d.ts +0 -12
- package/dist/src/commands/extensions/link.js +0 -37
- package/dist/src/commands/extensions/link.js.map +0 -1
- package/dist/src/commands/extensions/list.d.ts +0 -8
- package/dist/src/commands/extensions/list.js +0 -32
- package/dist/src/commands/extensions/list.js.map +0 -1
- package/dist/src/commands/extensions/new.d.ts +0 -7
- package/dist/src/commands/extensions/new.js +0 -90
- package/dist/src/commands/extensions/new.js.map +0 -1
- package/dist/src/commands/extensions/new.test.d.ts +0 -6
- package/dist/src/commands/extensions/new.test.js +0 -59
- package/dist/src/commands/extensions/new.test.js.map +0 -1
- package/dist/src/commands/extensions/uninstall.d.ts +0 -12
- package/dist/src/commands/extensions/uninstall.js +0 -38
- package/dist/src/commands/extensions/uninstall.js.map +0 -1
- package/dist/src/commands/extensions/uninstall.test.d.ts +0 -6
- package/dist/src/commands/extensions/uninstall.test.js +0 -18
- package/dist/src/commands/extensions/uninstall.test.js.map +0 -1
- package/dist/src/commands/extensions/update.d.ts +0 -13
- package/dist/src/commands/extensions/update.js +0 -104
- package/dist/src/commands/extensions/update.js.map +0 -1
- package/dist/src/commands/extensions.d.ts +0 -2
- package/dist/src/commands/extensions.js +0 -28
- package/dist/src/commands/extensions.js.map +0 -1
- package/dist/src/commands/mcp/add.d.ts +0 -7
- package/dist/src/commands/mcp/add.js +0 -171
- package/dist/src/commands/mcp/add.js.map +0 -1
- package/dist/src/commands/mcp/list.d.ts +0 -8
- package/dist/src/commands/mcp/list.js +0 -111
- package/dist/src/commands/mcp/list.js.map +0 -1
- package/dist/src/commands/mcp/remove.d.ts +0 -7
- package/dist/src/commands/mcp/remove.js +0 -44
- package/dist/src/commands/mcp/remove.js.map +0 -1
- package/dist/src/commands/mcp.d.ts +0 -7
- package/dist/src/commands/mcp.js +0 -23
- package/dist/src/commands/mcp.js.map +0 -1
- package/dist/src/config/auth.d.ts +0 -7
- package/dist/src/config/auth.js +0 -46
- package/dist/src/config/auth.js.map +0 -1
- package/dist/src/config/auth.test.d.ts +0 -6
- package/dist/src/config/auth.test.js +0 -37
- package/dist/src/config/auth.test.js.map +0 -1
- package/dist/src/config/config.d.ts +0 -58
- package/dist/src/config/config.js +0 -678
- package/dist/src/config/config.js.map +0 -1
- package/dist/src/config/extension.d.ts +0 -83
- package/dist/src/config/extension.js +0 -534
- package/dist/src/config/extension.js.map +0 -1
- package/dist/src/config/extensions/extensionEnablement.d.ts +0 -47
- package/dist/src/config/extensions/extensionEnablement.js +0 -189
- package/dist/src/config/extensions/extensionEnablement.js.map +0 -1
- package/dist/src/config/extensions/extensionEnablement.test.d.ts +0 -6
- package/dist/src/config/extensions/extensionEnablement.test.js +0 -333
- package/dist/src/config/extensions/extensionEnablement.test.js.map +0 -1
- package/dist/src/config/extensions/github.d.ts +0 -30
- package/dist/src/config/extensions/github.js +0 -322
- package/dist/src/config/extensions/github.js.map +0 -1
- package/dist/src/config/extensions/github.test.d.ts +0 -6
- package/dist/src/config/extensions/github.test.js +0 -334
- package/dist/src/config/extensions/github.test.js.map +0 -1
- package/dist/src/config/extensions/update.d.ts +0 -19
- package/dist/src/config/extensions/update.js +0 -113
- package/dist/src/config/extensions/update.js.map +0 -1
- package/dist/src/config/extensions/update.test.d.ts +0 -6
- package/dist/src/config/extensions/update.test.js +0 -342
- package/dist/src/config/extensions/update.test.js.map +0 -1
- package/dist/src/config/extensions/variableSchema.d.ts +0 -36
- package/dist/src/config/extensions/variableSchema.js +0 -22
- package/dist/src/config/extensions/variableSchema.js.map +0 -1
- package/dist/src/config/extensions/variables.d.ts +0 -17
- package/dist/src/config/extensions/variables.js +0 -40
- package/dist/src/config/extensions/variables.js.map +0 -1
- package/dist/src/config/extensions/variables.test.d.ts +0 -6
- package/dist/src/config/extensions/variables.test.js +0 -17
- package/dist/src/config/extensions/variables.test.js.map +0 -1
- package/dist/src/config/keyBindings.d.ts +0 -70
- package/dist/src/config/keyBindings.js +0 -130
- package/dist/src/config/keyBindings.js.map +0 -1
- package/dist/src/config/keyBindings.test.d.ts +0 -6
- package/dist/src/config/keyBindings.test.js +0 -51
- package/dist/src/config/keyBindings.test.js.map +0 -1
- package/dist/src/config/sandboxConfig.d.ts +0 -13
- package/dist/src/config/sandboxConfig.js +0 -73
- package/dist/src/config/sandboxConfig.js.map +0 -1
- package/dist/src/config/settings.d.ts +0 -72
- package/dist/src/config/settings.js +0 -631
- package/dist/src/config/settings.js.map +0 -1
- package/dist/src/config/settingsSchema.d.ts +0 -1189
- package/dist/src/config/settingsSchema.js +0 -1129
- package/dist/src/config/settingsSchema.js.map +0 -1
- package/dist/src/config/settingsSchema.test.d.ts +0 -6
- package/dist/src/config/settingsSchema.test.js +0 -201
- package/dist/src/config/settingsSchema.test.js.map +0 -1
- package/dist/src/config/trustedFolders.d.ts +0 -56
- package/dist/src/config/trustedFolders.js +0 -168
- package/dist/src/config/trustedFolders.js.map +0 -1
- package/dist/src/config/trustedFolders.test.d.ts +0 -6
- package/dist/src/config/trustedFolders.test.js +0 -340
- package/dist/src/config/trustedFolders.test.js.map +0 -1
- package/dist/src/config/webSearch.d.ts +0 -35
- package/dist/src/config/webSearch.js +0 -87
- package/dist/src/config/webSearch.js.map +0 -1
- package/dist/src/core/auth.d.ts +0 -13
- package/dist/src/core/auth.js +0 -34
- package/dist/src/core/auth.js.map +0 -1
- package/dist/src/core/initializer.d.ts +0 -21
- package/dist/src/core/initializer.js +0 -44
- package/dist/src/core/initializer.js.map +0 -1
- package/dist/src/core/theme.d.ts +0 -12
- package/dist/src/core/theme.js +0 -23
- package/dist/src/core/theme.js.map +0 -1
- package/dist/src/gemini.d.ts +0 -13
- package/dist/src/gemini.js +0 -328
- package/dist/src/gemini.js.map +0 -1
- package/dist/src/gemini.test.d.ts +0 -6
- package/dist/src/gemini.test.js +0 -507
- package/dist/src/gemini.test.js.map +0 -1
- package/dist/src/generated/git-commit.d.ts +0 -7
- package/dist/src/generated/git-commit.js +0 -10
- package/dist/src/generated/git-commit.js.map +0 -1
- package/dist/src/i18n/index.d.ts +0 -18
- package/dist/src/i18n/index.js +0 -184
- package/dist/src/i18n/index.js.map +0 -1
- package/dist/src/nonInteractive/control/ControlContext.d.ts +0 -63
- package/dist/src/nonInteractive/control/ControlContext.js +0 -31
- package/dist/src/nonInteractive/control/ControlContext.js.map +0 -1
- package/dist/src/nonInteractive/control/ControlDispatcher.d.ts +0 -86
- package/dist/src/nonInteractive/control/ControlDispatcher.js +0 -238
- package/dist/src/nonInteractive/control/ControlDispatcher.js.map +0 -1
- package/dist/src/nonInteractive/control/ControlDispatcher.test.d.ts +0 -6
- package/dist/src/nonInteractive/control/ControlDispatcher.test.js +0 -549
- package/dist/src/nonInteractive/control/ControlDispatcher.test.js.map +0 -1
- package/dist/src/nonInteractive/control/ControlService.d.ts +0 -78
- package/dist/src/nonInteractive/control/ControlService.js +0 -154
- package/dist/src/nonInteractive/control/ControlService.js.map +0 -1
- package/dist/src/nonInteractive/control/controllers/baseController.d.ts +0 -50
- package/dist/src/nonInteractive/control/controllers/baseController.js +0 -102
- package/dist/src/nonInteractive/control/controllers/baseController.js.map +0 -1
- package/dist/src/nonInteractive/control/controllers/hookController.d.ts +0 -25
- package/dist/src/nonInteractive/control/controllers/hookController.js +0 -42
- package/dist/src/nonInteractive/control/controllers/hookController.js.map +0 -1
- package/dist/src/nonInteractive/control/controllers/mcpController.d.ts +0 -42
- package/dist/src/nonInteractive/control/controllers/mcpController.js +0 -205
- package/dist/src/nonInteractive/control/controllers/mcpController.js.map +0 -1
- package/dist/src/nonInteractive/control/controllers/permissionController.d.ts +0 -78
- package/dist/src/nonInteractive/control/controllers/permissionController.js +0 -358
- package/dist/src/nonInteractive/control/controllers/permissionController.js.map +0 -1
- package/dist/src/nonInteractive/control/controllers/systemController.d.ts +0 -56
- package/dist/src/nonInteractive/control/controllers/systemController.js +0 -166
- package/dist/src/nonInteractive/control/controllers/systemController.js.map +0 -1
- package/dist/src/nonInteractive/control/types/serviceAPIs.d.ts +0 -120
- package/dist/src/nonInteractive/control/types/serviceAPIs.js +0 -7
- package/dist/src/nonInteractive/control/types/serviceAPIs.js.map +0 -1
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.d.ts +0 -446
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js +0 -891
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js.map +0 -1
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.d.ts +0 -6
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js +0 -1197
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js.map +0 -1
- package/dist/src/nonInteractive/io/JsonOutputAdapter.d.ts +0 -29
- package/dist/src/nonInteractive/io/JsonOutputAdapter.js +0 -56
- package/dist/src/nonInteractive/io/JsonOutputAdapter.js.map +0 -1
- package/dist/src/nonInteractive/io/JsonOutputAdapter.test.d.ts +0 -6
- package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js +0 -624
- package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js.map +0 -1
- package/dist/src/nonInteractive/io/StreamJsonInputReader.d.ts +0 -16
- package/dist/src/nonInteractive/io/StreamJsonInputReader.js +0 -54
- package/dist/src/nonInteractive/io/StreamJsonInputReader.js.map +0 -1
- package/dist/src/nonInteractive/io/StreamJsonInputReader.test.d.ts +0 -6
- package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js +0 -178
- package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js.map +0 -1
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.d.ts +0 -69
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js +0 -185
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js.map +0 -1
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.d.ts +0 -6
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js +0 -808
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js.map +0 -1
- package/dist/src/nonInteractive/session.d.ts +0 -23
- package/dist/src/nonInteractive/session.js +0 -549
- package/dist/src/nonInteractive/session.js.map +0 -1
- package/dist/src/nonInteractive/session.test.d.ts +0 -6
- package/dist/src/nonInteractive/session.test.js +0 -407
- package/dist/src/nonInteractive/session.test.js.map +0 -1
- package/dist/src/nonInteractive/types.d.ts +0 -344
- package/dist/src/nonInteractive/types.js +0 -78
- package/dist/src/nonInteractive/types.js.map +0 -1
- package/dist/src/nonInteractiveCli.d.ts +0 -28
- package/dist/src/nonInteractiveCli.js +0 -268
- package/dist/src/nonInteractiveCli.js.map +0 -1
- package/dist/src/nonInteractiveCliCommands.d.ts +0 -35
- package/dist/src/nonInteractiveCliCommands.js +0 -144
- package/dist/src/nonInteractiveCliCommands.js.map +0 -1
- package/dist/src/patches/is-in-ci.d.ts +0 -7
- package/dist/src/patches/is-in-ci.js +0 -15
- package/dist/src/patches/is-in-ci.js.map +0 -1
- package/dist/src/patches/punycode-shim.d.ts +0 -6
- package/dist/src/patches/punycode-shim.js +0 -19
- package/dist/src/patches/punycode-shim.js.map +0 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +0 -24
- package/dist/src/services/BuiltinCommandLoader.js +0 -120
- package/dist/src/services/BuiltinCommandLoader.js.map +0 -1
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
- package/dist/src/services/BuiltinCommandLoader.test.js +0 -167
- package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
- package/dist/src/services/CommandService.d.ts +0 -55
- package/dist/src/services/CommandService.js +0 -90
- package/dist/src/services/CommandService.js.map +0 -1
- package/dist/src/services/CommandService.test.d.ts +0 -6
- package/dist/src/services/CommandService.test.js +0 -233
- package/dist/src/services/CommandService.test.js.map +0 -1
- package/dist/src/services/FileCommandLoader.d.ts +0 -51
- package/dist/src/services/FileCommandLoader.js +0 -230
- package/dist/src/services/FileCommandLoader.js.map +0 -1
- package/dist/src/services/McpPromptLoader.d.ts +0 -35
- package/dist/src/services/McpPromptLoader.js +0 -254
- package/dist/src/services/McpPromptLoader.js.map +0 -1
- package/dist/src/services/McpPromptLoader.test.d.ts +0 -6
- package/dist/src/services/McpPromptLoader.test.js +0 -341
- package/dist/src/services/McpPromptLoader.test.js.map +0 -1
- package/dist/src/services/ProjectAnalyzerService.d.ts +0 -136
- package/dist/src/services/ProjectAnalyzerService.js +0 -433
- package/dist/src/services/ProjectAnalyzerService.js.map +0 -1
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +0 -16
- package/dist/src/services/prompt-processors/argumentProcessor.js +0 -21
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +0 -1
- package/dist/src/services/prompt-processors/atFileProcessor.d.ts +0 -12
- package/dist/src/services/prompt-processors/atFileProcessor.js +0 -62
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +0 -1
- package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +0 -6
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +0 -174
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +0 -1
- package/dist/src/services/prompt-processors/injectionParser.d.ts +0 -29
- package/dist/src/services/prompt-processors/injectionParser.js +0 -60
- package/dist/src/services/prompt-processors/injectionParser.js.map +0 -1
- package/dist/src/services/prompt-processors/injectionParser.test.d.ts +0 -6
- package/dist/src/services/prompt-processors/injectionParser.test.js +0 -189
- package/dist/src/services/prompt-processors/injectionParser.test.js.map +0 -1
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +0 -27
- package/dist/src/services/prompt-processors/shellProcessor.js +0 -128
- package/dist/src/services/prompt-processors/shellProcessor.js.map +0 -1
- package/dist/src/services/prompt-processors/types.d.ts +0 -45
- package/dist/src/services/prompt-processors/types.js +0 -20
- package/dist/src/services/prompt-processors/types.js.map +0 -1
- package/dist/src/services/types.d.ts +0 -22
- package/dist/src/services/types.js +0 -7
- package/dist/src/services/types.js.map +0 -1
- package/dist/src/test-utils/createExtension.d.ts +0 -15
- package/dist/src/test-utils/createExtension.js +0 -25
- package/dist/src/test-utils/createExtension.js.map +0 -1
- package/dist/src/test-utils/customMatchers.d.ts +0 -14
- package/dist/src/test-utils/customMatchers.js +0 -40
- package/dist/src/test-utils/customMatchers.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.d.ts +0 -18
- package/dist/src/test-utils/mockCommandContext.js +0 -93
- package/dist/src/test-utils/mockCommandContext.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
- package/dist/src/test-utils/mockCommandContext.test.js +0 -51
- package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
- package/dist/src/test-utils/render.d.ts +0 -12
- package/dist/src/test-utils/render.js +0 -14
- package/dist/src/test-utils/render.js.map +0 -1
- package/dist/src/ui/App.d.ts +0 -6
- package/dist/src/ui/App.js +0 -37
- package/dist/src/ui/App.js.map +0 -1
- package/dist/src/ui/AppContainer.d.ts +0 -17
- package/dist/src/ui/AppContainer.js +0 -1139
- package/dist/src/ui/AppContainer.js.map +0 -1
- package/dist/src/ui/AppContainer.test.d.ts +0 -6
- package/dist/src/ui/AppContainer.test.js +0 -831
- package/dist/src/ui/AppContainer.test.js.map +0 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +0 -16
- package/dist/src/ui/IdeIntegrationNudge.js +0 -50
- package/dist/src/ui/IdeIntegrationNudge.js.map +0 -1
- package/dist/src/ui/auth/AuthDialog.d.ts +0 -7
- package/dist/src/ui/auth/AuthDialog.js +0 -94
- package/dist/src/ui/auth/AuthDialog.js.map +0 -1
- package/dist/src/ui/auth/AuthDialog.test.d.ts +0 -6
- package/dist/src/ui/auth/AuthDialog.test.js +0 -392
- package/dist/src/ui/auth/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/auth/AuthInProgress.d.ts +0 -11
- package/dist/src/ui/auth/AuthInProgress.js +0 -24
- package/dist/src/ui/auth/AuthInProgress.js.map +0 -1
- package/dist/src/ui/auth/useAuth.d.ts +0 -26
- package/dist/src/ui/auth/useAuth.js +0 -212
- package/dist/src/ui/auth/useAuth.js.map +0 -1
- package/dist/src/ui/colors.d.ts +0 -7
- package/dist/src/ui/colors.js +0 -54
- package/dist/src/ui/colors.js.map +0 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +0 -7
- package/dist/src/ui/commands/aboutCommand.js +0 -25
- package/dist/src/ui/commands/aboutCommand.js.map +0 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +0 -7
- package/dist/src/ui/commands/agentsCommand.js +0 -212
- package/dist/src/ui/commands/agentsCommand.js.map +0 -1
- package/dist/src/ui/commands/approvalModeCommand.d.ts +0 -7
- package/dist/src/ui/commands/approvalModeCommand.js +0 -19
- package/dist/src/ui/commands/approvalModeCommand.js.map +0 -1
- package/dist/src/ui/commands/approvalModeCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/approvalModeCommand.test.js +0 -49
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +0 -1
- package/dist/src/ui/commands/authCommand.d.ts +0 -7
- package/dist/src/ui/commands/authCommand.js +0 -19
- package/dist/src/ui/commands/authCommand.js.map +0 -1
- package/dist/src/ui/commands/bugCommand.d.ts +0 -7
- package/dist/src/ui/commands/bugCommand.js +0 -51
- package/dist/src/ui/commands/bugCommand.js.map +0 -1
- package/dist/src/ui/commands/chatCommand.d.ts +0 -9
- package/dist/src/ui/commands/chatCommand.js +0 -351
- package/dist/src/ui/commands/chatCommand.js.map +0 -1
- package/dist/src/ui/commands/clearCommand.d.ts +0 -7
- package/dist/src/ui/commands/clearCommand.js +0 -30
- package/dist/src/ui/commands/clearCommand.js.map +0 -1
- package/dist/src/ui/commands/compressCommand.d.ts +0 -7
- package/dist/src/ui/commands/compressCommand.js +0 -71
- package/dist/src/ui/commands/compressCommand.js.map +0 -1
- package/dist/src/ui/commands/consultCommand.d.ts +0 -12
- package/dist/src/ui/commands/consultCommand.js +0 -193
- package/dist/src/ui/commands/consultCommand.js.map +0 -1
- package/dist/src/ui/commands/contextCommand.d.ts +0 -7
- package/dist/src/ui/commands/contextCommand.js +0 -89
- package/dist/src/ui/commands/contextCommand.js.map +0 -1
- package/dist/src/ui/commands/continueCommand.d.ts +0 -10
- package/dist/src/ui/commands/continueCommand.js +0 -218
- package/dist/src/ui/commands/continueCommand.js.map +0 -1
- package/dist/src/ui/commands/copyCommand.d.ts +0 -7
- package/dist/src/ui/commands/copyCommand.js +0 -62
- package/dist/src/ui/commands/copyCommand.js.map +0 -1
- package/dist/src/ui/commands/corgiCommand.d.ts +0 -7
- package/dist/src/ui/commands/corgiCommand.js +0 -16
- package/dist/src/ui/commands/corgiCommand.js.map +0 -1
- package/dist/src/ui/commands/dangerouslyCommand.d.ts +0 -15
- package/dist/src/ui/commands/dangerouslyCommand.js +0 -100
- package/dist/src/ui/commands/dangerouslyCommand.js.map +0 -1
- package/dist/src/ui/commands/delegateCommand.d.ts +0 -7
- package/dist/src/ui/commands/delegateCommand.js +0 -139
- package/dist/src/ui/commands/delegateCommand.js.map +0 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +0 -8
- package/dist/src/ui/commands/directoryCommand.js +0 -153
- package/dist/src/ui/commands/directoryCommand.js.map +0 -1
- package/dist/src/ui/commands/docsCommand.d.ts +0 -7
- package/dist/src/ui/commands/docsCommand.js +0 -40
- package/dist/src/ui/commands/docsCommand.js.map +0 -1
- package/dist/src/ui/commands/doctorCommand.d.ts +0 -7
- package/dist/src/ui/commands/doctorCommand.js +0 -681
- package/dist/src/ui/commands/doctorCommand.js.map +0 -1
- package/dist/src/ui/commands/editorCommand.d.ts +0 -7
- package/dist/src/ui/commands/editorCommand.js +0 -19
- package/dist/src/ui/commands/editorCommand.js.map +0 -1
- package/dist/src/ui/commands/extensionsCommand.d.ts +0 -7
- package/dist/src/ui/commands/extensionsCommand.js +0 -115
- package/dist/src/ui/commands/extensionsCommand.js.map +0 -1
- package/dist/src/ui/commands/helpCommand.d.ts +0 -7
- package/dist/src/ui/commands/helpCommand.js +0 -24
- package/dist/src/ui/commands/helpCommand.js.map +0 -1
- package/dist/src/ui/commands/ideCommand.d.ts +0 -7
- package/dist/src/ui/commands/ideCommand.js +0 -241
- package/dist/src/ui/commands/ideCommand.js.map +0 -1
- package/dist/src/ui/commands/initCommand.d.ts +0 -7
- package/dist/src/ui/commands/initCommand.js +0 -118
- package/dist/src/ui/commands/initCommand.js.map +0 -1
- package/dist/src/ui/commands/languageCommand.d.ts +0 -7
- package/dist/src/ui/commands/languageCommand.js +0 -386
- package/dist/src/ui/commands/languageCommand.js.map +0 -1
- package/dist/src/ui/commands/mcpCommand.d.ts +0 -7
- package/dist/src/ui/commands/mcpCommand.js +0 -269
- package/dist/src/ui/commands/mcpCommand.js.map +0 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +0 -7
- package/dist/src/ui/commands/memoryCommand.js +0 -254
- package/dist/src/ui/commands/memoryCommand.js.map +0 -1
- package/dist/src/ui/commands/modelCommand.d.ts +0 -7
- package/dist/src/ui/commands/modelCommand.js +0 -58
- package/dist/src/ui/commands/modelCommand.js.map +0 -1
- package/dist/src/ui/commands/modelCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/modelCommand.test.js +0 -137
- package/dist/src/ui/commands/modelCommand.test.js.map +0 -1
- package/dist/src/ui/commands/openaiProfileCommand.d.ts +0 -7
- package/dist/src/ui/commands/openaiProfileCommand.js +0 -135
- package/dist/src/ui/commands/openaiProfileCommand.js.map +0 -1
- package/dist/src/ui/commands/permissionsCommand.d.ts +0 -7
- package/dist/src/ui/commands/permissionsCommand.js +0 -19
- package/dist/src/ui/commands/permissionsCommand.js.map +0 -1
- package/dist/src/ui/commands/permissionsCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/permissionsCommand.test.js +0 -30
- package/dist/src/ui/commands/permissionsCommand.test.js.map +0 -1
- package/dist/src/ui/commands/providerCommand.d.ts +0 -11
- package/dist/src/ui/commands/providerCommand.js +0 -359
- package/dist/src/ui/commands/providerCommand.js.map +0 -1
- package/dist/src/ui/commands/quitCommand.d.ts +0 -8
- package/dist/src/ui/commands/quitCommand.js +0 -64
- package/dist/src/ui/commands/quitCommand.js.map +0 -1
- package/dist/src/ui/commands/resetCommand.d.ts +0 -11
- package/dist/src/ui/commands/resetCommand.js +0 -34
- package/dist/src/ui/commands/resetCommand.js.map +0 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +0 -8
- package/dist/src/ui/commands/restoreCommand.js +0 -124
- package/dist/src/ui/commands/restoreCommand.js.map +0 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +0 -7
- package/dist/src/ui/commands/settingsCommand.js +0 -19
- package/dist/src/ui/commands/settingsCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +0 -9
- package/dist/src/ui/commands/setupGithubCommand.js +0 -157
- package/dist/src/ui/commands/setupGithubCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/setupGithubCommand.test.js +0 -167
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
- package/dist/src/ui/commands/spCommand.d.ts +0 -7
- package/dist/src/ui/commands/spCommand.js +0 -352
- package/dist/src/ui/commands/spCommand.js.map +0 -1
- package/dist/src/ui/commands/statsCommand.d.ts +0 -7
- package/dist/src/ui/commands/statsCommand.js +0 -61
- package/dist/src/ui/commands/statsCommand.js.map +0 -1
- package/dist/src/ui/commands/summaryCommand.d.ts +0 -7
- package/dist/src/ui/commands/summaryCommand.js +0 -156
- package/dist/src/ui/commands/summaryCommand.js.map +0 -1
- package/dist/src/ui/commands/systemPromptCommand.d.ts +0 -7
- package/dist/src/ui/commands/systemPromptCommand.js +0 -322
- package/dist/src/ui/commands/systemPromptCommand.js.map +0 -1
- package/dist/src/ui/commands/taskmasterCommand.d.ts +0 -10
- package/dist/src/ui/commands/taskmasterCommand.js +0 -174
- package/dist/src/ui/commands/taskmasterCommand.js.map +0 -1
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +0 -13
- package/dist/src/ui/commands/terminalSetupCommand.js +0 -47
- package/dist/src/ui/commands/terminalSetupCommand.js.map +0 -1
- package/dist/src/ui/commands/themeCommand.d.ts +0 -7
- package/dist/src/ui/commands/themeCommand.js +0 -19
- package/dist/src/ui/commands/themeCommand.js.map +0 -1
- package/dist/src/ui/commands/toolsCommand.d.ts +0 -7
- package/dist/src/ui/commands/toolsCommand.js +0 -45
- package/dist/src/ui/commands/toolsCommand.js.map +0 -1
- package/dist/src/ui/commands/types.d.ts +0 -188
- package/dist/src/ui/commands/types.js +0 -12
- package/dist/src/ui/commands/types.js.map +0 -1
- package/dist/src/ui/commands/viewCommand.d.ts +0 -7
- package/dist/src/ui/commands/viewCommand.js +0 -160
- package/dist/src/ui/commands/viewCommand.js.map +0 -1
- package/dist/src/ui/commands/vimCommand.d.ts +0 -7
- package/dist/src/ui/commands/vimCommand.js +0 -26
- package/dist/src/ui/commands/vimCommand.js.map +0 -1
- package/dist/src/ui/components/AboutBox.d.ts +0 -10
- package/dist/src/ui/components/AboutBox.js +0 -10
- package/dist/src/ui/components/AboutBox.js.map +0 -1
- package/dist/src/ui/components/AgentResponseFooter.d.ts +0 -19
- package/dist/src/ui/components/AgentResponseFooter.js +0 -43
- package/dist/src/ui/components/AgentResponseFooter.js.map +0 -1
- package/dist/src/ui/components/AnsiOutput.d.ts +0 -13
- package/dist/src/ui/components/AnsiOutput.js +0 -12
- package/dist/src/ui/components/AnsiOutput.js.map +0 -1
- package/dist/src/ui/components/AnsiOutput.test.d.ts +0 -6
- package/dist/src/ui/components/AnsiOutput.test.js +0 -97
- package/dist/src/ui/components/AnsiOutput.test.js.map +0 -1
- package/dist/src/ui/components/AppHeader.d.ts +0 -10
- package/dist/src/ui/components/AppHeader.js +0 -19
- package/dist/src/ui/components/AppHeader.js.map +0 -1
- package/dist/src/ui/components/ApprovalModeDialog.d.ts +0 -21
- package/dist/src/ui/components/ApprovalModeDialog.js +0 -68
- package/dist/src/ui/components/ApprovalModeDialog.js.map +0 -1
- package/dist/src/ui/components/AsciiArt.d.ts +0 -13
- package/dist/src/ui/components/AsciiArt.js +0 -47
- package/dist/src/ui/components/AsciiArt.js.map +0 -1
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +0 -12
- package/dist/src/ui/components/AutoAcceptIndicator.js +0 -32
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/components/Composer.d.ts +0 -6
- package/dist/src/ui/components/Composer.js +0 -56
- package/dist/src/ui/components/Composer.js.map +0 -1
- package/dist/src/ui/components/Composer.test.d.ts +0 -6
- package/dist/src/ui/components/Composer.test.js +0 -337
- package/dist/src/ui/components/Composer.test.js.map +0 -1
- package/dist/src/ui/components/ConfigInitDisplay.d.ts +0 -6
- package/dist/src/ui/components/ConfigInitDisplay.js +0 -42
- package/dist/src/ui/components/ConfigInitDisplay.js.map +0 -1
- package/dist/src/ui/components/ConsentPrompt.d.ts +0 -13
- package/dist/src/ui/components/ConsentPrompt.js +0 -19
- package/dist/src/ui/components/ConsentPrompt.js.map +0 -1
- package/dist/src/ui/components/ConsentPrompt.test.d.ts +0 -6
- package/dist/src/ui/components/ConsentPrompt.test.js +0 -67
- package/dist/src/ui/components/ConsentPrompt.test.js.map +0 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +0 -11
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +0 -11
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/ConsultationDisplay.d.ts +0 -22
- package/dist/src/ui/components/ConsultationDisplay.js +0 -26
- package/dist/src/ui/components/ConsultationDisplay.js.map +0 -1
- package/dist/src/ui/components/ConsultationPanel.d.ts +0 -11
- package/dist/src/ui/components/ConsultationPanel.js +0 -36
- package/dist/src/ui/components/ConsultationPanel.js.map +0 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -20
- package/dist/src/ui/components/ContextSummaryDisplay.js +0 -90
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +0 -10
- package/dist/src/ui/components/ContextUsageDisplay.js +0 -58
- package/dist/src/ui/components/ContextUsageDisplay.js.map +0 -1
- package/dist/src/ui/components/DebugProfiler.d.ts +0 -6
- package/dist/src/ui/components/DebugProfiler.js +0 -27
- package/dist/src/ui/components/DebugProfiler.js.map +0 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -14
- package/dist/src/ui/components/DetailedMessagesDisplay.js +0 -34
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +0 -1
- package/dist/src/ui/components/DialogManager.d.ts +0 -12
- package/dist/src/ui/components/DialogManager.js +0 -192
- package/dist/src/ui/components/DialogManager.js.map +0 -1
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +0 -16
- package/dist/src/ui/components/EditorSettingsDialog.js +0 -85
- package/dist/src/ui/components/EditorSettingsDialog.js.map +0 -1
- package/dist/src/ui/components/ExitWarning.d.ts +0 -7
- package/dist/src/ui/components/ExitWarning.js +0 -9
- package/dist/src/ui/components/ExitWarning.js.map +0 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +0 -17
- package/dist/src/ui/components/FolderTrustDialog.js +0 -58
- package/dist/src/ui/components/FolderTrustDialog.js.map +0 -1
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
- package/dist/src/ui/components/FolderTrustDialog.test.js +0 -88
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
- package/dist/src/ui/components/Footer.d.ts +0 -7
- package/dist/src/ui/components/Footer.js +0 -48
- package/dist/src/ui/components/Footer.js.map +0 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +0 -21
- package/dist/src/ui/components/GeminiRespondingSpinner.js +0 -23
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +0 -1
- package/dist/src/ui/components/Header.d.ts +0 -13
- package/dist/src/ui/components/Header.js +0 -28
- package/dist/src/ui/components/Header.js.map +0 -1
- package/dist/src/ui/components/Header.test.d.ts +0 -6
- package/dist/src/ui/components/Header.test.js +0 -37
- package/dist/src/ui/components/Header.test.js.map +0 -1
- package/dist/src/ui/components/Help.d.ts +0 -12
- package/dist/src/ui/components/Help.js +0 -23
- package/dist/src/ui/components/Help.js.map +0 -1
- package/dist/src/ui/components/Help.test.d.ts +0 -6
- package/dist/src/ui/components/Help.test.js +0 -57
- package/dist/src/ui/components/Help.test.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +0 -21
- package/dist/src/ui/components/HistoryItemDisplay.js +0 -31
- package/dist/src/ui/components/HistoryItemDisplay.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -183
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +0 -11
- package/dist/src/ui/components/IdeTrustChangeDialog.js +0 -32
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +0 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +0 -6
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +0 -57
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +0 -1
- package/dist/src/ui/components/InputPrompt.d.ts +0 -37
- package/dist/src/ui/components/InputPrompt.js +0 -583
- package/dist/src/ui/components/InputPrompt.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +0 -15
- package/dist/src/ui/components/LoadingIndicator.js +0 -39
- package/dist/src/ui/components/LoadingIndicator.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/components/LoadingIndicator.test.js +0 -194
- package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +0 -13
- package/dist/src/ui/components/LoopDetectionConfirmation.js +0 -37
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +0 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +0 -6
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +0 -28
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +0 -1
- package/dist/src/ui/components/MainContent.d.ts +0 -6
- package/dist/src/ui/components/MainContent.js +0 -28
- package/dist/src/ui/components/MainContent.js.map +0 -1
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +0 -7
- package/dist/src/ui/components/MemoryUsageDisplay.js +0 -24
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +0 -1
- package/dist/src/ui/components/ModelDialog.d.ts +0 -11
- package/dist/src/ui/components/ModelDialog.js +0 -43
- package/dist/src/ui/components/ModelDialog.js.map +0 -1
- package/dist/src/ui/components/ModelDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ModelDialog.test.js +0 -158
- package/dist/src/ui/components/ModelDialog.test.js.map +0 -1
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +0 -7
- package/dist/src/ui/components/ModelStatsDisplay.js +0 -34
- package/dist/src/ui/components/ModelStatsDisplay.js.map +0 -1
- package/dist/src/ui/components/ModelSwitchDialog.d.ts +0 -15
- package/dist/src/ui/components/ModelSwitchDialog.js +0 -40
- package/dist/src/ui/components/ModelSwitchDialog.js.map +0 -1
- package/dist/src/ui/components/ModelSwitchDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ModelSwitchDialog.test.js +0 -128
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +0 -1
- package/dist/src/ui/components/Notifications.d.ts +0 -6
- package/dist/src/ui/components/Notifications.js +0 -23
- package/dist/src/ui/components/Notifications.js.map +0 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +0 -32
- package/dist/src/ui/components/OpenAIKeyPrompt.js +0 -196
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +0 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +0 -6
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +0 -51
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +0 -1
- package/dist/src/ui/components/OrchestrationStatusDisplay.d.ts +0 -15
- package/dist/src/ui/components/OrchestrationStatusDisplay.js +0 -58
- package/dist/src/ui/components/OrchestrationStatusDisplay.js.map +0 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +0 -13
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +0 -48
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +0 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +0 -6
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +0 -154
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +0 -1
- package/dist/src/ui/components/PlanSummaryDisplay.d.ts +0 -14
- package/dist/src/ui/components/PlanSummaryDisplay.js +0 -9
- package/dist/src/ui/components/PlanSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/PrepareLabel.d.ts +0 -15
- package/dist/src/ui/components/PrepareLabel.js +0 -72
- package/dist/src/ui/components/PrepareLabel.js.map +0 -1
- package/dist/src/ui/components/PrepareLabel.test.d.ts +0 -6
- package/dist/src/ui/components/PrepareLabel.test.js +0 -71
- package/dist/src/ui/components/PrepareLabel.test.js.map +0 -1
- package/dist/src/ui/components/ProQuotaDialog.d.ts +0 -13
- package/dist/src/ui/components/ProQuotaDialog.js +0 -31
- package/dist/src/ui/components/ProQuotaDialog.js.map +0 -1
- package/dist/src/ui/components/ProQuotaDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ProQuotaDialog.test.js +0 -58
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +0 -1
- package/dist/src/ui/components/QueueStatusBar.d.ts +0 -17
- package/dist/src/ui/components/QueueStatusBar.js +0 -25
- package/dist/src/ui/components/QueueStatusBar.js.map +0 -1
- package/dist/src/ui/components/QueuedMessageDisplay.d.ts +0 -9
- package/dist/src/ui/components/QueuedMessageDisplay.js +0 -20
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +0 -1
- package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +0 -56
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +0 -1
- package/dist/src/ui/components/QuitConfirmationDialog.d.ts +0 -17
- package/dist/src/ui/components/QuitConfirmationDialog.js +0 -49
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +0 -1
- package/dist/src/ui/components/QuittingDisplay.d.ts +0 -6
- package/dist/src/ui/components/QuittingDisplay.js +0 -20
- package/dist/src/ui/components/QuittingDisplay.js.map +0 -1
- package/dist/src/ui/components/QwenOAuthProgress.d.ts +0 -16
- package/dist/src/ui/components/QwenOAuthProgress.js +0 -111
- package/dist/src/ui/components/QwenOAuthProgress.js.map +0 -1
- package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +0 -6
- package/dist/src/ui/components/QwenOAuthProgress.test.js +0 -364
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +0 -1
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +0 -11
- package/dist/src/ui/components/SessionSummaryDisplay.js +0 -5
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +0 -18
- package/dist/src/ui/components/SettingsDialog.js +0 -647
- package/dist/src/ui/components/SettingsDialog.js.map +0 -1
- package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
- package/dist/src/ui/components/SettingsDialog.test.js +0 -1037
- package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +0 -15
- package/dist/src/ui/components/ShellConfirmationDialog.js +0 -50
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +0 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +0 -40
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +0 -1
- package/dist/src/ui/components/ShellInputPrompt.d.ts +0 -11
- package/dist/src/ui/components/ShellInputPrompt.js +0 -36
- package/dist/src/ui/components/ShellInputPrompt.js.map +0 -1
- package/dist/src/ui/components/ShellModeIndicator.d.ts +0 -7
- package/dist/src/ui/components/ShellModeIndicator.js +0 -5
- package/dist/src/ui/components/ShellModeIndicator.js.map +0 -1
- package/dist/src/ui/components/ShowMoreLines.d.ts +0 -10
- package/dist/src/ui/components/ShowMoreLines.js +0 -24
- package/dist/src/ui/components/ShowMoreLines.js.map +0 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +0 -12
- package/dist/src/ui/components/StatsDisplay.js +0 -44
- package/dist/src/ui/components/StatsDisplay.js.map +0 -1
- package/dist/src/ui/components/StatusBar.d.ts +0 -14
- package/dist/src/ui/components/StatusBar.js +0 -106
- package/dist/src/ui/components/StatusBar.js.map +0 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +0 -27
- package/dist/src/ui/components/SuggestionsDisplay.js +0 -40
- package/dist/src/ui/components/SuggestionsDisplay.js.map +0 -1
- package/dist/src/ui/components/TaskMasterPanel.d.ts +0 -18
- package/dist/src/ui/components/TaskMasterPanel.js +0 -142
- package/dist/src/ui/components/TaskMasterPanel.js.map +0 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +0 -20
- package/dist/src/ui/components/ThemeDialog.js +0 -126
- package/dist/src/ui/components/ThemeDialog.js.map +0 -1
- package/dist/src/ui/components/ThemeDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ThemeDialog.test.js +0 -75
- package/dist/src/ui/components/ThemeDialog.test.js.map +0 -1
- package/dist/src/ui/components/Tips.d.ts +0 -12
- package/dist/src/ui/components/Tips.js +0 -10
- package/dist/src/ui/components/Tips.js.map +0 -1
- package/dist/src/ui/components/TodoDisplay.d.ts +0 -16
- package/dist/src/ui/components/TodoDisplay.js +0 -27
- package/dist/src/ui/components/TodoDisplay.js.map +0 -1
- package/dist/src/ui/components/TodoDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/TodoDisplay.test.js +0 -77
- package/dist/src/ui/components/TodoDisplay.test.js.map +0 -1
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +0 -7
- package/dist/src/ui/components/ToolStatsDisplay.js +0 -42
- package/dist/src/ui/components/ToolStatsDisplay.js.map +0 -1
- package/dist/src/ui/components/UpdateNotification.d.ts +0 -10
- package/dist/src/ui/components/UpdateNotification.js +0 -10
- package/dist/src/ui/components/UpdateNotification.js.map +0 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +0 -13
- package/dist/src/ui/components/WelcomeBackDialog.js +0 -43
- package/dist/src/ui/components/WelcomeBackDialog.js.map +0 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +0 -11
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +0 -45
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +0 -1
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +0 -12
- package/dist/src/ui/components/messages/CompressionMessage.js +0 -62
- package/dist/src/ui/components/messages/CompressionMessage.js.map +0 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/CompressionMessage.test.js +0 -160
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +0 -17
- package/dist/src/ui/components/messages/DiffRenderer.js +0 -218
- package/dist/src/ui/components/messages/DiffRenderer.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
- package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/ErrorMessage.js +0 -9
- package/dist/src/ui/components/messages/ErrorMessage.js.map +0 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +0 -14
- package/dist/src/ui/components/messages/GeminiMessage.js +0 -11
- package/dist/src/ui/components/messages/GeminiMessage.js.map +0 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +0 -14
- package/dist/src/ui/components/messages/GeminiMessageContent.js +0 -15
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +0 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/InfoMessage.js +0 -14
- package/dist/src/ui/components/messages/InfoMessage.js.map +0 -1
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/SummaryMessage.js +0 -35
- package/dist/src/ui/components/messages/SummaryMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +0 -16
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +0 -245
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -165
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +0 -19
- package/dist/src/ui/components/messages/ToolGroupMessage.js +0 -58
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +0 -261
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +0 -19
- package/dist/src/ui/components/messages/ToolMessage.js +0 -190
- package/dist/src/ui/components/messages/ToolMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolMessage.test.js +0 -182
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/UserMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/UserMessage.js +0 -13
- package/dist/src/ui/components/messages/UserMessage.js.map +0 -1
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/UserShellMessage.js +0 -9
- package/dist/src/ui/components/messages/UserShellMessage.js.map +0 -1
- package/dist/src/ui/components/messages/WarningMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/WarningMessage.js +0 -10
- package/dist/src/ui/components/messages/WarningMessage.js.map +0 -1
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +0 -38
- package/dist/src/ui/components/shared/BaseSelectionList.js +0 -72
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +0 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +0 -6
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +0 -376
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +0 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +0 -35
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +0 -13
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +0 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +0 -6
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +0 -79
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +0 -1
- package/dist/src/ui/components/shared/EnumSelector.d.ts +0 -18
- package/dist/src/ui/components/shared/EnumSelector.js +0 -44
- package/dist/src/ui/components/shared/EnumSelector.js.map +0 -1
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +0 -6
- package/dist/src/ui/components/shared/EnumSelector.test.js +0 -70
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +0 -61
- package/dist/src/ui/components/shared/MaxSizedBox.js +0 -451
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -154
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +0 -45
- package/dist/src/ui/components/shared/RadioButtonSelect.js +0 -21
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +0 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -134
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +0 -19
- package/dist/src/ui/components/shared/ScopeSelector.js +0 -16
- package/dist/src/ui/components/shared/ScopeSelector.js.map +0 -1
- package/dist/src/ui/components/shared/TextInput.d.ts +0 -16
- package/dist/src/ui/components/shared/TextInput.js +0 -127
- package/dist/src/ui/components/shared/TextInput.js.map +0 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +0 -490
- package/dist/src/ui/components/shared/text-buffer.js +0 -1598
- package/dist/src/ui/components/shared/text-buffer.js.map +0 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +0 -72
- package/dist/src/ui/components/shared/vim-buffer-actions.js +0 -552
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +0 -1
- package/dist/src/ui/components/subagents/constants.d.ts +0 -23
- package/dist/src/ui/components/subagents/constants.js +0 -67
- package/dist/src/ui/components/subagents/constants.js.map +0 -1
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +0 -15
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +0 -186
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +0 -1
- package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +0 -15
- package/dist/src/ui/components/subagents/create/ColorSelector.js +0 -43
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/CreationSummary.js +0 -174
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +0 -1
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +0 -107
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +0 -1
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +0 -39
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +0 -10
- package/dist/src/ui/components/subagents/create/LocationSelector.js +0 -39
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +0 -26
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +0 -28
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +0 -1
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +0 -16
- package/dist/src/ui/components/subagents/create/ToolSelector.js +0 -145
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +0 -1
- package/dist/src/ui/components/subagents/index.d.ts +0 -8
- package/dist/src/ui/components/subagents/index.js +0 -12
- package/dist/src/ui/components/subagents/index.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +0 -13
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +0 -71
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +0 -13
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +0 -36
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +0 -15
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +0 -73
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +0 -12
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +0 -231
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +0 -11
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +0 -20
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +0 -1
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +0 -15
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +0 -212
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +0 -1
- package/dist/src/ui/components/subagents/reducers.d.ts +0 -14
- package/dist/src/ui/components/subagents/reducers.js +0 -162
- package/dist/src/ui/components/subagents/reducers.js.map +0 -1
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +0 -20
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +0 -193
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +0 -1
- package/dist/src/ui/components/subagents/runtime/MultiAgentSummary.d.ts +0 -50
- package/dist/src/ui/components/subagents/runtime/MultiAgentSummary.js +0 -131
- package/dist/src/ui/components/subagents/runtime/MultiAgentSummary.js.map +0 -1
- package/dist/src/ui/components/subagents/types.d.ts +0 -137
- package/dist/src/ui/components/subagents/types.js +0 -15
- package/dist/src/ui/components/subagents/types.js.map +0 -1
- package/dist/src/ui/components/subagents/utils.d.ts +0 -15
- package/dist/src/ui/components/subagents/utils.js +0 -79
- package/dist/src/ui/components/subagents/utils.js.map +0 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +0 -6
- package/dist/src/ui/components/views/ExtensionsList.js +0 -47
- package/dist/src/ui/components/views/ExtensionsList.js.map +0 -1
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +0 -6
- package/dist/src/ui/components/views/ExtensionsList.test.js +0 -97
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +0 -1
- package/dist/src/ui/components/views/McpStatus.d.ts +0 -27
- package/dist/src/ui/components/views/McpStatus.js +0 -90
- package/dist/src/ui/components/views/McpStatus.js.map +0 -1
- package/dist/src/ui/components/views/McpStatus.test.d.ts +0 -6
- package/dist/src/ui/components/views/McpStatus.test.js +0 -117
- package/dist/src/ui/components/views/McpStatus.test.js.map +0 -1
- package/dist/src/ui/components/views/ToolsList.d.ts +0 -14
- package/dist/src/ui/components/views/ToolsList.js +0 -8
- package/dist/src/ui/components/views/ToolsList.js.map +0 -1
- package/dist/src/ui/components/views/ToolsList.test.d.ts +0 -6
- package/dist/src/ui/components/views/ToolsList.test.js +0 -45
- package/dist/src/ui/components/views/ToolsList.test.js.map +0 -1
- package/dist/src/ui/constants.d.ts +0 -18
- package/dist/src/ui/constants.js +0 -23
- package/dist/src/ui/constants.js.map +0 -1
- package/dist/src/ui/contexts/AppContext.d.ts +0 -11
- package/dist/src/ui/contexts/AppContext.js +0 -15
- package/dist/src/ui/contexts/AppContext.js.map +0 -1
- package/dist/src/ui/contexts/ConfigContext.d.ts +0 -9
- package/dist/src/ui/contexts/ConfigContext.js +0 -16
- package/dist/src/ui/contexts/ConfigContext.js.map +0 -1
- package/dist/src/ui/contexts/ConsultationContext.d.ts +0 -63
- package/dist/src/ui/contexts/ConsultationContext.js +0 -186
- package/dist/src/ui/contexts/ConsultationContext.js.map +0 -1
- package/dist/src/ui/contexts/IntelligentOrchestratorContext.d.ts +0 -87
- package/dist/src/ui/contexts/IntelligentOrchestratorContext.js +0 -336
- package/dist/src/ui/contexts/IntelligentOrchestratorContext.js.map +0 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +0 -35
- package/dist/src/ui/contexts/KeypressContext.js +0 -637
- package/dist/src/ui/contexts/KeypressContext.js.map +0 -1
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
- package/dist/src/ui/contexts/KeypressContext.test.js +0 -1180
- package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
- package/dist/src/ui/contexts/OrchestrationContext.d.ts +0 -55
- package/dist/src/ui/contexts/OrchestrationContext.js +0 -239
- package/dist/src/ui/contexts/OrchestrationContext.js.map +0 -1
- package/dist/src/ui/contexts/OverflowContext.d.ts +0 -19
- package/dist/src/ui/contexts/OverflowContext.js +0 -38
- package/dist/src/ui/contexts/OverflowContext.js.map +0 -1
- package/dist/src/ui/contexts/RoadmapContext.d.ts +0 -61
- package/dist/src/ui/contexts/RoadmapContext.js +0 -230
- package/dist/src/ui/contexts/RoadmapContext.js.map +0 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +0 -45
- package/dist/src/ui/contexts/SessionContext.js +0 -157
- package/dist/src/ui/contexts/SessionContext.js.map +0 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +0 -9
- package/dist/src/ui/contexts/SettingsContext.js +0 -15
- package/dist/src/ui/contexts/SettingsContext.js.map +0 -1
- package/dist/src/ui/contexts/ShellFocusContext.d.ts +0 -7
- package/dist/src/ui/contexts/ShellFocusContext.js +0 -9
- package/dist/src/ui/contexts/ShellFocusContext.js.map +0 -1
- package/dist/src/ui/contexts/StreamingContext.d.ts +0 -9
- package/dist/src/ui/contexts/StreamingContext.js +0 -15
- package/dist/src/ui/contexts/StreamingContext.js.map +0 -1
- package/dist/src/ui/contexts/TaskmasterContext.d.ts +0 -87
- package/dist/src/ui/contexts/TaskmasterContext.js +0 -184
- package/dist/src/ui/contexts/TaskmasterContext.js.map +0 -1
- package/dist/src/ui/contexts/TodoContext.d.ts +0 -26
- package/dist/src/ui/contexts/TodoContext.js +0 -50
- package/dist/src/ui/contexts/TodoContext.js.map +0 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +0 -46
- package/dist/src/ui/contexts/UIActionsContext.js +0 -22
- package/dist/src/ui/contexts/UIActionsContext.js.map +0 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +0 -116
- package/dist/src/ui/contexts/UIStateContext.js +0 -17
- package/dist/src/ui/contexts/UIStateContext.js.map +0 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +0 -19
- package/dist/src/ui/contexts/VimModeContext.js +0 -48
- package/dist/src/ui/contexts/VimModeContext.js.map +0 -1
- package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -19
- package/dist/src/ui/editors/editorSettingsManager.js +0 -48
- package/dist/src/ui/editors/editorSettingsManager.js.map +0 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +0 -31
- package/dist/src/ui/hooks/atCommandProcessor.js +0 -364
- package/dist/src/ui/hooks/atCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
- package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -836
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/keyToAnsi.d.ts +0 -15
- package/dist/src/ui/hooks/keyToAnsi.js +0 -67
- package/dist/src/ui/hooks/keyToAnsi.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -18
- package/dist/src/ui/hooks/shellCommandProcessor.js +0 -284
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +0 -6
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +0 -508
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +0 -53
- package/dist/src/ui/hooks/slashCommandProcessor.js +0 -510
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +0 -11
- package/dist/src/ui/hooks/useAgentsManagerDialog.js +0 -21
- package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +0 -1
- package/dist/src/ui/hooks/useApprovalModeCommand.d.ts +0 -14
- package/dist/src/ui/hooks/useApprovalModeCommand.js +0 -33
- package/dist/src/ui/hooks/useApprovalModeCommand.js.map +0 -1
- package/dist/src/ui/hooks/useAtCompletion.d.ts +0 -23
- package/dist/src/ui/hooks/useAtCompletion.js +0 -179
- package/dist/src/ui/hooks/useAtCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useAttentionNotifications.d.ts +0 -14
- package/dist/src/ui/hooks/useAttentionNotifications.js +0 -41
- package/dist/src/ui/hooks/useAttentionNotifications.js.map +0 -1
- package/dist/src/ui/hooks/useAttentionNotifications.test.d.ts +0 -6
- package/dist/src/ui/hooks/useAttentionNotifications.test.js +0 -113
- package/dist/src/ui/hooks/useAttentionNotifications.test.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +0 -13
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +0 -40
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +0 -6
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +0 -306
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
- package/dist/src/ui/hooks/useBracketedPaste.js +0 -32
- package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +0 -29
- package/dist/src/ui/hooks/useCommandCompletion.js +0 -164
- package/dist/src/ui/hooks/useCommandCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +0 -24
- package/dist/src/ui/hooks/useCompletion.js +0 -88
- package/dist/src/ui/hooks/useCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -12
- package/dist/src/ui/hooks/useConsoleMessages.js +0 -76
- package/dist/src/ui/hooks/useConsoleMessages.js.map +0 -1
- package/dist/src/ui/hooks/useConsultationGenerator.d.ts +0 -17
- package/dist/src/ui/hooks/useConsultationGenerator.js +0 -207
- package/dist/src/ui/hooks/useConsultationGenerator.js.map +0 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +0 -35
- package/dist/src/ui/hooks/useDialogClose.js +0 -53
- package/dist/src/ui/hooks/useDialogClose.js.map +0 -1
- package/dist/src/ui/hooks/useEditorSettings.d.ts +0 -16
- package/dist/src/ui/hooks/useEditorSettings.js +0 -43
- package/dist/src/ui/hooks/useEditorSettings.js.map +0 -1
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
- package/dist/src/ui/hooks/useEditorSettings.test.js +0 -164
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +0 -21
- package/dist/src/ui/hooks/useExtensionUpdates.js +0 -116
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +0 -1
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +0 -6
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +0 -243
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +0 -1
- package/dist/src/ui/hooks/useFocus.d.ts +0 -10
- package/dist/src/ui/hooks/useFocus.js +0 -51
- package/dist/src/ui/hooks/useFocus.js.map +0 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +0 -13
- package/dist/src/ui/hooks/useFolderTrust.js +0 -60
- package/dist/src/ui/hooks/useFolderTrust.js.map +0 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +0 -39
- package/dist/src/ui/hooks/useGeminiStream.js +0 -781
- package/dist/src/ui/hooks/useGeminiStream.js.map +0 -1
- package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
- package/dist/src/ui/hooks/useGeminiStream.test.js +0 -2036
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
- package/dist/src/ui/hooks/useGitBranchName.d.ts +0 -6
- package/dist/src/ui/hooks/useGitBranchName.js +0 -61
- package/dist/src/ui/hooks/useGitBranchName.js.map +0 -1
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
- package/dist/src/ui/hooks/useGitBranchName.test.js +0 -189
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
- package/dist/src/ui/hooks/useHistoryManager.d.ts +0 -22
- package/dist/src/ui/hooks/useHistoryManager.js +0 -72
- package/dist/src/ui/hooks/useHistoryManager.js.map +0 -1
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
- package/dist/src/ui/hooks/useHistoryManager.test.js +0 -171
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
- package/dist/src/ui/hooks/useIdeTrustListener.d.ts +0 -16
- package/dist/src/ui/hooks/useIdeTrustListener.js +0 -65
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +0 -1
- package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +0 -6
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +0 -183
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +0 -1
- package/dist/src/ui/hooks/useInitializationAuthError.d.ts +0 -22
- package/dist/src/ui/hooks/useInitializationAuthError.js +0 -40
- package/dist/src/ui/hooks/useInitializationAuthError.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistory.d.ts +0 -19
- package/dist/src/ui/hooks/useInputHistory.js +0 -84
- package/dist/src/ui/hooks/useInputHistory.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
- package/dist/src/ui/hooks/useInputHistory.test.js +0 -207
- package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistoryStore.d.ts +0 -19
- package/dist/src/ui/hooks/useInputHistoryStore.js +0 -81
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +0 -6
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +0 -234
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +0 -1
- package/dist/src/ui/hooks/useKeypress.d.ts +0 -17
- package/dist/src/ui/hooks/useKeypress.js +0 -27
- package/dist/src/ui/hooks/useKeypress.js.map +0 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -15
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +0 -20
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +0 -1
- package/dist/src/ui/hooks/useLaunchEditor.d.ts +0 -10
- package/dist/src/ui/hooks/useLaunchEditor.js +0 -70
- package/dist/src/ui/hooks/useLaunchEditor.js.map +0 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +0 -10
- package/dist/src/ui/hooks/useLoadingIndicator.js +0 -44
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -91
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/hooks/useLogger.d.ts +0 -11
- package/dist/src/ui/hooks/useLogger.js +0 -29
- package/dist/src/ui/hooks/useLogger.js.map +0 -1
- package/dist/src/ui/hooks/useMemoryMonitor.d.ts +0 -13
- package/dist/src/ui/hooks/useMemoryMonitor.js +0 -28
- package/dist/src/ui/hooks/useMemoryMonitor.js.map +0 -1
- package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +0 -6
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +0 -57
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +0 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +0 -23
- package/dist/src/ui/hooks/useMessageQueue.js +0 -51
- package/dist/src/ui/hooks/useMessageQueue.js.map +0 -1
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
- package/dist/src/ui/hooks/useMessageQueue.test.js +0 -167
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
- package/dist/src/ui/hooks/useModelCommand.d.ts +0 -12
- package/dist/src/ui/hooks/useModelCommand.js +0 -21
- package/dist/src/ui/hooks/useModelCommand.js.map +0 -1
- package/dist/src/ui/hooks/useModelCommand.test.d.ts +0 -6
- package/dist/src/ui/hooks/useModelCommand.test.js +0 -35
- package/dist/src/ui/hooks/useModelCommand.test.js.map +0 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +0 -17
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +0 -78
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +0 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +0 -6
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +0 -182
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +0 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -14
- package/dist/src/ui/hooks/usePhraseCycler.js +0 -192
- package/dist/src/ui/hooks/usePhraseCycler.js.map +0 -1
- package/dist/src/ui/hooks/useQuitConfirmation.d.ts +0 -14
- package/dist/src/ui/hooks/useQuitConfirmation.js +0 -36
- package/dist/src/ui/hooks/useQuitConfirmation.js.map +0 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +0 -21
- package/dist/src/ui/hooks/useQuotaAndFallback.js +0 -122
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +0 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +0 -6
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +0 -269
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +0 -1
- package/dist/src/ui/hooks/useQwenAuth.d.ts +0 -15
- package/dist/src/ui/hooks/useQwenAuth.js +0 -74
- package/dist/src/ui/hooks/useQwenAuth.js.map +0 -1
- package/dist/src/ui/hooks/useQwenAuth.test.d.ts +0 -6
- package/dist/src/ui/hooks/useQwenAuth.test.js +0 -266
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +0 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -34
- package/dist/src/ui/hooks/useReactToolScheduler.js +0 -192
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +0 -19
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +0 -103
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -163
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
- package/dist/src/ui/hooks/useSelectionList.d.ts +0 -34
- package/dist/src/ui/hooks/useSelectionList.js +0 -245
- package/dist/src/ui/hooks/useSelectionList.js.map +0 -1
- package/dist/src/ui/hooks/useSelectionList.test.d.ts +0 -6
- package/dist/src/ui/hooks/useSelectionList.test.js +0 -701
- package/dist/src/ui/hooks/useSelectionList.test.js.map +0 -1
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +0 -10
- package/dist/src/ui/hooks/useSettingsCommand.js +0 -21
- package/dist/src/ui/hooks/useSettingsCommand.js.map +0 -1
- package/dist/src/ui/hooks/useShellHistory.d.ts +0 -14
- package/dist/src/ui/hooks/useShellHistory.js +0 -111
- package/dist/src/ui/hooks/useShellHistory.js.map +0 -1
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
- package/dist/src/ui/hooks/useShellHistory.test.js +0 -187
- package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
- package/dist/src/ui/hooks/useShowMemoryCommand.js +0 -58
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +0 -20
- package/dist/src/ui/hooks/useSlashCompletion.js +0 -349
- package/dist/src/ui/hooks/useSlashCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -9
- package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -597
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
- package/dist/src/ui/hooks/useStateAndRef.d.ts +0 -7
- package/dist/src/ui/hooks/useStateAndRef.js +0 -26
- package/dist/src/ui/hooks/useStateAndRef.js.map +0 -1
- package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +0 -10
- package/dist/src/ui/hooks/useSubagentCreateDialog.js +0 -21
- package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +0 -1
- package/dist/src/ui/hooks/useTaskmasterOrchestrator.d.ts +0 -35
- package/dist/src/ui/hooks/useTaskmasterOrchestrator.js +0 -177
- package/dist/src/ui/hooks/useTaskmasterOrchestrator.js.map +0 -1
- package/dist/src/ui/hooks/useTerminalSize.d.ts +0 -9
- package/dist/src/ui/hooks/useTerminalSize.js +0 -27
- package/dist/src/ui/hooks/useTerminalSize.js.map +0 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +0 -15
- package/dist/src/ui/hooks/useThemeCommand.js +0 -73
- package/dist/src/ui/hooks/useThemeCommand.js.map +0 -1
- package/dist/src/ui/hooks/useTimer.d.ts +0 -12
- package/dist/src/ui/hooks/useTimer.js +0 -58
- package/dist/src/ui/hooks/useTimer.js.map +0 -1
- package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
- package/dist/src/ui/hooks/useTimer.test.js +0 -90
- package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
- package/dist/src/ui/hooks/useToolScheduler.test.js +0 -623
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
- package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +0 -47
- package/dist/src/ui/hooks/useVisionAutoSwitch.js +0 -262
- package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +0 -1
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.d.ts +0 -6
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +0 -515
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +0 -1
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +0 -23
- package/dist/src/ui/hooks/useWelcomeBack.js +0 -79
- package/dist/src/ui/hooks/useWelcomeBack.js.map +0 -1
- package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +0 -13
- package/dist/src/ui/hooks/useWorkspaceMigration.js +0 -54
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +0 -1
- package/dist/src/ui/hooks/vim.d.ts +0 -28
- package/dist/src/ui/hooks/vim.js +0 -639
- package/dist/src/ui/hooks/vim.js.map +0 -1
- package/dist/src/ui/keyMatchers.d.ts +0 -27
- package/dist/src/ui/keyMatchers.js +0 -68
- package/dist/src/ui/keyMatchers.js.map +0 -1
- package/dist/src/ui/keyMatchers.test.d.ts +0 -6
- package/dist/src/ui/keyMatchers.test.js +0 -293
- package/dist/src/ui/keyMatchers.test.js.map +0 -1
- package/dist/src/ui/layouts/DefaultAppLayout.d.ts +0 -9
- package/dist/src/ui/layouts/DefaultAppLayout.js +0 -14
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +0 -1
- package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +0 -7
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js +0 -14
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +0 -1
- package/dist/src/ui/models/availableModels.d.ts +0 -56
- package/dist/src/ui/models/availableModels.js +0 -223
- package/dist/src/ui/models/availableModels.js.map +0 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +0 -12
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +0 -29
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +0 -1
- package/dist/src/ui/semantic-colors.d.ts +0 -7
- package/dist/src/ui/semantic-colors.js +0 -24
- package/dist/src/ui/semantic-colors.js.map +0 -1
- package/dist/src/ui/state/extensions.d.ts +0 -42
- package/dist/src/ui/state/extensions.js +0 -62
- package/dist/src/ui/state/extensions.js.map +0 -1
- package/dist/src/ui/textConstants.d.ts +0 -9
- package/dist/src/ui/textConstants.js +0 -10
- package/dist/src/ui/textConstants.js.map +0 -1
- package/dist/src/ui/themes/ansi-light.d.ts +0 -7
- package/dist/src/ui/themes/ansi-light.js +0 -142
- package/dist/src/ui/themes/ansi-light.js.map +0 -1
- package/dist/src/ui/themes/ansi.d.ts +0 -7
- package/dist/src/ui/themes/ansi.js +0 -152
- package/dist/src/ui/themes/ansi.js.map +0 -1
- package/dist/src/ui/themes/atom-one-dark.d.ts +0 -7
- package/dist/src/ui/themes/atom-one-dark.js +0 -138
- package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
- package/dist/src/ui/themes/ayu-light.d.ts +0 -7
- package/dist/src/ui/themes/ayu-light.js +0 -130
- package/dist/src/ui/themes/ayu-light.js.map +0 -1
- package/dist/src/ui/themes/ayu.d.ts +0 -7
- package/dist/src/ui/themes/ayu.js +0 -104
- package/dist/src/ui/themes/ayu.js.map +0 -1
- package/dist/src/ui/themes/color-utils.d.ts +0 -21
- package/dist/src/ui/themes/color-utils.js +0 -221
- package/dist/src/ui/themes/color-utils.js.map +0 -1
- package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
- package/dist/src/ui/themes/color-utils.test.js +0 -197
- package/dist/src/ui/themes/color-utils.test.js.map +0 -1
- package/dist/src/ui/themes/default-light.d.ts +0 -7
- package/dist/src/ui/themes/default-light.js +0 -100
- package/dist/src/ui/themes/default-light.js.map +0 -1
- package/dist/src/ui/themes/default.d.ts +0 -7
- package/dist/src/ui/themes/default.js +0 -143
- package/dist/src/ui/themes/default.js.map +0 -1
- package/dist/src/ui/themes/dracula.d.ts +0 -7
- package/dist/src/ui/themes/dracula.js +0 -115
- package/dist/src/ui/themes/dracula.js.map +0 -1
- package/dist/src/ui/themes/github-dark.d.ts +0 -7
- package/dist/src/ui/themes/github-dark.js +0 -138
- package/dist/src/ui/themes/github-dark.js.map +0 -1
- package/dist/src/ui/themes/github-light.d.ts +0 -7
- package/dist/src/ui/themes/github-light.js +0 -140
- package/dist/src/ui/themes/github-light.js.map +0 -1
- package/dist/src/ui/themes/googlecode.d.ts +0 -7
- package/dist/src/ui/themes/googlecode.js +0 -137
- package/dist/src/ui/themes/googlecode.js.map +0 -1
- package/dist/src/ui/themes/no-color.d.ts +0 -7
- package/dist/src/ui/themes/no-color.js +0 -115
- package/dist/src/ui/themes/no-color.js.map +0 -1
- package/dist/src/ui/themes/qwen-dark.d.ts +0 -7
- package/dist/src/ui/themes/qwen-dark.js +0 -106
- package/dist/src/ui/themes/qwen-dark.js.map +0 -1
- package/dist/src/ui/themes/qwen-light.d.ts +0 -7
- package/dist/src/ui/themes/qwen-light.js +0 -131
- package/dist/src/ui/themes/qwen-light.js.map +0 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +0 -37
- package/dist/src/ui/themes/semantic-tokens.js +0 -94
- package/dist/src/ui/themes/semantic-tokens.js.map +0 -1
- package/dist/src/ui/themes/shades-of-purple.d.ts +0 -11
- package/dist/src/ui/themes/shades-of-purple.js +0 -304
- package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
- package/dist/src/ui/themes/theme-manager.d.ts +0 -66
- package/dist/src/ui/themes/theme-manager.js +0 -270
- package/dist/src/ui/themes/theme-manager.js.map +0 -1
- package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
- package/dist/src/ui/themes/theme-manager.test.js +0 -142
- package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
- package/dist/src/ui/themes/theme.d.ts +0 -130
- package/dist/src/ui/themes/theme.js +0 -379
- package/dist/src/ui/themes/theme.js.map +0 -1
- package/dist/src/ui/themes/xcode.d.ts +0 -7
- package/dist/src/ui/themes/xcode.js +0 -145
- package/dist/src/ui/themes/xcode.js.map +0 -1
- package/dist/src/ui/types.d.ts +0 -311
- package/dist/src/ui/types.js +0 -60
- package/dist/src/ui/types.js.map +0 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +0 -17
- package/dist/src/ui/utils/CodeColorizer.js +0 -111
- package/dist/src/ui/utils/CodeColorizer.js.map +0 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +0 -25
- package/dist/src/ui/utils/ConsolePatcher.js +0 -52
- package/dist/src/ui/utils/ConsolePatcher.js.map +0 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -16
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +0 -111
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +0 -14
- package/dist/src/ui/utils/MarkdownDisplay.js +0 -207
- package/dist/src/ui/utils/MarkdownDisplay.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
- package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -169
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
- package/dist/src/ui/utils/TableRenderer.d.ts +0 -17
- package/dist/src/ui/utils/TableRenderer.js +0 -84
- package/dist/src/ui/utils/TableRenderer.js.map +0 -1
- package/dist/src/ui/utils/clipboardUtils.d.ts +0 -22
- package/dist/src/ui/utils/clipboardUtils.js +0 -126
- package/dist/src/ui/utils/clipboardUtils.js.map +0 -1
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/clipboardUtils.test.js +0 -65
- package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
- package/dist/src/ui/utils/commandUtils.d.ts +0 -40
- package/dist/src/ui/utils/commandUtils.js +0 -146
- package/dist/src/ui/utils/commandUtils.js.map +0 -1
- package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/commandUtils.test.js +0 -352
- package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
- package/dist/src/ui/utils/computeStats.d.ts +0 -10
- package/dist/src/ui/utils/computeStats.js +0 -57
- package/dist/src/ui/utils/computeStats.js.map +0 -1
- package/dist/src/ui/utils/displayUtils.d.ts +0 -18
- package/dist/src/ui/utils/displayUtils.js +0 -27
- package/dist/src/ui/utils/displayUtils.js.map +0 -1
- package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/displayUtils.test.js +0 -61
- package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
- package/dist/src/ui/utils/formatters.d.ts +0 -13
- package/dist/src/ui/utils/formatters.js +0 -56
- package/dist/src/ui/utils/formatters.js.map +0 -1
- package/dist/src/ui/utils/formatters.test.d.ts +0 -6
- package/dist/src/ui/utils/formatters.test.js +0 -56
- package/dist/src/ui/utils/formatters.test.js.map +0 -1
- package/dist/src/ui/utils/highlight.d.ts +0 -11
- package/dist/src/ui/utils/highlight.js +0 -78
- package/dist/src/ui/utils/highlight.js.map +0 -1
- package/dist/src/ui/utils/highlight.test.d.ts +0 -6
- package/dist/src/ui/utils/highlight.test.js +0 -120
- package/dist/src/ui/utils/highlight.test.js.map +0 -1
- package/dist/src/ui/utils/isNarrowWidth.d.ts +0 -6
- package/dist/src/ui/utils/isNarrowWidth.js +0 -9
- package/dist/src/ui/utils/isNarrowWidth.js.map +0 -1
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +0 -13
- package/dist/src/ui/utils/kittyProtocolDetector.js +0 -98
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +0 -1
- package/dist/src/ui/utils/markdownUtilities.d.ts +0 -6
- package/dist/src/ui/utils/markdownUtilities.js +0 -110
- package/dist/src/ui/utils/markdownUtilities.js.map +0 -1
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
- package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
- package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
- package/dist/src/ui/utils/platformConstants.d.ts +0 -75
- package/dist/src/ui/utils/platformConstants.js +0 -78
- package/dist/src/ui/utils/platformConstants.js.map +0 -1
- package/dist/src/ui/utils/terminalSetup.d.ts +0 -30
- package/dist/src/ui/utils/terminalSetup.js +0 -308
- package/dist/src/ui/utils/terminalSetup.js.map +0 -1
- package/dist/src/ui/utils/terminalUI.d.ts +0 -162
- package/dist/src/ui/utils/terminalUI.js +0 -285
- package/dist/src/ui/utils/terminalUI.js.map +0 -1
- package/dist/src/ui/utils/textUtils.d.ts +0 -42
- package/dist/src/ui/utils/textUtils.js +0 -185
- package/dist/src/ui/utils/textUtils.js.map +0 -1
- package/dist/src/ui/utils/textUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/textUtils.test.js +0 -132
- package/dist/src/ui/utils/textUtils.test.js.map +0 -1
- package/dist/src/ui/utils/updateCheck.d.ts +0 -12
- package/dist/src/ui/utils/updateCheck.js +0 -78
- package/dist/src/ui/utils/updateCheck.js.map +0 -1
- package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
- package/dist/src/ui/utils/updateCheck.test.js +0 -145
- package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
- package/dist/src/utils/attentionNotification.d.ts +0 -20
- package/dist/src/utils/attentionNotification.js +0 -34
- package/dist/src/utils/attentionNotification.js.map +0 -1
- package/dist/src/utils/attentionNotification.test.d.ts +0 -6
- package/dist/src/utils/attentionNotification.test.js +0 -46
- package/dist/src/utils/attentionNotification.test.js.map +0 -1
- package/dist/src/utils/checks.d.ts +0 -19
- package/dist/src/utils/checks.js +0 -24
- package/dist/src/utils/checks.js.map +0 -1
- package/dist/src/utils/cleanup.d.ts +0 -8
- package/dist/src/utils/cleanup.js +0 -35
- package/dist/src/utils/cleanup.js.map +0 -1
- package/dist/src/utils/commands.d.ts +0 -20
- package/dist/src/utils/commands.js +0 -53
- package/dist/src/utils/commands.js.map +0 -1
- package/dist/src/utils/commands.test.d.ts +0 -6
- package/dist/src/utils/commands.test.js +0 -115
- package/dist/src/utils/commands.test.js.map +0 -1
- package/dist/src/utils/commentJson.d.ts +0 -9
- package/dist/src/utils/commentJson.js +0 -55
- package/dist/src/utils/commentJson.js.map +0 -1
- package/dist/src/utils/commentJson.test.d.ts +0 -6
- package/dist/src/utils/commentJson.test.js +0 -146
- package/dist/src/utils/commentJson.test.js.map +0 -1
- package/dist/src/utils/deepMerge.d.ts +0 -9
- package/dist/src/utils/deepMerge.js +0 -58
- package/dist/src/utils/deepMerge.js.map +0 -1
- package/dist/src/utils/deepMerge.test.d.ts +0 -6
- package/dist/src/utils/deepMerge.test.js +0 -143
- package/dist/src/utils/deepMerge.test.js.map +0 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +0 -28
- package/dist/src/utils/dialogScopeUtils.js +0 -51
- package/dist/src/utils/dialogScopeUtils.js.map +0 -1
- package/dist/src/utils/envVarResolver.d.ts +0 -39
- package/dist/src/utils/envVarResolver.js +0 -97
- package/dist/src/utils/envVarResolver.js.map +0 -1
- package/dist/src/utils/envVarResolver.test.d.ts +0 -6
- package/dist/src/utils/envVarResolver.test.js +0 -221
- package/dist/src/utils/envVarResolver.test.js.map +0 -1
- package/dist/src/utils/errors.d.ts +0 -35
- package/dist/src/utils/errors.js +0 -106
- package/dist/src/utils/errors.js.map +0 -1
- package/dist/src/utils/errors.test.d.ts +0 -6
- package/dist/src/utils/errors.test.js +0 -340
- package/dist/src/utils/errors.test.js.map +0 -1
- package/dist/src/utils/events.d.ts +0 -12
- package/dist/src/utils/events.js +0 -14
- package/dist/src/utils/events.js.map +0 -1
- package/dist/src/utils/gitUtils.d.ts +0 -30
- package/dist/src/utils/gitUtils.js +0 -89
- package/dist/src/utils/gitUtils.js.map +0 -1
- package/dist/src/utils/gitUtils.test.d.ts +0 -6
- package/dist/src/utils/gitUtils.test.js +0 -113
- package/dist/src/utils/gitUtils.test.js.map +0 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +0 -11
- package/dist/src/utils/handleAutoUpdate.js +0 -102
- package/dist/src/utils/handleAutoUpdate.js.map +0 -1
- package/dist/src/utils/installationInfo.d.ts +0 -23
- package/dist/src/utils/installationInfo.js +0 -153
- package/dist/src/utils/installationInfo.js.map +0 -1
- package/dist/src/utils/installationInfo.test.d.ts +0 -6
- package/dist/src/utils/installationInfo.test.js +0 -242
- package/dist/src/utils/installationInfo.test.js.map +0 -1
- package/dist/src/utils/math.d.ts +0 -13
- package/dist/src/utils/math.js +0 -14
- package/dist/src/utils/math.js.map +0 -1
- package/dist/src/utils/nonInteractiveHelpers.d.ts +0 -88
- package/dist/src/utils/nonInteractiveHelpers.js +0 -470
- package/dist/src/utils/nonInteractiveHelpers.js.map +0 -1
- package/dist/src/utils/nonInteractiveHelpers.test.d.ts +0 -6
- package/dist/src/utils/nonInteractiveHelpers.test.js +0 -945
- package/dist/src/utils/nonInteractiveHelpers.test.js.map +0 -1
- package/dist/src/utils/package.d.ts +0 -12
- package/dist/src/utils/package.js +0 -24
- package/dist/src/utils/package.js.map +0 -1
- package/dist/src/utils/processUtils.d.ts +0 -13
- package/dist/src/utils/processUtils.js +0 -18
- package/dist/src/utils/processUtils.js.map +0 -1
- package/dist/src/utils/processUtils.test.d.ts +0 -6
- package/dist/src/utils/processUtils.test.js +0 -20
- package/dist/src/utils/processUtils.test.js.map +0 -1
- package/dist/src/utils/readStdin.d.ts +0 -6
- package/dist/src/utils/readStdin.js +0 -59
- package/dist/src/utils/readStdin.js.map +0 -1
- package/dist/src/utils/readStdin.test.d.ts +0 -6
- package/dist/src/utils/readStdin.test.js +0 -88
- package/dist/src/utils/readStdin.test.js.map +0 -1
- package/dist/src/utils/relaunch.d.ts +0 -7
- package/dist/src/utils/relaunch.js +0 -57
- package/dist/src/utils/relaunch.js.map +0 -1
- package/dist/src/utils/relaunch.test.d.ts +0 -6
- package/dist/src/utils/relaunch.test.js +0 -273
- package/dist/src/utils/relaunch.test.js.map +0 -1
- package/dist/src/utils/resolvePath.d.ts +0 -6
- package/dist/src/utils/resolvePath.js +0 -21
- package/dist/src/utils/resolvePath.js.map +0 -1
- package/dist/src/utils/sandbox.d.ts +0 -7
- package/dist/src/utils/sandbox.js +0 -763
- package/dist/src/utils/sandbox.js.map +0 -1
- package/dist/src/utils/settingsUtils.d.ts +0 -144
- package/dist/src/utils/settingsUtils.js +0 -346
- package/dist/src/utils/settingsUtils.js.map +0 -1
- package/dist/src/utils/settingsUtils.test.d.ts +0 -6
- package/dist/src/utils/settingsUtils.test.js +0 -808
- package/dist/src/utils/settingsUtils.test.js.map +0 -1
- package/dist/src/utils/spawnWrapper.d.ts +0 -7
- package/dist/src/utils/spawnWrapper.js +0 -8
- package/dist/src/utils/spawnWrapper.js.map +0 -1
- package/dist/src/utils/startupWarnings.d.ts +0 -6
- package/dist/src/utils/startupWarnings.js +0 -40
- package/dist/src/utils/startupWarnings.js.map +0 -1
- package/dist/src/utils/systemInfo.d.ts +0 -66
- package/dist/src/utils/systemInfo.js +0 -125
- package/dist/src/utils/systemInfo.js.map +0 -1
- package/dist/src/utils/systemInfo.test.d.ts +0 -6
- package/dist/src/utils/systemInfo.test.js +0 -259
- package/dist/src/utils/systemInfo.test.js.map +0 -1
- package/dist/src/utils/systemInfoFields.d.ts +0 -22
- package/dist/src/utils/systemInfoFields.js +0 -96
- package/dist/src/utils/systemInfoFields.js.map +0 -1
- package/dist/src/utils/updateEventEmitter.d.ts +0 -11
- package/dist/src/utils/updateEventEmitter.js +0 -12
- package/dist/src/utils/updateEventEmitter.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.d.ts +0 -12
- package/dist/src/utils/userStartupWarnings.js +0 -74
- package/dist/src/utils/userStartupWarnings.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
- package/dist/src/utils/userStartupWarnings.test.js +0 -88
- package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
- package/dist/src/utils/version.d.ts +0 -6
- package/dist/src/utils/version.js +0 -11
- package/dist/src/utils/version.js.map +0 -1
- package/dist/src/utils/windowTitle.d.ts +0 -12
- package/dist/src/utils/windowTitle.js +0 -19
- package/dist/src/utils/windowTitle.js.map +0 -1
- package/dist/src/utils/windowTitle.test.d.ts +0 -6
- package/dist/src/utils/windowTitle.test.js +0 -49
- package/dist/src/utils/windowTitle.test.js.map +0 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +0 -9
- package/dist/src/validateNonInterActiveAuth.js +0 -76
- package/dist/src/validateNonInterActiveAuth.js.map +0 -1
- package/dist/src/zed-integration/acp.d.ts +0 -63
- package/dist/src/zed-integration/acp.js +0 -225
- package/dist/src/zed-integration/acp.js.map +0 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +0 -20
- package/dist/src/zed-integration/fileSystemService.js +0 -46
- package/dist/src/zed-integration/fileSystemService.js.map +0 -1
- package/dist/src/zed-integration/schema.d.ts +0 -12024
- package/dist/src/zed-integration/schema.js +0 -324
- package/dist/src/zed-integration/schema.js.map +0 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +0 -17
- package/dist/src/zed-integration/zedIntegration.js +0 -1135
- package/dist/src/zed-integration/zedIntegration.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/{dist/src/i18n/locales → locales}/en.js +0 -0
- /package/{dist/src/i18n/locales → locales}/zh.js +0 -0
- /package/{dist/src/utils/sandbox-macos-permissive-closed.sb → sandbox-macos-permissive-closed.sb} +0 -0
- /package/{dist/src/utils/sandbox-macos-permissive-open.sb → sandbox-macos-permissive-open.sb} +0 -0
- /package/{dist/src/utils/sandbox-macos-permissive-proxied.sb → sandbox-macos-permissive-proxied.sb} +0 -0
- /package/{dist/src/utils/sandbox-macos-restrictive-closed.sb → sandbox-macos-restrictive-closed.sb} +0 -0
- /package/{dist/src/utils/sandbox-macos-restrictive-open.sb → sandbox-macos-restrictive-open.sb} +0 -0
- /package/{dist/src/utils/sandbox-macos-restrictive-proxied.sb → sandbox-macos-restrictive-proxied.sb} +0 -0
|
@@ -1,1598 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 OSAgent OC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { spawnSync } from 'node:child_process';
|
|
7
|
-
import fs from 'node:fs';
|
|
8
|
-
import os from 'node:os';
|
|
9
|
-
import pathMod from 'node:path';
|
|
10
|
-
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
|
11
|
-
import { unescapePath } from 'osagent-core';
|
|
12
|
-
import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, getCachedStringWidth, } from '../../utils/textUtils.js';
|
|
13
|
-
import { handleVimAction } from './vim-buffer-actions.js';
|
|
14
|
-
// Simple helper for word‑wise ops.
|
|
15
|
-
function isWordChar(ch) {
|
|
16
|
-
if (ch === undefined) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
return !/[\s,.;!?]/.test(ch);
|
|
20
|
-
}
|
|
21
|
-
// Helper functions for line-based word navigation
|
|
22
|
-
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
|
|
23
|
-
export const isWhitespace = (char) => /\s/.test(char);
|
|
24
|
-
// Check if a character is a combining mark (only diacritics for now)
|
|
25
|
-
export const isCombiningMark = (char) => /\p{M}/u.test(char);
|
|
26
|
-
// Check if a character should be considered part of a word (including combining marks)
|
|
27
|
-
export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
|
|
28
|
-
// Get the script of a character (simplified for common scripts)
|
|
29
|
-
export const getCharScript = (char) => {
|
|
30
|
-
if (/[\p{Script=Latin}]/u.test(char))
|
|
31
|
-
return 'latin'; // All Latin script chars including diacritics
|
|
32
|
-
if (/[\p{Script=Han}]/u.test(char))
|
|
33
|
-
return 'han'; // Chinese
|
|
34
|
-
if (/[\p{Script=Arabic}]/u.test(char))
|
|
35
|
-
return 'arabic';
|
|
36
|
-
if (/[\p{Script=Hiragana}]/u.test(char))
|
|
37
|
-
return 'hiragana';
|
|
38
|
-
if (/[\p{Script=Katakana}]/u.test(char))
|
|
39
|
-
return 'katakana';
|
|
40
|
-
if (/[\p{Script=Cyrillic}]/u.test(char))
|
|
41
|
-
return 'cyrillic';
|
|
42
|
-
return 'other';
|
|
43
|
-
};
|
|
44
|
-
// Check if two characters are from different scripts (indicating word boundary)
|
|
45
|
-
export const isDifferentScript = (char1, char2) => {
|
|
46
|
-
if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
|
|
47
|
-
return false;
|
|
48
|
-
return getCharScript(char1) !== getCharScript(char2);
|
|
49
|
-
};
|
|
50
|
-
// Find next word start within a line, starting from col
|
|
51
|
-
export const findNextWordStartInLine = (line, col) => {
|
|
52
|
-
const chars = toCodePoints(line);
|
|
53
|
-
let i = col;
|
|
54
|
-
if (i >= chars.length)
|
|
55
|
-
return null;
|
|
56
|
-
const currentChar = chars[i];
|
|
57
|
-
// Skip current word/sequence based on character type
|
|
58
|
-
if (isWordCharStrict(currentChar)) {
|
|
59
|
-
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
60
|
-
// Check for script boundary - if next character is from different script, stop here
|
|
61
|
-
if (i + 1 < chars.length &&
|
|
62
|
-
isWordCharStrict(chars[i + 1]) &&
|
|
63
|
-
isDifferentScript(chars[i], chars[i + 1])) {
|
|
64
|
-
i++; // Include current character
|
|
65
|
-
break; // Stop at script boundary
|
|
66
|
-
}
|
|
67
|
-
i++;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (!isWhitespace(currentChar)) {
|
|
71
|
-
while (i < chars.length &&
|
|
72
|
-
!isWordCharStrict(chars[i]) &&
|
|
73
|
-
!isWhitespace(chars[i])) {
|
|
74
|
-
i++;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// Skip whitespace
|
|
78
|
-
while (i < chars.length && isWhitespace(chars[i])) {
|
|
79
|
-
i++;
|
|
80
|
-
}
|
|
81
|
-
return i < chars.length ? i : null;
|
|
82
|
-
};
|
|
83
|
-
// Find previous word start within a line
|
|
84
|
-
export const findPrevWordStartInLine = (line, col) => {
|
|
85
|
-
const chars = toCodePoints(line);
|
|
86
|
-
let i = col;
|
|
87
|
-
if (i <= 0)
|
|
88
|
-
return null;
|
|
89
|
-
i--;
|
|
90
|
-
// Skip whitespace moving backwards
|
|
91
|
-
while (i >= 0 && isWhitespace(chars[i])) {
|
|
92
|
-
i--;
|
|
93
|
-
}
|
|
94
|
-
if (i < 0)
|
|
95
|
-
return null;
|
|
96
|
-
if (isWordCharStrict(chars[i])) {
|
|
97
|
-
// We're in a word, move to its beginning
|
|
98
|
-
while (i >= 0 && isWordCharStrict(chars[i])) {
|
|
99
|
-
// Check for script boundary - if previous character is from different script, stop here
|
|
100
|
-
if (i - 1 >= 0 &&
|
|
101
|
-
isWordCharStrict(chars[i - 1]) &&
|
|
102
|
-
isDifferentScript(chars[i], chars[i - 1])) {
|
|
103
|
-
return i; // Return current position at script boundary
|
|
104
|
-
}
|
|
105
|
-
i--;
|
|
106
|
-
}
|
|
107
|
-
return i + 1;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
// We're in punctuation, move to its beginning
|
|
111
|
-
while (i >= 0 && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
|
|
112
|
-
i--;
|
|
113
|
-
}
|
|
114
|
-
return i + 1;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
// Find word end within a line
|
|
118
|
-
export const findWordEndInLine = (line, col) => {
|
|
119
|
-
const chars = toCodePoints(line);
|
|
120
|
-
let i = col;
|
|
121
|
-
// If we're already at the end of a word (including punctuation sequences), advance to next word
|
|
122
|
-
// This includes both regular word endings and script boundaries
|
|
123
|
-
const atEndOfWordChar = i < chars.length &&
|
|
124
|
-
isWordCharWithCombining(chars[i]) &&
|
|
125
|
-
(i + 1 >= chars.length ||
|
|
126
|
-
!isWordCharWithCombining(chars[i + 1]) ||
|
|
127
|
-
(isWordCharStrict(chars[i]) &&
|
|
128
|
-
i + 1 < chars.length &&
|
|
129
|
-
isWordCharStrict(chars[i + 1]) &&
|
|
130
|
-
isDifferentScript(chars[i], chars[i + 1])));
|
|
131
|
-
const atEndOfPunctuation = i < chars.length &&
|
|
132
|
-
!isWordCharWithCombining(chars[i]) &&
|
|
133
|
-
!isWhitespace(chars[i]) &&
|
|
134
|
-
(i + 1 >= chars.length ||
|
|
135
|
-
isWhitespace(chars[i + 1]) ||
|
|
136
|
-
isWordCharWithCombining(chars[i + 1]));
|
|
137
|
-
if (atEndOfWordChar || atEndOfPunctuation) {
|
|
138
|
-
// We're at the end of a word or punctuation sequence, move forward to find next word
|
|
139
|
-
i++;
|
|
140
|
-
// Skip whitespace to find next word or punctuation
|
|
141
|
-
while (i < chars.length && isWhitespace(chars[i])) {
|
|
142
|
-
i++;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// If we're not on a word character, find the next word or punctuation sequence
|
|
146
|
-
if (i < chars.length && !isWordCharWithCombining(chars[i])) {
|
|
147
|
-
// Skip whitespace to find next word or punctuation
|
|
148
|
-
while (i < chars.length && isWhitespace(chars[i])) {
|
|
149
|
-
i++;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Move to end of current word (including combining marks, but stop at script boundaries)
|
|
153
|
-
let foundWord = false;
|
|
154
|
-
let lastBaseCharPos = -1;
|
|
155
|
-
if (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
156
|
-
// Handle word characters
|
|
157
|
-
while (i < chars.length && isWordCharWithCombining(chars[i])) {
|
|
158
|
-
foundWord = true;
|
|
159
|
-
// Track the position of the last base character (not combining mark)
|
|
160
|
-
if (isWordCharStrict(chars[i])) {
|
|
161
|
-
lastBaseCharPos = i;
|
|
162
|
-
}
|
|
163
|
-
// Check if next character is from a different script (word boundary)
|
|
164
|
-
if (i + 1 < chars.length &&
|
|
165
|
-
isWordCharStrict(chars[i + 1]) &&
|
|
166
|
-
isDifferentScript(chars[i], chars[i + 1])) {
|
|
167
|
-
i++; // Include current character
|
|
168
|
-
if (isWordCharStrict(chars[i - 1])) {
|
|
169
|
-
lastBaseCharPos = i - 1;
|
|
170
|
-
}
|
|
171
|
-
break; // Stop at script boundary
|
|
172
|
-
}
|
|
173
|
-
i++;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
else if (i < chars.length && !isWhitespace(chars[i])) {
|
|
177
|
-
// Handle punctuation sequences (like ████)
|
|
178
|
-
while (i < chars.length &&
|
|
179
|
-
!isWordCharStrict(chars[i]) &&
|
|
180
|
-
!isWhitespace(chars[i])) {
|
|
181
|
-
foundWord = true;
|
|
182
|
-
lastBaseCharPos = i;
|
|
183
|
-
i++;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// Only return a position if we actually found a word
|
|
187
|
-
// Return the position of the last base character, not combining marks
|
|
188
|
-
if (foundWord && lastBaseCharPos >= col) {
|
|
189
|
-
return lastBaseCharPos;
|
|
190
|
-
}
|
|
191
|
-
return null;
|
|
192
|
-
};
|
|
193
|
-
// Find next word across lines
|
|
194
|
-
export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
|
|
195
|
-
// First try current line
|
|
196
|
-
const currentLine = lines[cursorRow] || '';
|
|
197
|
-
const colInCurrentLine = searchForWordStart
|
|
198
|
-
? findNextWordStartInLine(currentLine, cursorCol)
|
|
199
|
-
: findWordEndInLine(currentLine, cursorCol);
|
|
200
|
-
if (colInCurrentLine !== null) {
|
|
201
|
-
return { row: cursorRow, col: colInCurrentLine };
|
|
202
|
-
}
|
|
203
|
-
// Search subsequent lines
|
|
204
|
-
for (let row = cursorRow + 1; row < lines.length; row++) {
|
|
205
|
-
const line = lines[row] || '';
|
|
206
|
-
const chars = toCodePoints(line);
|
|
207
|
-
// For empty lines, if we haven't found any words yet, return the empty line
|
|
208
|
-
if (chars.length === 0) {
|
|
209
|
-
// Check if there are any words in remaining lines
|
|
210
|
-
let hasWordsInLaterLines = false;
|
|
211
|
-
for (let laterRow = row + 1; laterRow < lines.length; laterRow++) {
|
|
212
|
-
const laterLine = lines[laterRow] || '';
|
|
213
|
-
const laterChars = toCodePoints(laterLine);
|
|
214
|
-
let firstNonWhitespace = 0;
|
|
215
|
-
while (firstNonWhitespace < laterChars.length &&
|
|
216
|
-
isWhitespace(laterChars[firstNonWhitespace])) {
|
|
217
|
-
firstNonWhitespace++;
|
|
218
|
-
}
|
|
219
|
-
if (firstNonWhitespace < laterChars.length) {
|
|
220
|
-
hasWordsInLaterLines = true;
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
// If no words in later lines, return the empty line
|
|
225
|
-
if (!hasWordsInLaterLines) {
|
|
226
|
-
return { row, col: 0 };
|
|
227
|
-
}
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
// Find first non-whitespace
|
|
231
|
-
let firstNonWhitespace = 0;
|
|
232
|
-
while (firstNonWhitespace < chars.length &&
|
|
233
|
-
isWhitespace(chars[firstNonWhitespace])) {
|
|
234
|
-
firstNonWhitespace++;
|
|
235
|
-
}
|
|
236
|
-
if (firstNonWhitespace < chars.length) {
|
|
237
|
-
if (searchForWordStart) {
|
|
238
|
-
return { row, col: firstNonWhitespace };
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
// For word end, find the end of the first word
|
|
242
|
-
const endCol = findWordEndInLine(line, firstNonWhitespace);
|
|
243
|
-
if (endCol !== null) {
|
|
244
|
-
return { row, col: endCol };
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return null;
|
|
250
|
-
};
|
|
251
|
-
// Find previous word across lines
|
|
252
|
-
export const findPrevWordAcrossLines = (lines, cursorRow, cursorCol) => {
|
|
253
|
-
// First try current line
|
|
254
|
-
const currentLine = lines[cursorRow] || '';
|
|
255
|
-
const colInCurrentLine = findPrevWordStartInLine(currentLine, cursorCol);
|
|
256
|
-
if (colInCurrentLine !== null) {
|
|
257
|
-
return { row: cursorRow, col: colInCurrentLine };
|
|
258
|
-
}
|
|
259
|
-
// Search previous lines
|
|
260
|
-
for (let row = cursorRow - 1; row >= 0; row--) {
|
|
261
|
-
const line = lines[row] || '';
|
|
262
|
-
const chars = toCodePoints(line);
|
|
263
|
-
if (chars.length === 0)
|
|
264
|
-
continue;
|
|
265
|
-
// Find last word start
|
|
266
|
-
let lastWordStart = chars.length;
|
|
267
|
-
while (lastWordStart > 0 && isWhitespace(chars[lastWordStart - 1])) {
|
|
268
|
-
lastWordStart--;
|
|
269
|
-
}
|
|
270
|
-
if (lastWordStart > 0) {
|
|
271
|
-
// Find start of this word
|
|
272
|
-
const wordStart = findPrevWordStartInLine(line, lastWordStart);
|
|
273
|
-
if (wordStart !== null) {
|
|
274
|
-
return { row, col: wordStart };
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
return null;
|
|
279
|
-
};
|
|
280
|
-
// Helper functions for vim line operations
|
|
281
|
-
export const getPositionFromOffsets = (startOffset, endOffset, lines) => {
|
|
282
|
-
let offset = 0;
|
|
283
|
-
let startRow = 0;
|
|
284
|
-
let startCol = 0;
|
|
285
|
-
let endRow = 0;
|
|
286
|
-
let endCol = 0;
|
|
287
|
-
// Find start position
|
|
288
|
-
for (let i = 0; i < lines.length; i++) {
|
|
289
|
-
const lineLength = lines[i].length + 1; // +1 for newline
|
|
290
|
-
if (offset + lineLength > startOffset) {
|
|
291
|
-
startRow = i;
|
|
292
|
-
startCol = startOffset - offset;
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
offset += lineLength;
|
|
296
|
-
}
|
|
297
|
-
// Find end position
|
|
298
|
-
offset = 0;
|
|
299
|
-
for (let i = 0; i < lines.length; i++) {
|
|
300
|
-
const lineLength = lines[i].length + (i < lines.length - 1 ? 1 : 0); // +1 for newline except last line
|
|
301
|
-
if (offset + lineLength >= endOffset) {
|
|
302
|
-
endRow = i;
|
|
303
|
-
endCol = endOffset - offset;
|
|
304
|
-
break;
|
|
305
|
-
}
|
|
306
|
-
offset += lineLength;
|
|
307
|
-
}
|
|
308
|
-
return { startRow, startCol, endRow, endCol };
|
|
309
|
-
};
|
|
310
|
-
export const getLineRangeOffsets = (startRow, lineCount, lines) => {
|
|
311
|
-
let startOffset = 0;
|
|
312
|
-
// Calculate start offset
|
|
313
|
-
for (let i = 0; i < startRow; i++) {
|
|
314
|
-
startOffset += lines[i].length + 1; // +1 for newline
|
|
315
|
-
}
|
|
316
|
-
// Calculate end offset
|
|
317
|
-
let endOffset = startOffset;
|
|
318
|
-
for (let i = 0; i < lineCount; i++) {
|
|
319
|
-
const lineIndex = startRow + i;
|
|
320
|
-
if (lineIndex < lines.length) {
|
|
321
|
-
endOffset += lines[lineIndex].length;
|
|
322
|
-
if (lineIndex < lines.length - 1) {
|
|
323
|
-
endOffset += 1; // +1 for newline
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return { startOffset, endOffset };
|
|
328
|
-
};
|
|
329
|
-
export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol, text) => {
|
|
330
|
-
const currentLine = (row) => state.lines[row] || '';
|
|
331
|
-
const currentLineLen = (row) => cpLen(currentLine(row));
|
|
332
|
-
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
333
|
-
if (startRow > endRow ||
|
|
334
|
-
(startRow === endRow && startCol > endCol) ||
|
|
335
|
-
startRow < 0 ||
|
|
336
|
-
startCol < 0 ||
|
|
337
|
-
endRow >= state.lines.length ||
|
|
338
|
-
(endRow < state.lines.length && endCol > currentLineLen(endRow))) {
|
|
339
|
-
return state; // Invalid range
|
|
340
|
-
}
|
|
341
|
-
const newLines = [...state.lines];
|
|
342
|
-
const sCol = clamp(startCol, 0, currentLineLen(startRow));
|
|
343
|
-
const eCol = clamp(endCol, 0, currentLineLen(endRow));
|
|
344
|
-
const prefix = cpSlice(currentLine(startRow), 0, sCol);
|
|
345
|
-
const suffix = cpSlice(currentLine(endRow), eCol);
|
|
346
|
-
const normalisedReplacement = text
|
|
347
|
-
.replace(/\r\n/g, '\n')
|
|
348
|
-
.replace(/\r/g, '\n');
|
|
349
|
-
const replacementParts = normalisedReplacement.split('\n');
|
|
350
|
-
// The combined first line of the new text
|
|
351
|
-
const firstLine = prefix + replacementParts[0];
|
|
352
|
-
if (replacementParts.length === 1) {
|
|
353
|
-
// No newlines in replacement: combine prefix, replacement, and suffix on one line.
|
|
354
|
-
newLines.splice(startRow, endRow - startRow + 1, firstLine + suffix);
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
// Newlines in replacement: create new lines.
|
|
358
|
-
const lastLine = replacementParts[replacementParts.length - 1] + suffix;
|
|
359
|
-
const middleLines = replacementParts.slice(1, -1);
|
|
360
|
-
newLines.splice(startRow, endRow - startRow + 1, firstLine, ...middleLines, lastLine);
|
|
361
|
-
}
|
|
362
|
-
const finalCursorRow = startRow + replacementParts.length - 1;
|
|
363
|
-
const finalCursorCol = (replacementParts.length > 1 ? 0 : sCol) +
|
|
364
|
-
cpLen(replacementParts[replacementParts.length - 1]);
|
|
365
|
-
return {
|
|
366
|
-
...state,
|
|
367
|
-
lines: newLines,
|
|
368
|
-
cursorRow: Math.min(Math.max(finalCursorRow, 0), newLines.length - 1),
|
|
369
|
-
cursorCol: Math.max(0, Math.min(finalCursorCol, cpLen(newLines[finalCursorRow] || ''))),
|
|
370
|
-
preferredCol: null,
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
|
-
function clamp(v, min, max) {
|
|
374
|
-
return v < min ? min : v > max ? max : v;
|
|
375
|
-
}
|
|
376
|
-
function calculateInitialCursorPosition(initialLines, offset) {
|
|
377
|
-
let remainingChars = offset;
|
|
378
|
-
let row = 0;
|
|
379
|
-
while (row < initialLines.length) {
|
|
380
|
-
const lineLength = cpLen(initialLines[row]);
|
|
381
|
-
// Add 1 for the newline character (except for the last line)
|
|
382
|
-
const totalCharsInLineAndNewline = lineLength + (row < initialLines.length - 1 ? 1 : 0);
|
|
383
|
-
if (remainingChars <= lineLength) {
|
|
384
|
-
// Cursor is on this line
|
|
385
|
-
return [row, remainingChars];
|
|
386
|
-
}
|
|
387
|
-
remainingChars -= totalCharsInLineAndNewline;
|
|
388
|
-
row++;
|
|
389
|
-
}
|
|
390
|
-
// Offset is beyond the text, place cursor at the end of the last line
|
|
391
|
-
if (initialLines.length > 0) {
|
|
392
|
-
const lastRow = initialLines.length - 1;
|
|
393
|
-
return [lastRow, cpLen(initialLines[lastRow])];
|
|
394
|
-
}
|
|
395
|
-
return [0, 0]; // Default for empty text
|
|
396
|
-
}
|
|
397
|
-
export function offsetToLogicalPos(text, offset) {
|
|
398
|
-
let row = 0;
|
|
399
|
-
let col = 0;
|
|
400
|
-
let currentOffset = 0;
|
|
401
|
-
if (offset === 0)
|
|
402
|
-
return [0, 0];
|
|
403
|
-
const lines = text.split('\n');
|
|
404
|
-
for (let i = 0; i < lines.length; i++) {
|
|
405
|
-
const line = lines[i];
|
|
406
|
-
const lineLength = cpLen(line);
|
|
407
|
-
const lineLengthWithNewline = lineLength + (i < lines.length - 1 ? 1 : 0);
|
|
408
|
-
if (offset <= currentOffset + lineLength) {
|
|
409
|
-
// Check against lineLength first
|
|
410
|
-
row = i;
|
|
411
|
-
col = offset - currentOffset;
|
|
412
|
-
return [row, col];
|
|
413
|
-
}
|
|
414
|
-
else if (offset <= currentOffset + lineLengthWithNewline) {
|
|
415
|
-
// Check if offset is the newline itself
|
|
416
|
-
row = i;
|
|
417
|
-
col = lineLength; // Position cursor at the end of the current line content
|
|
418
|
-
// If the offset IS the newline, and it's not the last line, advance to next line, col 0
|
|
419
|
-
if (offset === currentOffset + lineLengthWithNewline &&
|
|
420
|
-
i < lines.length - 1) {
|
|
421
|
-
return [i + 1, 0];
|
|
422
|
-
}
|
|
423
|
-
return [row, col]; // Otherwise, it's at the end of the current line content
|
|
424
|
-
}
|
|
425
|
-
currentOffset += lineLengthWithNewline;
|
|
426
|
-
}
|
|
427
|
-
// If offset is beyond the text length, place cursor at the end of the last line
|
|
428
|
-
// or [0,0] if text is empty
|
|
429
|
-
if (lines.length > 0) {
|
|
430
|
-
row = lines.length - 1;
|
|
431
|
-
col = cpLen(lines[row]);
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
row = 0;
|
|
435
|
-
col = 0;
|
|
436
|
-
}
|
|
437
|
-
return [row, col];
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Converts logical row/col position to absolute text offset
|
|
441
|
-
* Inverse operation of offsetToLogicalPos
|
|
442
|
-
*/
|
|
443
|
-
export function logicalPosToOffset(lines, row, col) {
|
|
444
|
-
let offset = 0;
|
|
445
|
-
// Clamp row to valid range
|
|
446
|
-
const actualRow = Math.min(row, lines.length - 1);
|
|
447
|
-
// Add lengths of all lines before the target row
|
|
448
|
-
for (let i = 0; i < actualRow; i++) {
|
|
449
|
-
offset += cpLen(lines[i]) + 1; // +1 for newline
|
|
450
|
-
}
|
|
451
|
-
// Add column offset within the target row
|
|
452
|
-
if (actualRow >= 0 && actualRow < lines.length) {
|
|
453
|
-
offset += Math.min(col, cpLen(lines[actualRow]));
|
|
454
|
-
}
|
|
455
|
-
return offset;
|
|
456
|
-
}
|
|
457
|
-
// Calculates the visual wrapping of lines and the mapping between logical and visual coordinates.
|
|
458
|
-
// This is an expensive operation and should be memoized.
|
|
459
|
-
function calculateLayout(logicalLines, viewportWidth) {
|
|
460
|
-
const visualLines = [];
|
|
461
|
-
const logicalToVisualMap = [];
|
|
462
|
-
const visualToLogicalMap = [];
|
|
463
|
-
logicalLines.forEach((logLine, logIndex) => {
|
|
464
|
-
logicalToVisualMap[logIndex] = [];
|
|
465
|
-
if (logLine.length === 0) {
|
|
466
|
-
// Handle empty logical line
|
|
467
|
-
logicalToVisualMap[logIndex].push([visualLines.length, 0]);
|
|
468
|
-
visualToLogicalMap.push([logIndex, 0]);
|
|
469
|
-
visualLines.push('');
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
// Non-empty logical line
|
|
473
|
-
let currentPosInLogLine = 0; // Tracks position within the current logical line (code point index)
|
|
474
|
-
const codePointsInLogLine = toCodePoints(logLine);
|
|
475
|
-
while (currentPosInLogLine < codePointsInLogLine.length) {
|
|
476
|
-
let currentChunk = '';
|
|
477
|
-
let currentChunkVisualWidth = 0;
|
|
478
|
-
let numCodePointsInChunk = 0;
|
|
479
|
-
let lastWordBreakPoint = -1; // Index in codePointsInLogLine for word break
|
|
480
|
-
let numCodePointsAtLastWordBreak = 0;
|
|
481
|
-
// Iterate through code points to build the current visual line (chunk)
|
|
482
|
-
for (let i = currentPosInLogLine; i < codePointsInLogLine.length; i++) {
|
|
483
|
-
const char = codePointsInLogLine[i];
|
|
484
|
-
const charVisualWidth = getCachedStringWidth(char);
|
|
485
|
-
if (currentChunkVisualWidth + charVisualWidth > viewportWidth) {
|
|
486
|
-
// Character would exceed viewport width
|
|
487
|
-
if (lastWordBreakPoint !== -1 &&
|
|
488
|
-
numCodePointsAtLastWordBreak > 0 &&
|
|
489
|
-
currentPosInLogLine + numCodePointsAtLastWordBreak < i) {
|
|
490
|
-
// We have a valid word break point to use, and it's not the start of the current segment
|
|
491
|
-
currentChunk = codePointsInLogLine
|
|
492
|
-
.slice(currentPosInLogLine, currentPosInLogLine + numCodePointsAtLastWordBreak)
|
|
493
|
-
.join('');
|
|
494
|
-
numCodePointsInChunk = numCodePointsAtLastWordBreak;
|
|
495
|
-
}
|
|
496
|
-
else {
|
|
497
|
-
// No word break, or word break is at the start of this potential chunk, or word break leads to empty chunk.
|
|
498
|
-
// Hard break: take characters up to viewportWidth, or just the current char if it alone is too wide.
|
|
499
|
-
if (numCodePointsInChunk === 0 &&
|
|
500
|
-
charVisualWidth > viewportWidth) {
|
|
501
|
-
// Single character is wider than viewport, take it anyway
|
|
502
|
-
currentChunk = char;
|
|
503
|
-
numCodePointsInChunk = 1;
|
|
504
|
-
}
|
|
505
|
-
else if (numCodePointsInChunk === 0 &&
|
|
506
|
-
charVisualWidth <= viewportWidth) {
|
|
507
|
-
// This case should ideally be caught by the next iteration if the char fits.
|
|
508
|
-
// If it doesn't fit (because currentChunkVisualWidth was already > 0 from a previous char that filled the line),
|
|
509
|
-
// then numCodePointsInChunk would not be 0.
|
|
510
|
-
// This branch means the current char *itself* doesn't fit an empty line, which is handled by the above.
|
|
511
|
-
// If we are here, it means the loop should break and the current chunk (which is empty) is finalized.
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
break; // Break from inner loop to finalize this chunk
|
|
515
|
-
}
|
|
516
|
-
currentChunk += char;
|
|
517
|
-
currentChunkVisualWidth += charVisualWidth;
|
|
518
|
-
numCodePointsInChunk++;
|
|
519
|
-
// Check for word break opportunity (space)
|
|
520
|
-
if (char === ' ') {
|
|
521
|
-
lastWordBreakPoint = i; // Store code point index of the space
|
|
522
|
-
// Store the state *before* adding the space, if we decide to break here.
|
|
523
|
-
numCodePointsAtLastWordBreak = numCodePointsInChunk - 1; // Chars *before* the space
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
// If the inner loop completed without breaking (i.e., remaining text fits)
|
|
527
|
-
// or if the loop broke but numCodePointsInChunk is still 0 (e.g. first char too wide for empty line)
|
|
528
|
-
if (numCodePointsInChunk === 0 &&
|
|
529
|
-
currentPosInLogLine < codePointsInLogLine.length) {
|
|
530
|
-
// This can happen if the very first character considered for a new visual line is wider than the viewport.
|
|
531
|
-
// In this case, we take that single character.
|
|
532
|
-
const firstChar = codePointsInLogLine[currentPosInLogLine];
|
|
533
|
-
currentChunk = firstChar;
|
|
534
|
-
numCodePointsInChunk = 1; // Ensure we advance
|
|
535
|
-
}
|
|
536
|
-
// If after everything, numCodePointsInChunk is still 0 but we haven't processed the whole logical line,
|
|
537
|
-
// it implies an issue, like viewportWidth being 0 or less. Avoid infinite loop.
|
|
538
|
-
if (numCodePointsInChunk === 0 &&
|
|
539
|
-
currentPosInLogLine < codePointsInLogLine.length) {
|
|
540
|
-
// Force advance by one character to prevent infinite loop if something went wrong
|
|
541
|
-
currentChunk = codePointsInLogLine[currentPosInLogLine];
|
|
542
|
-
numCodePointsInChunk = 1;
|
|
543
|
-
}
|
|
544
|
-
logicalToVisualMap[logIndex].push([
|
|
545
|
-
visualLines.length,
|
|
546
|
-
currentPosInLogLine,
|
|
547
|
-
]);
|
|
548
|
-
visualToLogicalMap.push([logIndex, currentPosInLogLine]);
|
|
549
|
-
visualLines.push(currentChunk);
|
|
550
|
-
const logicalStartOfThisChunk = currentPosInLogLine;
|
|
551
|
-
currentPosInLogLine += numCodePointsInChunk;
|
|
552
|
-
// If the chunk processed did not consume the entire logical line,
|
|
553
|
-
// and the character immediately following the chunk is a space,
|
|
554
|
-
// advance past this space as it acted as a delimiter for word wrapping.
|
|
555
|
-
if (logicalStartOfThisChunk + numCodePointsInChunk <
|
|
556
|
-
codePointsInLogLine.length &&
|
|
557
|
-
currentPosInLogLine < codePointsInLogLine.length && // Redundant if previous is true, but safe
|
|
558
|
-
codePointsInLogLine[currentPosInLogLine] === ' ') {
|
|
559
|
-
currentPosInLogLine++;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
});
|
|
564
|
-
// If the entire logical text was empty, ensure there's one empty visual line.
|
|
565
|
-
if (logicalLines.length === 0 ||
|
|
566
|
-
(logicalLines.length === 1 && logicalLines[0] === '')) {
|
|
567
|
-
if (visualLines.length === 0) {
|
|
568
|
-
visualLines.push('');
|
|
569
|
-
if (!logicalToVisualMap[0])
|
|
570
|
-
logicalToVisualMap[0] = [];
|
|
571
|
-
logicalToVisualMap[0].push([0, 0]);
|
|
572
|
-
visualToLogicalMap.push([0, 0]);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
return {
|
|
576
|
-
visualLines,
|
|
577
|
-
logicalToVisualMap,
|
|
578
|
-
visualToLogicalMap,
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
// Calculates the visual cursor position based on a pre-calculated layout.
|
|
582
|
-
// This is a lightweight operation.
|
|
583
|
-
function calculateVisualCursorFromLayout(layout, logicalCursor) {
|
|
584
|
-
const { logicalToVisualMap, visualLines } = layout;
|
|
585
|
-
const [logicalRow, logicalCol] = logicalCursor;
|
|
586
|
-
const segmentsForLogicalLine = logicalToVisualMap[logicalRow];
|
|
587
|
-
if (!segmentsForLogicalLine || segmentsForLogicalLine.length === 0) {
|
|
588
|
-
// This can happen for an empty document.
|
|
589
|
-
return [0, 0];
|
|
590
|
-
}
|
|
591
|
-
// Find the segment where the logical column fits.
|
|
592
|
-
// The segments are sorted by startColInLogical.
|
|
593
|
-
let targetSegmentIndex = segmentsForLogicalLine.findIndex(([, startColInLogical], index) => {
|
|
594
|
-
const nextStartColInLogical = index + 1 < segmentsForLogicalLine.length
|
|
595
|
-
? segmentsForLogicalLine[index + 1][1]
|
|
596
|
-
: Infinity;
|
|
597
|
-
return (logicalCol >= startColInLogical && logicalCol < nextStartColInLogical);
|
|
598
|
-
});
|
|
599
|
-
// If not found, it means the cursor is at the end of the logical line.
|
|
600
|
-
if (targetSegmentIndex === -1) {
|
|
601
|
-
if (logicalCol === 0) {
|
|
602
|
-
targetSegmentIndex = 0;
|
|
603
|
-
}
|
|
604
|
-
else {
|
|
605
|
-
targetSegmentIndex = segmentsForLogicalLine.length - 1;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
const [visualRow, startColInLogical] = segmentsForLogicalLine[targetSegmentIndex];
|
|
609
|
-
const visualCol = logicalCol - startColInLogical;
|
|
610
|
-
// The visual column should not exceed the length of the visual line.
|
|
611
|
-
const clampedVisualCol = Math.min(visualCol, cpLen(visualLines[visualRow] ?? ''));
|
|
612
|
-
return [visualRow, clampedVisualCol];
|
|
613
|
-
}
|
|
614
|
-
const historyLimit = 100;
|
|
615
|
-
export const pushUndo = (currentState) => {
|
|
616
|
-
const snapshot = {
|
|
617
|
-
lines: [...currentState.lines],
|
|
618
|
-
cursorRow: currentState.cursorRow,
|
|
619
|
-
cursorCol: currentState.cursorCol,
|
|
620
|
-
};
|
|
621
|
-
const newStack = [...currentState.undoStack, snapshot];
|
|
622
|
-
if (newStack.length > historyLimit) {
|
|
623
|
-
newStack.shift();
|
|
624
|
-
}
|
|
625
|
-
return { ...currentState, undoStack: newStack, redoStack: [] };
|
|
626
|
-
};
|
|
627
|
-
function textBufferReducerLogic(state, action) {
|
|
628
|
-
const pushUndoLocal = pushUndo;
|
|
629
|
-
const currentLine = (r) => state.lines[r] ?? '';
|
|
630
|
-
const currentLineLen = (r) => cpLen(currentLine(r));
|
|
631
|
-
switch (action.type) {
|
|
632
|
-
case 'set_text': {
|
|
633
|
-
let nextState = state;
|
|
634
|
-
if (action.pushToUndo !== false) {
|
|
635
|
-
nextState = pushUndoLocal(state);
|
|
636
|
-
}
|
|
637
|
-
const newContentLines = action.payload
|
|
638
|
-
.replace(/\r\n?/g, '\n')
|
|
639
|
-
.split('\n');
|
|
640
|
-
const lines = newContentLines.length === 0 ? [''] : newContentLines;
|
|
641
|
-
const lastNewLineIndex = lines.length - 1;
|
|
642
|
-
return {
|
|
643
|
-
...nextState,
|
|
644
|
-
lines,
|
|
645
|
-
cursorRow: lastNewLineIndex,
|
|
646
|
-
cursorCol: cpLen(lines[lastNewLineIndex] ?? ''),
|
|
647
|
-
preferredCol: null,
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
case 'insert': {
|
|
651
|
-
const nextState = pushUndoLocal(state);
|
|
652
|
-
const newLines = [...nextState.lines];
|
|
653
|
-
let newCursorRow = nextState.cursorRow;
|
|
654
|
-
let newCursorCol = nextState.cursorCol;
|
|
655
|
-
const currentLine = (r) => newLines[r] ?? '';
|
|
656
|
-
const str = stripUnsafeCharacters(action.payload.replace(/\r\n/g, '\n').replace(/\r/g, '\n'));
|
|
657
|
-
const parts = str.split('\n');
|
|
658
|
-
const lineContent = currentLine(newCursorRow);
|
|
659
|
-
const before = cpSlice(lineContent, 0, newCursorCol);
|
|
660
|
-
const after = cpSlice(lineContent, newCursorCol);
|
|
661
|
-
if (parts.length > 1) {
|
|
662
|
-
newLines[newCursorRow] = before + parts[0];
|
|
663
|
-
const remainingParts = parts.slice(1);
|
|
664
|
-
const lastPartOriginal = remainingParts.pop() ?? '';
|
|
665
|
-
newLines.splice(newCursorRow + 1, 0, ...remainingParts);
|
|
666
|
-
newLines.splice(newCursorRow + parts.length - 1, 0, lastPartOriginal + after);
|
|
667
|
-
newCursorRow = newCursorRow + parts.length - 1;
|
|
668
|
-
newCursorCol = cpLen(lastPartOriginal);
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
newLines[newCursorRow] = before + parts[0] + after;
|
|
672
|
-
newCursorCol = cpLen(before) + cpLen(parts[0]);
|
|
673
|
-
}
|
|
674
|
-
return {
|
|
675
|
-
...nextState,
|
|
676
|
-
lines: newLines,
|
|
677
|
-
cursorRow: newCursorRow,
|
|
678
|
-
cursorCol: newCursorCol,
|
|
679
|
-
preferredCol: null,
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
case 'backspace': {
|
|
683
|
-
const nextState = pushUndoLocal(state);
|
|
684
|
-
const newLines = [...nextState.lines];
|
|
685
|
-
let newCursorRow = nextState.cursorRow;
|
|
686
|
-
let newCursorCol = nextState.cursorCol;
|
|
687
|
-
const currentLine = (r) => newLines[r] ?? '';
|
|
688
|
-
if (newCursorCol === 0 && newCursorRow === 0)
|
|
689
|
-
return state;
|
|
690
|
-
if (newCursorCol > 0) {
|
|
691
|
-
const lineContent = currentLine(newCursorRow);
|
|
692
|
-
newLines[newCursorRow] =
|
|
693
|
-
cpSlice(lineContent, 0, newCursorCol - 1) +
|
|
694
|
-
cpSlice(lineContent, newCursorCol);
|
|
695
|
-
newCursorCol--;
|
|
696
|
-
}
|
|
697
|
-
else if (newCursorRow > 0) {
|
|
698
|
-
const prevLineContent = currentLine(newCursorRow - 1);
|
|
699
|
-
const currentLineContentVal = currentLine(newCursorRow);
|
|
700
|
-
const newCol = cpLen(prevLineContent);
|
|
701
|
-
newLines[newCursorRow - 1] = prevLineContent + currentLineContentVal;
|
|
702
|
-
newLines.splice(newCursorRow, 1);
|
|
703
|
-
newCursorRow--;
|
|
704
|
-
newCursorCol = newCol;
|
|
705
|
-
}
|
|
706
|
-
return {
|
|
707
|
-
...nextState,
|
|
708
|
-
lines: newLines,
|
|
709
|
-
cursorRow: newCursorRow,
|
|
710
|
-
cursorCol: newCursorCol,
|
|
711
|
-
preferredCol: null,
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
case 'set_viewport': {
|
|
715
|
-
const { width, height } = action.payload;
|
|
716
|
-
if (width === state.viewportWidth && height === state.viewportHeight) {
|
|
717
|
-
return state;
|
|
718
|
-
}
|
|
719
|
-
return {
|
|
720
|
-
...state,
|
|
721
|
-
viewportWidth: width,
|
|
722
|
-
viewportHeight: height,
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
case 'move': {
|
|
726
|
-
const { dir } = action.payload;
|
|
727
|
-
const { cursorRow, cursorCol, lines, visualLayout, preferredCol } = state;
|
|
728
|
-
// Visual movements
|
|
729
|
-
if (dir === 'left' ||
|
|
730
|
-
dir === 'right' ||
|
|
731
|
-
dir === 'up' ||
|
|
732
|
-
dir === 'down' ||
|
|
733
|
-
dir === 'home' ||
|
|
734
|
-
dir === 'end') {
|
|
735
|
-
const visualCursor = calculateVisualCursorFromLayout(visualLayout, [
|
|
736
|
-
cursorRow,
|
|
737
|
-
cursorCol,
|
|
738
|
-
]);
|
|
739
|
-
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
740
|
-
let newVisualRow = visualCursor[0];
|
|
741
|
-
let newVisualCol = visualCursor[1];
|
|
742
|
-
let newPreferredCol = preferredCol;
|
|
743
|
-
const currentVisLineLen = cpLen(visualLines[newVisualRow] ?? '');
|
|
744
|
-
switch (dir) {
|
|
745
|
-
case 'left':
|
|
746
|
-
newPreferredCol = null;
|
|
747
|
-
if (newVisualCol > 0) {
|
|
748
|
-
newVisualCol--;
|
|
749
|
-
}
|
|
750
|
-
else if (newVisualRow > 0) {
|
|
751
|
-
newVisualRow--;
|
|
752
|
-
newVisualCol = cpLen(visualLines[newVisualRow] ?? '');
|
|
753
|
-
}
|
|
754
|
-
break;
|
|
755
|
-
case 'right':
|
|
756
|
-
newPreferredCol = null;
|
|
757
|
-
if (newVisualCol < currentVisLineLen) {
|
|
758
|
-
newVisualCol++;
|
|
759
|
-
}
|
|
760
|
-
else if (newVisualRow < visualLines.length - 1) {
|
|
761
|
-
newVisualRow++;
|
|
762
|
-
newVisualCol = 0;
|
|
763
|
-
}
|
|
764
|
-
break;
|
|
765
|
-
case 'up':
|
|
766
|
-
if (newVisualRow > 0) {
|
|
767
|
-
if (newPreferredCol === null)
|
|
768
|
-
newPreferredCol = newVisualCol;
|
|
769
|
-
newVisualRow--;
|
|
770
|
-
newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
|
|
771
|
-
}
|
|
772
|
-
break;
|
|
773
|
-
case 'down':
|
|
774
|
-
if (newVisualRow < visualLines.length - 1) {
|
|
775
|
-
if (newPreferredCol === null)
|
|
776
|
-
newPreferredCol = newVisualCol;
|
|
777
|
-
newVisualRow++;
|
|
778
|
-
newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
|
|
779
|
-
}
|
|
780
|
-
break;
|
|
781
|
-
case 'home':
|
|
782
|
-
newPreferredCol = null;
|
|
783
|
-
newVisualCol = 0;
|
|
784
|
-
break;
|
|
785
|
-
case 'end':
|
|
786
|
-
newPreferredCol = null;
|
|
787
|
-
newVisualCol = currentVisLineLen;
|
|
788
|
-
break;
|
|
789
|
-
default: {
|
|
790
|
-
const exhaustiveCheck = dir;
|
|
791
|
-
console.error(`Unknown visual movement direction: ${exhaustiveCheck}`);
|
|
792
|
-
return state;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
if (visualToLogicalMap[newVisualRow]) {
|
|
796
|
-
const [logRow, logStartCol] = visualToLogicalMap[newVisualRow];
|
|
797
|
-
return {
|
|
798
|
-
...state,
|
|
799
|
-
cursorRow: logRow,
|
|
800
|
-
cursorCol: clamp(logStartCol + newVisualCol, 0, cpLen(lines[logRow] ?? '')),
|
|
801
|
-
preferredCol: newPreferredCol,
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
return state;
|
|
805
|
-
}
|
|
806
|
-
// Logical movements
|
|
807
|
-
switch (dir) {
|
|
808
|
-
case 'wordLeft': {
|
|
809
|
-
if (cursorCol === 0 && cursorRow === 0)
|
|
810
|
-
return state;
|
|
811
|
-
let newCursorRow = cursorRow;
|
|
812
|
-
let newCursorCol = cursorCol;
|
|
813
|
-
if (cursorCol === 0) {
|
|
814
|
-
newCursorRow--;
|
|
815
|
-
newCursorCol = cpLen(lines[newCursorRow] ?? '');
|
|
816
|
-
}
|
|
817
|
-
else {
|
|
818
|
-
const lineContent = lines[cursorRow];
|
|
819
|
-
const arr = toCodePoints(lineContent);
|
|
820
|
-
let start = cursorCol;
|
|
821
|
-
let onlySpaces = true;
|
|
822
|
-
for (let i = 0; i < start; i++) {
|
|
823
|
-
if (isWordChar(arr[i])) {
|
|
824
|
-
onlySpaces = false;
|
|
825
|
-
break;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
if (onlySpaces && start > 0) {
|
|
829
|
-
start--;
|
|
830
|
-
}
|
|
831
|
-
else {
|
|
832
|
-
while (start > 0 && !isWordChar(arr[start - 1]))
|
|
833
|
-
start--;
|
|
834
|
-
while (start > 0 && isWordChar(arr[start - 1]))
|
|
835
|
-
start--;
|
|
836
|
-
}
|
|
837
|
-
newCursorCol = start;
|
|
838
|
-
}
|
|
839
|
-
return {
|
|
840
|
-
...state,
|
|
841
|
-
cursorRow: newCursorRow,
|
|
842
|
-
cursorCol: newCursorCol,
|
|
843
|
-
preferredCol: null,
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
case 'wordRight': {
|
|
847
|
-
if (cursorRow === lines.length - 1 &&
|
|
848
|
-
cursorCol === cpLen(lines[cursorRow] ?? '')) {
|
|
849
|
-
return state;
|
|
850
|
-
}
|
|
851
|
-
let newCursorRow = cursorRow;
|
|
852
|
-
let newCursorCol = cursorCol;
|
|
853
|
-
const lineContent = lines[cursorRow] ?? '';
|
|
854
|
-
const arr = toCodePoints(lineContent);
|
|
855
|
-
if (cursorCol >= arr.length) {
|
|
856
|
-
newCursorRow++;
|
|
857
|
-
newCursorCol = 0;
|
|
858
|
-
}
|
|
859
|
-
else {
|
|
860
|
-
let end = cursorCol;
|
|
861
|
-
while (end < arr.length && !isWordChar(arr[end]))
|
|
862
|
-
end++;
|
|
863
|
-
while (end < arr.length && isWordChar(arr[end]))
|
|
864
|
-
end++;
|
|
865
|
-
newCursorCol = end;
|
|
866
|
-
}
|
|
867
|
-
return {
|
|
868
|
-
...state,
|
|
869
|
-
cursorRow: newCursorRow,
|
|
870
|
-
cursorCol: newCursorCol,
|
|
871
|
-
preferredCol: null,
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
default:
|
|
875
|
-
return state;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
case 'set_cursor': {
|
|
879
|
-
return {
|
|
880
|
-
...state,
|
|
881
|
-
...action.payload,
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
|
-
case 'delete': {
|
|
885
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
886
|
-
const lineContent = currentLine(cursorRow);
|
|
887
|
-
if (cursorCol < currentLineLen(cursorRow)) {
|
|
888
|
-
const nextState = pushUndoLocal(state);
|
|
889
|
-
const newLines = [...nextState.lines];
|
|
890
|
-
newLines[cursorRow] =
|
|
891
|
-
cpSlice(lineContent, 0, cursorCol) +
|
|
892
|
-
cpSlice(lineContent, cursorCol + 1);
|
|
893
|
-
return {
|
|
894
|
-
...nextState,
|
|
895
|
-
lines: newLines,
|
|
896
|
-
preferredCol: null,
|
|
897
|
-
};
|
|
898
|
-
}
|
|
899
|
-
else if (cursorRow < lines.length - 1) {
|
|
900
|
-
const nextState = pushUndoLocal(state);
|
|
901
|
-
const nextLineContent = currentLine(cursorRow + 1);
|
|
902
|
-
const newLines = [...nextState.lines];
|
|
903
|
-
newLines[cursorRow] = lineContent + nextLineContent;
|
|
904
|
-
newLines.splice(cursorRow + 1, 1);
|
|
905
|
-
return {
|
|
906
|
-
...nextState,
|
|
907
|
-
lines: newLines,
|
|
908
|
-
preferredCol: null,
|
|
909
|
-
};
|
|
910
|
-
}
|
|
911
|
-
return state;
|
|
912
|
-
}
|
|
913
|
-
case 'delete_word_left': {
|
|
914
|
-
const { cursorRow, cursorCol } = state;
|
|
915
|
-
if (cursorCol === 0 && cursorRow === 0)
|
|
916
|
-
return state;
|
|
917
|
-
const nextState = pushUndoLocal(state);
|
|
918
|
-
const newLines = [...nextState.lines];
|
|
919
|
-
let newCursorRow = cursorRow;
|
|
920
|
-
let newCursorCol = cursorCol;
|
|
921
|
-
if (newCursorCol > 0) {
|
|
922
|
-
const lineContent = currentLine(newCursorRow);
|
|
923
|
-
const prevWordStart = findPrevWordStartInLine(lineContent, newCursorCol);
|
|
924
|
-
const start = prevWordStart === null ? 0 : prevWordStart;
|
|
925
|
-
newLines[newCursorRow] =
|
|
926
|
-
cpSlice(lineContent, 0, start) + cpSlice(lineContent, newCursorCol);
|
|
927
|
-
newCursorCol = start;
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
// Act as a backspace
|
|
931
|
-
const prevLineContent = currentLine(cursorRow - 1);
|
|
932
|
-
const currentLineContentVal = currentLine(cursorRow);
|
|
933
|
-
const newCol = cpLen(prevLineContent);
|
|
934
|
-
newLines[cursorRow - 1] = prevLineContent + currentLineContentVal;
|
|
935
|
-
newLines.splice(cursorRow, 1);
|
|
936
|
-
newCursorRow--;
|
|
937
|
-
newCursorCol = newCol;
|
|
938
|
-
}
|
|
939
|
-
return {
|
|
940
|
-
...nextState,
|
|
941
|
-
lines: newLines,
|
|
942
|
-
cursorRow: newCursorRow,
|
|
943
|
-
cursorCol: newCursorCol,
|
|
944
|
-
preferredCol: null,
|
|
945
|
-
};
|
|
946
|
-
}
|
|
947
|
-
case 'delete_word_right': {
|
|
948
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
949
|
-
const lineContent = currentLine(cursorRow);
|
|
950
|
-
const lineLen = cpLen(lineContent);
|
|
951
|
-
if (cursorCol >= lineLen && cursorRow === lines.length - 1) {
|
|
952
|
-
return state;
|
|
953
|
-
}
|
|
954
|
-
const nextState = pushUndoLocal(state);
|
|
955
|
-
const newLines = [...nextState.lines];
|
|
956
|
-
if (cursorCol >= lineLen) {
|
|
957
|
-
// Act as a delete, joining with the next line
|
|
958
|
-
const nextLineContent = currentLine(cursorRow + 1);
|
|
959
|
-
newLines[cursorRow] = lineContent + nextLineContent;
|
|
960
|
-
newLines.splice(cursorRow + 1, 1);
|
|
961
|
-
}
|
|
962
|
-
else {
|
|
963
|
-
const nextWordStart = findNextWordStartInLine(lineContent, cursorCol);
|
|
964
|
-
const end = nextWordStart === null ? lineLen : nextWordStart;
|
|
965
|
-
newLines[cursorRow] =
|
|
966
|
-
cpSlice(lineContent, 0, cursorCol) + cpSlice(lineContent, end);
|
|
967
|
-
}
|
|
968
|
-
return {
|
|
969
|
-
...nextState,
|
|
970
|
-
lines: newLines,
|
|
971
|
-
preferredCol: null,
|
|
972
|
-
};
|
|
973
|
-
}
|
|
974
|
-
case 'kill_line_right': {
|
|
975
|
-
const { cursorRow, cursorCol, lines } = state;
|
|
976
|
-
const lineContent = currentLine(cursorRow);
|
|
977
|
-
if (cursorCol < currentLineLen(cursorRow)) {
|
|
978
|
-
const nextState = pushUndoLocal(state);
|
|
979
|
-
const newLines = [...nextState.lines];
|
|
980
|
-
newLines[cursorRow] = cpSlice(lineContent, 0, cursorCol);
|
|
981
|
-
return {
|
|
982
|
-
...nextState,
|
|
983
|
-
lines: newLines,
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
else if (cursorRow < lines.length - 1) {
|
|
987
|
-
// Act as a delete
|
|
988
|
-
const nextState = pushUndoLocal(state);
|
|
989
|
-
const nextLineContent = currentLine(cursorRow + 1);
|
|
990
|
-
const newLines = [...nextState.lines];
|
|
991
|
-
newLines[cursorRow] = lineContent + nextLineContent;
|
|
992
|
-
newLines.splice(cursorRow + 1, 1);
|
|
993
|
-
return {
|
|
994
|
-
...nextState,
|
|
995
|
-
lines: newLines,
|
|
996
|
-
preferredCol: null,
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
return state;
|
|
1000
|
-
}
|
|
1001
|
-
case 'kill_line_left': {
|
|
1002
|
-
const { cursorRow, cursorCol } = state;
|
|
1003
|
-
if (cursorCol > 0) {
|
|
1004
|
-
const nextState = pushUndoLocal(state);
|
|
1005
|
-
const lineContent = currentLine(cursorRow);
|
|
1006
|
-
const newLines = [...nextState.lines];
|
|
1007
|
-
newLines[cursorRow] = cpSlice(lineContent, cursorCol);
|
|
1008
|
-
return {
|
|
1009
|
-
...nextState,
|
|
1010
|
-
lines: newLines,
|
|
1011
|
-
cursorCol: 0,
|
|
1012
|
-
preferredCol: null,
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
return state;
|
|
1016
|
-
}
|
|
1017
|
-
case 'undo': {
|
|
1018
|
-
const stateToRestore = state.undoStack[state.undoStack.length - 1];
|
|
1019
|
-
if (!stateToRestore)
|
|
1020
|
-
return state;
|
|
1021
|
-
const currentSnapshot = {
|
|
1022
|
-
lines: [...state.lines],
|
|
1023
|
-
cursorRow: state.cursorRow,
|
|
1024
|
-
cursorCol: state.cursorCol,
|
|
1025
|
-
};
|
|
1026
|
-
return {
|
|
1027
|
-
...state,
|
|
1028
|
-
...stateToRestore,
|
|
1029
|
-
undoStack: state.undoStack.slice(0, -1),
|
|
1030
|
-
redoStack: [...state.redoStack, currentSnapshot],
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
case 'redo': {
|
|
1034
|
-
const stateToRestore = state.redoStack[state.redoStack.length - 1];
|
|
1035
|
-
if (!stateToRestore)
|
|
1036
|
-
return state;
|
|
1037
|
-
const currentSnapshot = {
|
|
1038
|
-
lines: [...state.lines],
|
|
1039
|
-
cursorRow: state.cursorRow,
|
|
1040
|
-
cursorCol: state.cursorCol,
|
|
1041
|
-
};
|
|
1042
|
-
return {
|
|
1043
|
-
...state,
|
|
1044
|
-
...stateToRestore,
|
|
1045
|
-
redoStack: state.redoStack.slice(0, -1),
|
|
1046
|
-
undoStack: [...state.undoStack, currentSnapshot],
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
case 'replace_range': {
|
|
1050
|
-
const { startRow, startCol, endRow, endCol, text } = action.payload;
|
|
1051
|
-
const nextState = pushUndoLocal(state);
|
|
1052
|
-
return replaceRangeInternal(nextState, startRow, startCol, endRow, endCol, text);
|
|
1053
|
-
}
|
|
1054
|
-
case 'move_to_offset': {
|
|
1055
|
-
const { offset } = action.payload;
|
|
1056
|
-
const [newRow, newCol] = offsetToLogicalPos(state.lines.join('\n'), offset);
|
|
1057
|
-
return {
|
|
1058
|
-
...state,
|
|
1059
|
-
cursorRow: newRow,
|
|
1060
|
-
cursorCol: newCol,
|
|
1061
|
-
preferredCol: null,
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
|
-
case 'create_undo_snapshot': {
|
|
1065
|
-
return pushUndoLocal(state);
|
|
1066
|
-
}
|
|
1067
|
-
// Vim-specific operations
|
|
1068
|
-
case 'vim_delete_word_forward':
|
|
1069
|
-
case 'vim_delete_word_backward':
|
|
1070
|
-
case 'vim_delete_word_end':
|
|
1071
|
-
case 'vim_change_word_forward':
|
|
1072
|
-
case 'vim_change_word_backward':
|
|
1073
|
-
case 'vim_change_word_end':
|
|
1074
|
-
case 'vim_delete_line':
|
|
1075
|
-
case 'vim_change_line':
|
|
1076
|
-
case 'vim_delete_to_end_of_line':
|
|
1077
|
-
case 'vim_change_to_end_of_line':
|
|
1078
|
-
case 'vim_change_movement':
|
|
1079
|
-
case 'vim_move_left':
|
|
1080
|
-
case 'vim_move_right':
|
|
1081
|
-
case 'vim_move_up':
|
|
1082
|
-
case 'vim_move_down':
|
|
1083
|
-
case 'vim_move_word_forward':
|
|
1084
|
-
case 'vim_move_word_backward':
|
|
1085
|
-
case 'vim_move_word_end':
|
|
1086
|
-
case 'vim_delete_char':
|
|
1087
|
-
case 'vim_insert_at_cursor':
|
|
1088
|
-
case 'vim_append_at_cursor':
|
|
1089
|
-
case 'vim_open_line_below':
|
|
1090
|
-
case 'vim_open_line_above':
|
|
1091
|
-
case 'vim_append_at_line_end':
|
|
1092
|
-
case 'vim_insert_at_line_start':
|
|
1093
|
-
case 'vim_move_to_line_start':
|
|
1094
|
-
case 'vim_move_to_line_end':
|
|
1095
|
-
case 'vim_move_to_first_nonwhitespace':
|
|
1096
|
-
case 'vim_move_to_first_line':
|
|
1097
|
-
case 'vim_move_to_last_line':
|
|
1098
|
-
case 'vim_move_to_line':
|
|
1099
|
-
case 'vim_escape_insert_mode':
|
|
1100
|
-
return handleVimAction(state, action);
|
|
1101
|
-
default: {
|
|
1102
|
-
const exhaustiveCheck = action;
|
|
1103
|
-
console.error(`Unknown action encountered: ${exhaustiveCheck}`);
|
|
1104
|
-
return state;
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
export function textBufferReducer(state, action) {
|
|
1109
|
-
const newState = textBufferReducerLogic(state, action);
|
|
1110
|
-
if (newState.lines !== state.lines ||
|
|
1111
|
-
newState.viewportWidth !== state.viewportWidth) {
|
|
1112
|
-
return {
|
|
1113
|
-
...newState,
|
|
1114
|
-
visualLayout: calculateLayout(newState.lines, newState.viewportWidth),
|
|
1115
|
-
};
|
|
1116
|
-
}
|
|
1117
|
-
return newState;
|
|
1118
|
-
}
|
|
1119
|
-
// --- End of reducer logic ---
|
|
1120
|
-
export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, }) {
|
|
1121
|
-
const initialState = useMemo(() => {
|
|
1122
|
-
const lines = initialText.split('\n');
|
|
1123
|
-
const [initialCursorRow, initialCursorCol] = calculateInitialCursorPosition(lines.length === 0 ? [''] : lines, initialCursorOffset);
|
|
1124
|
-
const visualLayout = calculateLayout(lines.length === 0 ? [''] : lines, viewport.width);
|
|
1125
|
-
return {
|
|
1126
|
-
lines: lines.length === 0 ? [''] : lines,
|
|
1127
|
-
cursorRow: initialCursorRow,
|
|
1128
|
-
cursorCol: initialCursorCol,
|
|
1129
|
-
preferredCol: null,
|
|
1130
|
-
undoStack: [],
|
|
1131
|
-
redoStack: [],
|
|
1132
|
-
clipboard: null,
|
|
1133
|
-
selectionAnchor: null,
|
|
1134
|
-
viewportWidth: viewport.width,
|
|
1135
|
-
viewportHeight: viewport.height,
|
|
1136
|
-
visualLayout,
|
|
1137
|
-
};
|
|
1138
|
-
}, [initialText, initialCursorOffset, viewport.width, viewport.height]);
|
|
1139
|
-
const [state, dispatch] = useReducer(textBufferReducer, initialState);
|
|
1140
|
-
const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, } = state;
|
|
1141
|
-
const text = useMemo(() => lines.join('\n'), [lines]);
|
|
1142
|
-
const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
|
|
1143
|
-
const { visualLines, visualToLogicalMap } = visualLayout;
|
|
1144
|
-
const [visualScrollRow, setVisualScrollRow] = useState(0);
|
|
1145
|
-
useEffect(() => {
|
|
1146
|
-
if (onChange) {
|
|
1147
|
-
onChange(text);
|
|
1148
|
-
}
|
|
1149
|
-
}, [text, onChange]);
|
|
1150
|
-
useEffect(() => {
|
|
1151
|
-
dispatch({
|
|
1152
|
-
type: 'set_viewport',
|
|
1153
|
-
payload: { width: viewport.width, height: viewport.height },
|
|
1154
|
-
});
|
|
1155
|
-
}, [viewport.width, viewport.height]);
|
|
1156
|
-
// Update visual scroll (vertical)
|
|
1157
|
-
useEffect(() => {
|
|
1158
|
-
const { height } = viewport;
|
|
1159
|
-
const totalVisualLines = visualLines.length;
|
|
1160
|
-
const maxScrollStart = Math.max(0, totalVisualLines - height);
|
|
1161
|
-
let newVisualScrollRow = visualScrollRow;
|
|
1162
|
-
if (visualCursor[0] < visualScrollRow) {
|
|
1163
|
-
newVisualScrollRow = visualCursor[0];
|
|
1164
|
-
}
|
|
1165
|
-
else if (visualCursor[0] >= visualScrollRow + height) {
|
|
1166
|
-
newVisualScrollRow = visualCursor[0] - height + 1;
|
|
1167
|
-
}
|
|
1168
|
-
// When the number of visual lines shrinks (e.g., after widening the viewport),
|
|
1169
|
-
// ensure scroll never starts beyond the last valid start so we can render a full window.
|
|
1170
|
-
newVisualScrollRow = clamp(newVisualScrollRow, 0, maxScrollStart);
|
|
1171
|
-
if (newVisualScrollRow !== visualScrollRow) {
|
|
1172
|
-
setVisualScrollRow(newVisualScrollRow);
|
|
1173
|
-
}
|
|
1174
|
-
}, [visualCursor, visualScrollRow, viewport, visualLines.length]);
|
|
1175
|
-
const insert = useCallback((ch, { paste = false } = {}) => {
|
|
1176
|
-
if (/[\n\r]/.test(ch)) {
|
|
1177
|
-
dispatch({ type: 'insert', payload: ch });
|
|
1178
|
-
return;
|
|
1179
|
-
}
|
|
1180
|
-
const minLengthToInferAsDragDrop = 3;
|
|
1181
|
-
if (ch.length >= minLengthToInferAsDragDrop &&
|
|
1182
|
-
!shellModeActive &&
|
|
1183
|
-
paste) {
|
|
1184
|
-
let potentialPath = ch.trim();
|
|
1185
|
-
const quoteMatch = potentialPath.match(/^'(.*)'$/);
|
|
1186
|
-
if (quoteMatch) {
|
|
1187
|
-
potentialPath = quoteMatch[1];
|
|
1188
|
-
}
|
|
1189
|
-
potentialPath = potentialPath.trim();
|
|
1190
|
-
if (isValidPath(unescapePath(potentialPath))) {
|
|
1191
|
-
ch = `@${potentialPath} `;
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
let currentText = '';
|
|
1195
|
-
for (const char of toCodePoints(ch)) {
|
|
1196
|
-
if (char.codePointAt(0) === 127) {
|
|
1197
|
-
if (currentText.length > 0) {
|
|
1198
|
-
dispatch({ type: 'insert', payload: currentText });
|
|
1199
|
-
currentText = '';
|
|
1200
|
-
}
|
|
1201
|
-
dispatch({ type: 'backspace' });
|
|
1202
|
-
}
|
|
1203
|
-
else {
|
|
1204
|
-
currentText += char;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
if (currentText.length > 0) {
|
|
1208
|
-
dispatch({ type: 'insert', payload: currentText });
|
|
1209
|
-
}
|
|
1210
|
-
}, [isValidPath, shellModeActive]);
|
|
1211
|
-
const newline = useCallback(() => {
|
|
1212
|
-
dispatch({ type: 'insert', payload: '\n' });
|
|
1213
|
-
}, []);
|
|
1214
|
-
const backspace = useCallback(() => {
|
|
1215
|
-
dispatch({ type: 'backspace' });
|
|
1216
|
-
}, []);
|
|
1217
|
-
const del = useCallback(() => {
|
|
1218
|
-
dispatch({ type: 'delete' });
|
|
1219
|
-
}, []);
|
|
1220
|
-
const move = useCallback((dir) => {
|
|
1221
|
-
dispatch({ type: 'move', payload: { dir } });
|
|
1222
|
-
}, [dispatch]);
|
|
1223
|
-
const undo = useCallback(() => {
|
|
1224
|
-
dispatch({ type: 'undo' });
|
|
1225
|
-
}, []);
|
|
1226
|
-
const redo = useCallback(() => {
|
|
1227
|
-
dispatch({ type: 'redo' });
|
|
1228
|
-
}, []);
|
|
1229
|
-
const setText = useCallback((newText) => {
|
|
1230
|
-
dispatch({ type: 'set_text', payload: newText });
|
|
1231
|
-
}, []);
|
|
1232
|
-
const deleteWordLeft = useCallback(() => {
|
|
1233
|
-
dispatch({ type: 'delete_word_left' });
|
|
1234
|
-
}, []);
|
|
1235
|
-
const deleteWordRight = useCallback(() => {
|
|
1236
|
-
dispatch({ type: 'delete_word_right' });
|
|
1237
|
-
}, []);
|
|
1238
|
-
const killLineRight = useCallback(() => {
|
|
1239
|
-
dispatch({ type: 'kill_line_right' });
|
|
1240
|
-
}, []);
|
|
1241
|
-
const killLineLeft = useCallback(() => {
|
|
1242
|
-
dispatch({ type: 'kill_line_left' });
|
|
1243
|
-
}, []);
|
|
1244
|
-
// Vim-specific operations
|
|
1245
|
-
const vimDeleteWordForward = useCallback((count) => {
|
|
1246
|
-
dispatch({ type: 'vim_delete_word_forward', payload: { count } });
|
|
1247
|
-
}, []);
|
|
1248
|
-
const vimDeleteWordBackward = useCallback((count) => {
|
|
1249
|
-
dispatch({ type: 'vim_delete_word_backward', payload: { count } });
|
|
1250
|
-
}, []);
|
|
1251
|
-
const vimDeleteWordEnd = useCallback((count) => {
|
|
1252
|
-
dispatch({ type: 'vim_delete_word_end', payload: { count } });
|
|
1253
|
-
}, []);
|
|
1254
|
-
const vimChangeWordForward = useCallback((count) => {
|
|
1255
|
-
dispatch({ type: 'vim_change_word_forward', payload: { count } });
|
|
1256
|
-
}, []);
|
|
1257
|
-
const vimChangeWordBackward = useCallback((count) => {
|
|
1258
|
-
dispatch({ type: 'vim_change_word_backward', payload: { count } });
|
|
1259
|
-
}, []);
|
|
1260
|
-
const vimChangeWordEnd = useCallback((count) => {
|
|
1261
|
-
dispatch({ type: 'vim_change_word_end', payload: { count } });
|
|
1262
|
-
}, []);
|
|
1263
|
-
const vimDeleteLine = useCallback((count) => {
|
|
1264
|
-
dispatch({ type: 'vim_delete_line', payload: { count } });
|
|
1265
|
-
}, []);
|
|
1266
|
-
const vimChangeLine = useCallback((count) => {
|
|
1267
|
-
dispatch({ type: 'vim_change_line', payload: { count } });
|
|
1268
|
-
}, []);
|
|
1269
|
-
const vimDeleteToEndOfLine = useCallback(() => {
|
|
1270
|
-
dispatch({ type: 'vim_delete_to_end_of_line' });
|
|
1271
|
-
}, []);
|
|
1272
|
-
const vimChangeToEndOfLine = useCallback(() => {
|
|
1273
|
-
dispatch({ type: 'vim_change_to_end_of_line' });
|
|
1274
|
-
}, []);
|
|
1275
|
-
const vimChangeMovement = useCallback((movement, count) => {
|
|
1276
|
-
dispatch({ type: 'vim_change_movement', payload: { movement, count } });
|
|
1277
|
-
}, []);
|
|
1278
|
-
// New vim navigation and operation methods
|
|
1279
|
-
const vimMoveLeft = useCallback((count) => {
|
|
1280
|
-
dispatch({ type: 'vim_move_left', payload: { count } });
|
|
1281
|
-
}, []);
|
|
1282
|
-
const vimMoveRight = useCallback((count) => {
|
|
1283
|
-
dispatch({ type: 'vim_move_right', payload: { count } });
|
|
1284
|
-
}, []);
|
|
1285
|
-
const vimMoveUp = useCallback((count) => {
|
|
1286
|
-
dispatch({ type: 'vim_move_up', payload: { count } });
|
|
1287
|
-
}, []);
|
|
1288
|
-
const vimMoveDown = useCallback((count) => {
|
|
1289
|
-
dispatch({ type: 'vim_move_down', payload: { count } });
|
|
1290
|
-
}, []);
|
|
1291
|
-
const vimMoveWordForward = useCallback((count) => {
|
|
1292
|
-
dispatch({ type: 'vim_move_word_forward', payload: { count } });
|
|
1293
|
-
}, []);
|
|
1294
|
-
const vimMoveWordBackward = useCallback((count) => {
|
|
1295
|
-
dispatch({ type: 'vim_move_word_backward', payload: { count } });
|
|
1296
|
-
}, []);
|
|
1297
|
-
const vimMoveWordEnd = useCallback((count) => {
|
|
1298
|
-
dispatch({ type: 'vim_move_word_end', payload: { count } });
|
|
1299
|
-
}, []);
|
|
1300
|
-
const vimDeleteChar = useCallback((count) => {
|
|
1301
|
-
dispatch({ type: 'vim_delete_char', payload: { count } });
|
|
1302
|
-
}, []);
|
|
1303
|
-
const vimInsertAtCursor = useCallback(() => {
|
|
1304
|
-
dispatch({ type: 'vim_insert_at_cursor' });
|
|
1305
|
-
}, []);
|
|
1306
|
-
const vimAppendAtCursor = useCallback(() => {
|
|
1307
|
-
dispatch({ type: 'vim_append_at_cursor' });
|
|
1308
|
-
}, []);
|
|
1309
|
-
const vimOpenLineBelow = useCallback(() => {
|
|
1310
|
-
dispatch({ type: 'vim_open_line_below' });
|
|
1311
|
-
}, []);
|
|
1312
|
-
const vimOpenLineAbove = useCallback(() => {
|
|
1313
|
-
dispatch({ type: 'vim_open_line_above' });
|
|
1314
|
-
}, []);
|
|
1315
|
-
const vimAppendAtLineEnd = useCallback(() => {
|
|
1316
|
-
dispatch({ type: 'vim_append_at_line_end' });
|
|
1317
|
-
}, []);
|
|
1318
|
-
const vimInsertAtLineStart = useCallback(() => {
|
|
1319
|
-
dispatch({ type: 'vim_insert_at_line_start' });
|
|
1320
|
-
}, []);
|
|
1321
|
-
const vimMoveToLineStart = useCallback(() => {
|
|
1322
|
-
dispatch({ type: 'vim_move_to_line_start' });
|
|
1323
|
-
}, []);
|
|
1324
|
-
const vimMoveToLineEnd = useCallback(() => {
|
|
1325
|
-
dispatch({ type: 'vim_move_to_line_end' });
|
|
1326
|
-
}, []);
|
|
1327
|
-
const vimMoveToFirstNonWhitespace = useCallback(() => {
|
|
1328
|
-
dispatch({ type: 'vim_move_to_first_nonwhitespace' });
|
|
1329
|
-
}, []);
|
|
1330
|
-
const vimMoveToFirstLine = useCallback(() => {
|
|
1331
|
-
dispatch({ type: 'vim_move_to_first_line' });
|
|
1332
|
-
}, []);
|
|
1333
|
-
const vimMoveToLastLine = useCallback(() => {
|
|
1334
|
-
dispatch({ type: 'vim_move_to_last_line' });
|
|
1335
|
-
}, []);
|
|
1336
|
-
const vimMoveToLine = useCallback((lineNumber) => {
|
|
1337
|
-
dispatch({ type: 'vim_move_to_line', payload: { lineNumber } });
|
|
1338
|
-
}, []);
|
|
1339
|
-
const vimEscapeInsertMode = useCallback(() => {
|
|
1340
|
-
dispatch({ type: 'vim_escape_insert_mode' });
|
|
1341
|
-
}, []);
|
|
1342
|
-
const openInExternalEditor = useCallback(async (opts = {}) => {
|
|
1343
|
-
const editor = opts.editor ??
|
|
1344
|
-
process.env['VISUAL'] ??
|
|
1345
|
-
process.env['EDITOR'] ??
|
|
1346
|
-
(process.platform === 'win32' ? 'notepad' : 'vi');
|
|
1347
|
-
const tmpDir = fs.mkdtempSync(pathMod.join(os.tmpdir(), 'OSA-edit-'));
|
|
1348
|
-
const filePath = pathMod.join(tmpDir, 'buffer.txt');
|
|
1349
|
-
fs.writeFileSync(filePath, text, 'utf8');
|
|
1350
|
-
dispatch({ type: 'create_undo_snapshot' });
|
|
1351
|
-
const wasRaw = stdin?.isRaw ?? false;
|
|
1352
|
-
try {
|
|
1353
|
-
setRawMode?.(false);
|
|
1354
|
-
const { status, error } = spawnSync(editor, [filePath], {
|
|
1355
|
-
stdio: 'inherit',
|
|
1356
|
-
});
|
|
1357
|
-
if (error)
|
|
1358
|
-
throw error;
|
|
1359
|
-
if (typeof status === 'number' && status !== 0)
|
|
1360
|
-
throw new Error(`External editor exited with status ${status}`);
|
|
1361
|
-
let newText = fs.readFileSync(filePath, 'utf8');
|
|
1362
|
-
newText = newText.replace(/\r\n?/g, '\n');
|
|
1363
|
-
dispatch({ type: 'set_text', payload: newText, pushToUndo: false });
|
|
1364
|
-
}
|
|
1365
|
-
catch (err) {
|
|
1366
|
-
console.error('[useTextBuffer] external editor error', err);
|
|
1367
|
-
}
|
|
1368
|
-
finally {
|
|
1369
|
-
if (wasRaw)
|
|
1370
|
-
setRawMode?.(true);
|
|
1371
|
-
try {
|
|
1372
|
-
fs.unlinkSync(filePath);
|
|
1373
|
-
}
|
|
1374
|
-
catch {
|
|
1375
|
-
/* ignore */
|
|
1376
|
-
}
|
|
1377
|
-
try {
|
|
1378
|
-
fs.rmdirSync(tmpDir);
|
|
1379
|
-
}
|
|
1380
|
-
catch {
|
|
1381
|
-
/* ignore */
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
}, [text, stdin, setRawMode]);
|
|
1385
|
-
const handleInput = useCallback((key) => {
|
|
1386
|
-
const { sequence: input } = key;
|
|
1387
|
-
if (key.paste) {
|
|
1388
|
-
// Do not do any other processing on pastes so ensure we handle them
|
|
1389
|
-
// before all other cases.
|
|
1390
|
-
insert(input, { paste: key.paste });
|
|
1391
|
-
return;
|
|
1392
|
-
}
|
|
1393
|
-
if (key.name === 'return' ||
|
|
1394
|
-
input === '\r' ||
|
|
1395
|
-
input === '\n' ||
|
|
1396
|
-
input === '\\\r' // VSCode terminal represents shift + enter this way
|
|
1397
|
-
)
|
|
1398
|
-
newline();
|
|
1399
|
-
else if (key.name === 'left' && !key.meta && !key.ctrl)
|
|
1400
|
-
move('left');
|
|
1401
|
-
else if (key.ctrl && key.name === 'b')
|
|
1402
|
-
move('left');
|
|
1403
|
-
else if (key.name === 'right' && !key.meta && !key.ctrl)
|
|
1404
|
-
move('right');
|
|
1405
|
-
else if (key.ctrl && key.name === 'f')
|
|
1406
|
-
move('right');
|
|
1407
|
-
else if (key.name === 'up')
|
|
1408
|
-
move('up');
|
|
1409
|
-
else if (key.name === 'down')
|
|
1410
|
-
move('down');
|
|
1411
|
-
else if ((key.ctrl || key.meta) && key.name === 'left')
|
|
1412
|
-
move('wordLeft');
|
|
1413
|
-
else if (key.meta && key.name === 'b')
|
|
1414
|
-
move('wordLeft');
|
|
1415
|
-
else if ((key.ctrl || key.meta) && key.name === 'right')
|
|
1416
|
-
move('wordRight');
|
|
1417
|
-
else if (key.meta && key.name === 'f')
|
|
1418
|
-
move('wordRight');
|
|
1419
|
-
else if (key.name === 'home')
|
|
1420
|
-
move('home');
|
|
1421
|
-
else if (key.ctrl && key.name === 'a')
|
|
1422
|
-
move('home');
|
|
1423
|
-
else if (key.name === 'end')
|
|
1424
|
-
move('end');
|
|
1425
|
-
else if (key.ctrl && key.name === 'e')
|
|
1426
|
-
move('end');
|
|
1427
|
-
else if (key.ctrl && key.name === 'w')
|
|
1428
|
-
deleteWordLeft();
|
|
1429
|
-
else if ((key.meta || key.ctrl) &&
|
|
1430
|
-
(key.name === 'backspace' || input === '\x7f'))
|
|
1431
|
-
deleteWordLeft();
|
|
1432
|
-
else if ((key.meta || key.ctrl) && key.name === 'delete')
|
|
1433
|
-
deleteWordRight();
|
|
1434
|
-
else if (key.name === 'backspace' ||
|
|
1435
|
-
input === '\x7f' ||
|
|
1436
|
-
(key.ctrl && key.name === 'h'))
|
|
1437
|
-
backspace();
|
|
1438
|
-
else if (key.name === 'delete' || (key.ctrl && key.name === 'd'))
|
|
1439
|
-
del();
|
|
1440
|
-
else if (key.ctrl && !key.shift && key.name === 'z')
|
|
1441
|
-
undo();
|
|
1442
|
-
else if (key.ctrl && key.shift && key.name === 'z')
|
|
1443
|
-
redo();
|
|
1444
|
-
else if (input && !key.ctrl && !key.meta) {
|
|
1445
|
-
insert(input, { paste: key.paste });
|
|
1446
|
-
}
|
|
1447
|
-
}, [
|
|
1448
|
-
newline,
|
|
1449
|
-
move,
|
|
1450
|
-
deleteWordLeft,
|
|
1451
|
-
deleteWordRight,
|
|
1452
|
-
backspace,
|
|
1453
|
-
del,
|
|
1454
|
-
insert,
|
|
1455
|
-
undo,
|
|
1456
|
-
redo,
|
|
1457
|
-
]);
|
|
1458
|
-
const renderedVisualLines = useMemo(() => visualLines.slice(visualScrollRow, visualScrollRow + viewport.height), [visualLines, visualScrollRow, viewport.height]);
|
|
1459
|
-
const replaceRange = useCallback((startRow, startCol, endRow, endCol, text) => {
|
|
1460
|
-
dispatch({
|
|
1461
|
-
type: 'replace_range',
|
|
1462
|
-
payload: { startRow, startCol, endRow, endCol, text },
|
|
1463
|
-
});
|
|
1464
|
-
}, []);
|
|
1465
|
-
const replaceRangeByOffset = useCallback((startOffset, endOffset, replacementText) => {
|
|
1466
|
-
const [startRow, startCol] = offsetToLogicalPos(text, startOffset);
|
|
1467
|
-
const [endRow, endCol] = offsetToLogicalPos(text, endOffset);
|
|
1468
|
-
replaceRange(startRow, startCol, endRow, endCol, replacementText);
|
|
1469
|
-
}, [text, replaceRange]);
|
|
1470
|
-
const moveToOffset = useCallback((offset) => {
|
|
1471
|
-
dispatch({ type: 'move_to_offset', payload: { offset } });
|
|
1472
|
-
}, []);
|
|
1473
|
-
const returnValue = useMemo(() => ({
|
|
1474
|
-
lines,
|
|
1475
|
-
text,
|
|
1476
|
-
cursor: [cursorRow, cursorCol],
|
|
1477
|
-
preferredCol,
|
|
1478
|
-
selectionAnchor,
|
|
1479
|
-
allVisualLines: visualLines,
|
|
1480
|
-
viewportVisualLines: renderedVisualLines,
|
|
1481
|
-
visualCursor,
|
|
1482
|
-
visualScrollRow,
|
|
1483
|
-
visualToLogicalMap,
|
|
1484
|
-
setText,
|
|
1485
|
-
insert,
|
|
1486
|
-
newline,
|
|
1487
|
-
backspace,
|
|
1488
|
-
del,
|
|
1489
|
-
move,
|
|
1490
|
-
undo,
|
|
1491
|
-
redo,
|
|
1492
|
-
replaceRange,
|
|
1493
|
-
replaceRangeByOffset,
|
|
1494
|
-
moveToOffset,
|
|
1495
|
-
deleteWordLeft,
|
|
1496
|
-
deleteWordRight,
|
|
1497
|
-
killLineRight,
|
|
1498
|
-
killLineLeft,
|
|
1499
|
-
handleInput,
|
|
1500
|
-
openInExternalEditor,
|
|
1501
|
-
// Vim-specific operations
|
|
1502
|
-
vimDeleteWordForward,
|
|
1503
|
-
vimDeleteWordBackward,
|
|
1504
|
-
vimDeleteWordEnd,
|
|
1505
|
-
vimChangeWordForward,
|
|
1506
|
-
vimChangeWordBackward,
|
|
1507
|
-
vimChangeWordEnd,
|
|
1508
|
-
vimDeleteLine,
|
|
1509
|
-
vimChangeLine,
|
|
1510
|
-
vimDeleteToEndOfLine,
|
|
1511
|
-
vimChangeToEndOfLine,
|
|
1512
|
-
vimChangeMovement,
|
|
1513
|
-
vimMoveLeft,
|
|
1514
|
-
vimMoveRight,
|
|
1515
|
-
vimMoveUp,
|
|
1516
|
-
vimMoveDown,
|
|
1517
|
-
vimMoveWordForward,
|
|
1518
|
-
vimMoveWordBackward,
|
|
1519
|
-
vimMoveWordEnd,
|
|
1520
|
-
vimDeleteChar,
|
|
1521
|
-
vimInsertAtCursor,
|
|
1522
|
-
vimAppendAtCursor,
|
|
1523
|
-
vimOpenLineBelow,
|
|
1524
|
-
vimOpenLineAbove,
|
|
1525
|
-
vimAppendAtLineEnd,
|
|
1526
|
-
vimInsertAtLineStart,
|
|
1527
|
-
vimMoveToLineStart,
|
|
1528
|
-
vimMoveToLineEnd,
|
|
1529
|
-
vimMoveToFirstNonWhitespace,
|
|
1530
|
-
vimMoveToFirstLine,
|
|
1531
|
-
vimMoveToLastLine,
|
|
1532
|
-
vimMoveToLine,
|
|
1533
|
-
vimEscapeInsertMode,
|
|
1534
|
-
}), [
|
|
1535
|
-
lines,
|
|
1536
|
-
text,
|
|
1537
|
-
cursorRow,
|
|
1538
|
-
cursorCol,
|
|
1539
|
-
preferredCol,
|
|
1540
|
-
selectionAnchor,
|
|
1541
|
-
visualLines,
|
|
1542
|
-
renderedVisualLines,
|
|
1543
|
-
visualCursor,
|
|
1544
|
-
visualScrollRow,
|
|
1545
|
-
setText,
|
|
1546
|
-
insert,
|
|
1547
|
-
newline,
|
|
1548
|
-
backspace,
|
|
1549
|
-
del,
|
|
1550
|
-
move,
|
|
1551
|
-
undo,
|
|
1552
|
-
redo,
|
|
1553
|
-
replaceRange,
|
|
1554
|
-
replaceRangeByOffset,
|
|
1555
|
-
moveToOffset,
|
|
1556
|
-
deleteWordLeft,
|
|
1557
|
-
deleteWordRight,
|
|
1558
|
-
killLineRight,
|
|
1559
|
-
killLineLeft,
|
|
1560
|
-
handleInput,
|
|
1561
|
-
openInExternalEditor,
|
|
1562
|
-
vimDeleteWordForward,
|
|
1563
|
-
vimDeleteWordBackward,
|
|
1564
|
-
vimDeleteWordEnd,
|
|
1565
|
-
vimChangeWordForward,
|
|
1566
|
-
vimChangeWordBackward,
|
|
1567
|
-
vimChangeWordEnd,
|
|
1568
|
-
vimDeleteLine,
|
|
1569
|
-
vimChangeLine,
|
|
1570
|
-
vimDeleteToEndOfLine,
|
|
1571
|
-
vimChangeToEndOfLine,
|
|
1572
|
-
vimChangeMovement,
|
|
1573
|
-
vimMoveLeft,
|
|
1574
|
-
vimMoveRight,
|
|
1575
|
-
vimMoveUp,
|
|
1576
|
-
vimMoveDown,
|
|
1577
|
-
vimMoveWordForward,
|
|
1578
|
-
vimMoveWordBackward,
|
|
1579
|
-
vimMoveWordEnd,
|
|
1580
|
-
vimDeleteChar,
|
|
1581
|
-
vimInsertAtCursor,
|
|
1582
|
-
vimAppendAtCursor,
|
|
1583
|
-
vimOpenLineBelow,
|
|
1584
|
-
vimOpenLineAbove,
|
|
1585
|
-
vimAppendAtLineEnd,
|
|
1586
|
-
vimInsertAtLineStart,
|
|
1587
|
-
vimMoveToLineStart,
|
|
1588
|
-
vimMoveToLineEnd,
|
|
1589
|
-
vimMoveToFirstNonWhitespace,
|
|
1590
|
-
vimMoveToFirstLine,
|
|
1591
|
-
vimMoveToLastLine,
|
|
1592
|
-
vimMoveToLine,
|
|
1593
|
-
vimEscapeInsertMode,
|
|
1594
|
-
visualToLogicalMap,
|
|
1595
|
-
]);
|
|
1596
|
-
return returnValue;
|
|
1597
|
-
}
|
|
1598
|
-
//# sourceMappingURL=text-buffer.js.map
|