@machina.ai/cell-cli 1.36.0-rc1 → 1.38.1-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json +4 -4
- package/dist/src/acp/acpClient.js +297 -32
- package/dist/src/acp/acpClient.js.map +1 -1
- package/dist/src/acp/acpClient.test.js +419 -19
- package/dist/src/acp/acpClient.test.js.map +1 -1
- package/dist/src/acp/acpResume.test.js +8 -0
- package/dist/src/acp/acpResume.test.js.map +1 -1
- package/dist/src/acp/commandHandler.js +4 -0
- package/dist/src/acp/commandHandler.js.map +1 -1
- package/dist/src/acp/commandHandler.test.js +4 -0
- package/dist/src/acp/commandHandler.test.js.map +1 -1
- package/dist/src/acp/commands/about.d.ts +11 -0
- package/dist/src/acp/commands/about.js +53 -0
- package/dist/src/acp/commands/about.js.map +1 -0
- package/dist/src/acp/commands/extensions.js +1 -1
- package/dist/src/acp/commands/extensions.js.map +1 -1
- package/dist/src/acp/commands/help.d.ts +14 -0
- package/dist/src/acp/commands/help.js +35 -0
- package/dist/src/acp/commands/help.js.map +1 -0
- package/dist/src/acp/commands/help.test.d.ts +6 -0
- package/dist/src/acp/commands/help.test.js +40 -0
- package/dist/src/acp/commands/help.test.js.map +1 -0
- package/dist/src/acp/commands/restore.js +2 -2
- package/dist/src/acp/commands/restore.js.map +1 -1
- package/dist/src/commands/extensions/new.js +1 -1
- package/dist/src/commands/extensions/new.js.map +1 -1
- package/dist/src/commands/mcp/list.js +2 -2
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp.test.js +1 -1
- package/dist/src/commands/mcp.test.js.map +1 -1
- package/dist/src/commands/skills/list.js +5 -8
- package/dist/src/commands/skills/list.js.map +1 -1
- package/dist/src/commands/skills/list.test.js +17 -13
- package/dist/src/commands/skills/list.test.js.map +1 -1
- package/dist/src/config/config.js +22 -9
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +121 -36
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager-permissions.test.js +1 -1
- package/dist/src/config/extension-manager-permissions.test.js.map +1 -1
- package/dist/src/config/extension-manager-themes.spec.js +1 -0
- package/dist/src/config/extension-manager-themes.spec.js.map +1 -1
- package/dist/src/config/extension-manager.test.js +1 -1
- package/dist/src/config/extension-manager.test.js.map +1 -1
- package/dist/src/config/extension.js +1 -1
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/github.js +1 -1
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/footerItems.d.ts +4 -0
- package/dist/src/config/footerItems.js +12 -2
- package/dist/src/config/footerItems.js.map +1 -1
- package/dist/src/config/footerItems.test.js +129 -72
- package/dist/src/config/footerItems.test.js.map +1 -1
- package/dist/src/config/policy-engine.integration.test.js +1 -3
- package/dist/src/config/policy-engine.integration.test.js.map +1 -1
- package/dist/src/config/policy.d.ts +1 -1
- package/dist/src/config/policy.js +2 -2
- package/dist/src/config/policy.js.map +1 -1
- package/dist/src/config/settings.js +19 -3
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +272 -53
- package/dist/src/config/settingsSchema.js +262 -48
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +22 -4
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/workspace-policy-cli.test.js +7 -7
- package/dist/src/config/workspace-policy-cli.test.js.map +1 -1
- package/dist/src/gemini.js +24 -7
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +74 -4
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.js +69 -4
- package/dist/src/gemini_cleanup.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/integration-tests/modelSteering.test.js +1 -1
- package/dist/src/integration-tests/modelSteering.test.js.map +1 -1
- package/dist/src/interactiveCli.js +4 -2
- package/dist/src/interactiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +1 -1
- package/dist/src/nonInteractiveCli.js +11 -2
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +4 -2
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/nonInteractiveCliAgentSession.d.ts +16 -0
- package/dist/src/nonInteractiveCliAgentSession.js +484 -0
- package/dist/src/nonInteractiveCliAgentSession.js.map +1 -0
- package/dist/src/nonInteractiveCliAgentSession.test.js +1837 -0
- package/dist/src/nonInteractiveCliAgentSession.test.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +4 -2
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +1 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/mockConfig.js +16 -0
- package/dist/src/test-utils/mockConfig.js.map +1 -1
- package/dist/src/test-utils/mockSpinner.d.ts +6 -0
- package/dist/src/test-utils/mockSpinner.js +21 -0
- package/dist/src/test-utils/mockSpinner.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +8 -1
- package/dist/src/test-utils/render.js +37 -11
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/App.test.js +1 -1
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.js +225 -99
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +50 -38
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.js +15 -5
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +3 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +1 -1
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +22 -11
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/marketplaceCommand.d.ts +7 -0
- package/dist/src/ui/commands/marketplaceCommand.js +135 -0
- package/dist/src/ui/commands/marketplaceCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.js +26 -7
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.js +26 -0
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -1
- package/dist/src/ui/commands/planCommand.js +9 -0
- package/dist/src/ui/commands/planCommand.js.map +1 -1
- package/dist/src/ui/commands/planCommand.test.js +29 -0
- package/dist/src/ui/commands/planCommand.test.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.js +1 -1
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/rewindCommand.js +3 -1
- package/dist/src/ui/commands/rewindCommand.js.map +1 -1
- package/dist/src/ui/commands/rewindCommand.test.js +1 -1
- package/dist/src/ui/commands/rewindCommand.test.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.js +5 -5
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.js +11 -1
- package/dist/src/ui/commands/skillsCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.test.js +1 -0
- package/dist/src/ui/commands/skillsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/{shellsCommand.d.ts → tasksCommand.d.ts} +1 -1
- package/dist/src/ui/commands/{shellsCommand.js → tasksCommand.js} +6 -6
- package/dist/src/ui/commands/tasksCommand.js.map +1 -0
- package/dist/src/ui/commands/tasksCommand.test.js +30 -0
- package/dist/src/ui/commands/tasksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +9 -1
- package/dist/src/ui/components/AnsiOutput.js +7 -5
- package/dist/src/ui/components/AnsiOutput.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js +13 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
- package/dist/src/ui/components/AppHeader.js +11 -11
- package/dist/src/ui/components/AppHeader.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +6 -2
- package/dist/src/ui/components/AppHeader.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +6 -6
- package/dist/src/ui/components/AsciiArt.js +6 -6
- package/dist/src/ui/components/AskUserDialog.js +13 -13
- package/dist/src/ui/components/AskUserDialog.js.map +1 -1
- package/dist/src/ui/components/AskUserDialog.test.js +31 -0
- package/dist/src/ui/components/AskUserDialog.test.js.map +1 -1
- package/dist/src/ui/components/BackgroundTaskDisplay.d.ts +16 -0
- package/dist/src/ui/components/{BackgroundShellDisplay.js → BackgroundTaskDisplay.js} +12 -12
- package/dist/src/ui/components/BackgroundTaskDisplay.js.map +1 -0
- package/dist/src/ui/components/{BackgroundShellDisplay.test.js → BackgroundTaskDisplay.test.js} +26 -26
- package/dist/src/ui/components/BackgroundTaskDisplay.test.js.map +1 -0
- package/dist/src/ui/components/Composer.js +20 -208
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +22 -17
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +3 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/CopyModeWarning.js +3 -6
- package/dist/src/ui/components/CopyModeWarning.js.map +1 -1
- package/dist/src/ui/components/CopyModeWarning.test.js +7 -8
- package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -1
- package/dist/src/ui/components/ExitPlanModeDialog.js +9 -0
- package/dist/src/ui/components/ExitPlanModeDialog.js.map +1 -1
- package/dist/src/ui/components/ExitPlanModeDialog.test.js +15 -3
- package/dist/src/ui/components/ExitPlanModeDialog.test.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +7 -8
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.js +36 -9
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Footer.test.js +85 -6
- package/dist/src/ui/components/Footer.test.js.map +1 -1
- package/dist/src/ui/components/FooterConfigDialog.js +1 -0
- package/dist/src/ui/components/FooterConfigDialog.js.map +1 -1
- package/dist/src/ui/components/FooterConfigDialog.test.js +1 -1
- package/dist/src/ui/components/Help.test.js +1 -1
- package/dist/src/ui/components/Help.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +2 -0
- package/dist/src/ui/components/HistoryItemDisplay.js +14 -12
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +10 -5
- package/dist/src/ui/components/InputPrompt.js +195 -90
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.d.ts +12 -1
- package/dist/src/ui/components/InputPrompt.test.js +370 -160
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +1 -2
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +7 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/MainContent.d.ts +1 -1
- package/dist/src/ui/components/MainContent.js +105 -34
- package/dist/src/ui/components/MainContent.js.map +1 -1
- package/dist/src/ui/components/MainContent.test.js +12 -9
- package/dist/src/ui/components/MainContent.test.js.map +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +5 -2
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +50 -72
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +1 -0
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelQuotaDisplay.d.ts +18 -0
- package/dist/src/ui/components/ModelQuotaDisplay.js +104 -0
- package/dist/src/ui/components/ModelQuotaDisplay.js.map +1 -0
- package/dist/src/ui/components/ModelQuotaDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ModelQuotaDisplay.test.js +62 -0
- package/dist/src/ui/components/ModelQuotaDisplay.test.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/ProgressBar.d.ts +13 -0
- package/dist/src/ui/components/ProgressBar.js +17 -0
- package/dist/src/ui/components/ProgressBar.js.map +1 -0
- package/dist/src/ui/components/ProgressBar.test.d.ts +6 -0
- package/dist/src/ui/components/ProgressBar.test.js +28 -0
- package/dist/src/ui/components/ProgressBar.test.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.d.ts +2 -2
- package/dist/src/ui/components/StatsDisplay.js +47 -128
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +65 -136
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StatusDisplay.js +1 -1
- package/dist/src/ui/components/StatusDisplay.js.map +1 -1
- package/dist/src/ui/components/StatusDisplay.test.js +3 -3
- package/dist/src/ui/components/StatusDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StatusRow.d.ts +32 -0
- package/dist/src/ui/components/StatusRow.js +180 -0
- package/dist/src/ui/components/StatusRow.js.map +1 -0
- package/dist/src/ui/components/StatusRow.test.d.ts +6 -0
- package/dist/src/ui/components/StatusRow.test.js +99 -0
- package/dist/src/ui/components/StatusRow.test.js.map +1 -0
- package/dist/src/ui/components/ToastDisplay.d.ts +2 -1
- package/dist/src/ui/components/ToastDisplay.js +7 -5
- package/dist/src/ui/components/ToastDisplay.js.map +1 -1
- package/dist/src/ui/components/ToastDisplay.test.js +34 -20
- package/dist/src/ui/components/ToastDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.js +24 -9
- package/dist/src/ui/components/ToolConfirmationQueue.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.test.js +4 -6
- package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -1
- package/dist/src/ui/components/UserIdentity.js +8 -5
- package/dist/src/ui/components/UserIdentity.js.map +1 -1
- package/dist/src/ui/components/messages/DenseToolMessage.d.ts +13 -0
- package/dist/src/ui/components/messages/DenseToolMessage.js +270 -0
- package/dist/src/ui/components/messages/DenseToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/DenseToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DenseToolMessage.test.js +383 -0
- package/dist/src/ui/components/messages/DenseToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +18 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +54 -34
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js +12 -6
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +1 -0
- package/dist/src/ui/components/messages/InfoMessage.js +2 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +1 -1
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.test.js +44 -33
- package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentGroupDisplay.js +3 -2
- package/dist/src/ui/components/messages/SubagentGroupDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js +1 -1
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentHistoryMessage.d.ts +13 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.js +4 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js +68 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentProgressDisplay.d.ts +2 -1
- package/dist/src/ui/components/messages/SubagentProgressDisplay.js +2 -2
- package/dist/src/ui/components/messages/SubagentProgressDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js +0 -4
- package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +108 -70
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +40 -25
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.js +147 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js +219 -52
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +55 -3
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +8 -7
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js +1 -1
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.js +57 -15
- package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js +66 -3
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js +5 -4
- package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +3 -3
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +1 -1
- package/dist/src/ui/components/messages/TopicMessage.d.ts +15 -0
- package/dist/src/ui/components/messages/TopicMessage.js +56 -0
- package/dist/src/ui/components/messages/TopicMessage.js.map +1 -0
- package/dist/src/ui/components/messages/TopicMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/TopicMessage.test.js +77 -0
- package/dist/src/ui/components/messages/TopicMessage.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +10 -7
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/Scrollable.d.ts +3 -0
- package/dist/src/ui/components/shared/Scrollable.js +6 -2
- package/dist/src/ui/components/shared/Scrollable.js.map +1 -1
- package/dist/src/ui/components/shared/ScrollableList.d.ts +9 -12
- package/dist/src/ui/components/shared/ScrollableList.js +2 -2
- package/dist/src/ui/components/shared/ScrollableList.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.d.ts +13 -1
- package/dist/src/ui/components/shared/VirtualizedList.js +148 -37
- package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.test.js +1 -10
- package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +1 -0
- package/dist/src/ui/components/shared/text-buffer.js +19 -21
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionDetails.d.ts +4 -1
- package/dist/src/ui/components/views/ExtensionDetails.js +14 -4
- package/dist/src/ui/components/views/ExtensionDetails.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionDetails.test.js +25 -1
- package/dist/src/ui/components/views/ExtensionDetails.test.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionRegistryView.js +19 -5
- package/dist/src/ui/components/views/ExtensionRegistryView.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionRegistryView.test.js +38 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.js.map +1 -1
- package/dist/src/ui/components/views/SkillsList.js +2 -1
- package/dist/src/ui/components/views/SkillsList.js.map +1 -1
- package/dist/src/ui/components/views/SkillsList.test.js +3 -1
- package/dist/src/ui/components/views/SkillsList.test.js.map +1 -1
- package/dist/src/ui/constants/tips.js +2 -2
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/constants.d.ts +6 -0
- package/dist/src/ui/constants.js +15 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/InputContext.d.ts +17 -0
- package/dist/src/ui/contexts/InputContext.js +15 -0
- package/dist/src/ui/contexts/InputContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.js +1 -1
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +25 -1
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/ScrollProvider.js +25 -3
- package/dist/src/ui/contexts/ScrollProvider.js.map +1 -1
- package/dist/src/ui/contexts/ScrollProvider.test.js +100 -0
- package/dist/src/ui/contexts/ScrollProvider.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +2 -2
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/ToolActionsContext.d.ts +6 -0
- package/dist/src/ui/contexts/ToolActionsContext.js +19 -11
- package/dist/src/ui/contexts/ToolActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/ToolActionsContext.test.js +90 -7
- package/dist/src/ui/contexts/ToolActionsContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +4 -3
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +10 -16
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +2 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.js +2 -1
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.js.map +1 -1
- package/dist/src/ui/hooks/shellReducer.d.ts +12 -10
- package/dist/src/ui/hooks/shellReducer.js +67 -37
- package/dist/src/ui/hooks/shellReducer.js.map +1 -1
- package/dist/src/ui/hooks/shellReducer.test.js +207 -36
- package/dist/src/ui/hooks/shellReducer.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +1 -1
- package/dist/src/ui/hooks/toolMapping.js +7 -0
- package/dist/src/ui/hooks/toolMapping.js.map +1 -1
- package/dist/src/ui/hooks/useAlternateBuffer.js +6 -1
- package/dist/src/ui/hooks/useAlternateBuffer.js.map +1 -1
- package/dist/src/ui/hooks/useAlternateBuffer.test.js +5 -0
- package/dist/src/ui/hooks/useAlternateBuffer.test.js.map +1 -1
- package/dist/src/ui/hooks/useAnimatedScrollbar.js +2 -2
- package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useBackgroundTaskManager.d.ts +22 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.js +58 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.js.map +1 -0
- package/dist/src/ui/hooks/{useBackgroundShellManager.test.js → useBackgroundTaskManager.test.js} +50 -50
- package/dist/src/ui/hooks/useBackgroundTaskManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useBanner.d.ts +1 -0
- package/dist/src/ui/hooks/useBanner.js +16 -9
- package/dist/src/ui/hooks/useBanner.js.map +1 -1
- package/dist/src/ui/hooks/useBanner.test.js +7 -4
- package/dist/src/ui/hooks/useBanner.test.js.map +1 -1
- package/dist/src/ui/hooks/useBatchedScroll.js +2 -2
- package/dist/src/ui/hooks/useBatchedScroll.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +2 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +13 -3
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +82 -6
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useComposerStatus.d.ts +21 -0
- package/dist/src/ui/hooks/useComposerStatus.js +78 -0
- package/dist/src/ui/hooks/useComposerStatus.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.test.js +2 -2
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -1
- package/dist/src/ui/hooks/useExecutionLifecycle.d.ts +28 -0
- package/dist/src/ui/hooks/{shellCommandProcessor.js → useExecutionLifecycle.js} +140 -58
- package/dist/src/ui/hooks/useExecutionLifecycle.js.map +1 -0
- package/dist/src/ui/hooks/useExecutionLifecycle.test.d.ts +6 -0
- package/dist/src/ui/hooks/{shellCommandProcessor.test.js → useExecutionLifecycle.test.js} +123 -81
- package/dist/src/ui/hooks/useExecutionLifecycle.test.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.js +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +6 -6
- package/dist/src/ui/hooks/useGeminiStream.js +140 -38
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +176 -22
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +2 -2
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +10 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +2 -2
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +4 -2
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.d.ts +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.js +2 -2
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +37 -63
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +57 -47
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.d.ts +2 -1
- package/dist/src/ui/hooks/useToolScheduler.js +55 -1
- package/dist/src/ui/hooks/useToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +107 -9
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/key/keyBindings.d.ts +9 -1
- package/dist/src/ui/key/keyBindings.js +40 -3
- package/dist/src/ui/key/keyBindings.js.map +1 -1
- package/dist/src/ui/key/keyMatchers.test.js +12 -2
- package/dist/src/ui/key/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.js +8 -6
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.test.js +27 -22
- package/dist/src/ui/layouts/DefaultAppLayout.test.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +1 -1
- package/dist/src/ui/themes/builtin/dark/tokyonight-dark.d.ts +7 -0
- package/dist/src/ui/themes/builtin/dark/tokyonight-dark.js +147 -0
- package/dist/src/ui/themes/builtin/dark/tokyonight-dark.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.js +2 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.js +1 -1
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +10 -2
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +1 -0
- package/dist/src/ui/utils/CodeColorizer.js +17 -18
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +1 -0
- package/dist/src/ui/utils/ConsolePatcher.js +12 -5
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.test.d.ts +6 -0
- package/dist/src/ui/utils/ConsolePatcher.test.js +199 -0
- package/dist/src/ui/utils/ConsolePatcher.test.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.js +3 -3
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/borderStyles.d.ts +2 -2
- package/dist/src/ui/utils/borderStyles.js +2 -2
- package/dist/src/ui/utils/borderStyles.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.js +1 -1
- package/dist/src/ui/utils/directoryUtils.js.map +1 -1
- package/dist/src/ui/utils/fileUtils.d.ts +10 -0
- package/dist/src/ui/utils/fileUtils.js +17 -0
- package/dist/src/ui/utils/fileUtils.js.map +1 -0
- package/dist/src/ui/utils/terminalCapabilityManager.d.ts +1 -0
- package/dist/src/ui/utils/terminalCapabilityManager.js +8 -0
- package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -1
- package/dist/src/ui/utils/terminalCapabilityManager.test.js +38 -0
- package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -1
- package/dist/src/ui/utils/toolLayoutUtils.d.ts +1 -1
- package/dist/src/ui/utils/toolLayoutUtils.js +1 -1
- package/dist/src/ui/utils/ui-sizing.test.js +1 -0
- package/dist/src/ui/utils/ui-sizing.test.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.d.ts +1 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/activityLogger.js +16 -0
- package/dist/src/utils/activityLogger.js.map +1 -1
- package/dist/src/utils/cleanup.js +12 -5
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/commands.js +15 -0
- package/dist/src/utils/commands.js.map +1 -1
- package/dist/src/utils/commands.test.js +79 -0
- package/dist/src/utils/commands.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.d.ts +5 -2
- package/dist/src/utils/envVarResolver.js +15 -6
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/envVarResolver.test.js +41 -24
- package/dist/src/utils/envVarResolver.test.js.map +1 -1
- package/dist/src/utils/errors.js +4 -4
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/events.d.ts +3 -1
- package/dist/src/utils/events.js +1 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/gitUtils.js +4 -4
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.js +10 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +8 -2
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
- package/dist/src/utils/installationInfo.js +1 -1
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/jsonoutput.js +1 -1
- package/dist/src/utils/jsonoutput.js.map +1 -1
- package/dist/src/utils/sandboxUtils.js +1 -1
- package/dist/src/utils/sandboxUtils.js.map +1 -1
- package/dist/src/utils/sessionCleanup.js +7 -30
- package/dist/src/utils/sessionCleanup.js.map +1 -1
- package/dist/src/utils/sessionCleanup.test.js +3 -0
- package/dist/src/utils/sessionCleanup.test.js.map +1 -1
- package/dist/src/utils/sessionUtils.js +1 -0
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +179 -3
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/sessions.js +1 -1
- package/dist/src/utils/sessions.js.map +1 -1
- package/dist/src/utils/skillUtils.js +3 -1
- package/dist/src/utils/skillUtils.js.map +1 -1
- package/dist/src/utils/skillUtils.test.js +4 -6
- package/dist/src/utils/skillUtils.test.js.map +1 -1
- package/dist/src/utils/terminalNotifications.js +2 -4
- package/dist/src/utils/terminalNotifications.js.map +1 -1
- package/dist/src/utils/terminalNotifications.test.js +5 -3
- package/dist/src/utils/terminalNotifications.test.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +2 -2
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/src/ui/commands/shellsCommand.js.map +0 -1
- package/dist/src/ui/commands/shellsCommand.test.js +0 -29
- package/dist/src/ui/commands/shellsCommand.test.js.map +0 -1
- package/dist/src/ui/components/BackgroundShellDisplay.d.ts +0 -16
- package/dist/src/ui/components/BackgroundShellDisplay.js.map +0 -1
- package/dist/src/ui/components/BackgroundShellDisplay.test.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -28
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/useBackgroundShellManager.d.ts +0 -22
- package/dist/src/ui/hooks/useBackgroundShellManager.js +0 -58
- package/dist/src/ui/hooks/useBackgroundShellManager.js.map +0 -1
- package/dist/src/ui/hooks/useBackgroundShellManager.test.js.map +0 -1
- /package/dist/src/{ui/commands/shellsCommand.test.d.ts → nonInteractiveCliAgentSession.test.d.ts} +0 -0
- /package/dist/src/ui/{components/BackgroundShellDisplay.test.d.ts → commands/tasksCommand.test.d.ts} +0 -0
- /package/dist/src/ui/{hooks/shellCommandProcessor.test.d.ts → components/BackgroundTaskDisplay.test.d.ts} +0 -0
- /package/dist/src/ui/hooks/{useBackgroundShellManager.test.d.ts → useBackgroundTaskManager.test.d.ts} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback, useEffect, useState, useRef, useMemo } from 'react';
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState, useRef, useMemo, Fragment, } from 'react';
|
|
3
3
|
import clipboardy from 'clipboardy';
|
|
4
4
|
import { Box, Text, useStdout } from 'ink';
|
|
5
5
|
import { SuggestionsDisplay, MAX_WIDTH } from './SuggestionsDisplay.js';
|
|
6
6
|
import { theme } from '../semantic-colors.js';
|
|
7
7
|
import { useInputHistory } from '../hooks/useInputHistory.js';
|
|
8
8
|
import { escapeAtSymbols } from '../hooks/atCommandProcessor.js';
|
|
9
|
+
import { ScrollableList, } from './shared/ScrollableList.js';
|
|
9
10
|
import { HalfLinePaddedBox } from './shared/HalfLinePaddedBox.js';
|
|
10
11
|
import { logicalPosToOffset, expandPastePlaceholders, getTransformUnderCursor, LARGE_PASTE_LINE_THRESHOLD, LARGE_PASTE_CHAR_THRESHOLD, } from './shared/text-buffer.js';
|
|
11
12
|
import { cpSlice, cpLen, toCodePoints, cpIndexToOffset, } from '../utils/textUtils.js';
|
|
@@ -29,6 +30,7 @@ import { getSafeLowColorBackground } from '../themes/color-utils.js';
|
|
|
29
30
|
import { isLowColorDepth } from '../utils/terminalUtils.js';
|
|
30
31
|
import { useShellFocusState } from '../contexts/ShellFocusContext.js';
|
|
31
32
|
import { useUIState } from '../contexts/UIStateContext.js';
|
|
33
|
+
import { useInputState } from '../contexts/InputContext.js';
|
|
32
34
|
import { appEvents, AppEvent, TransientMessageType, } from '../../utils/events.js';
|
|
33
35
|
import { useSettings } from '../contexts/SettingsContext.js';
|
|
34
36
|
import { StreamingState } from '../types.js';
|
|
@@ -100,7 +102,9 @@ export function tryTogglePasteExpansion(buffer) {
|
|
|
100
102
|
});
|
|
101
103
|
return true;
|
|
102
104
|
}
|
|
103
|
-
export const InputPrompt = ({
|
|
105
|
+
export const InputPrompt = ({ onSubmit, onClearScreen, config, slashCommands, commandContext, placeholder = ' Type your message or @path/to/file', focus = true, setShellModeActive, approvalMode, onEscapePromptChange, onSuggestionsVisibilityChange, vimHandleInput, isEmbeddedShellFocused, setQueueErrorMessage, streamingState, popAllMessages, onQueueMessage, suggestionsPosition = 'below', setBannerVisible, }) => {
|
|
106
|
+
const inputState = useInputState();
|
|
107
|
+
const { buffer, userMessages, shellModeActive, copyModeEnabled, inputWidth, suggestionsWidth, } = inputState;
|
|
104
108
|
const isHelpDismissKey = useIsHelpDismissKey();
|
|
105
109
|
const keyMatchers = useKeyMatchers();
|
|
106
110
|
const { stdout } = useStdout();
|
|
@@ -108,7 +112,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
108
112
|
const kittyProtocol = useKittyKeyboardProtocol();
|
|
109
113
|
const isShellFocused = useShellFocusState();
|
|
110
114
|
const { setEmbeddedShellFocused, setShortcutsHelpVisible, toggleCleanUiDetailsVisible, } = useUIActions();
|
|
111
|
-
const { terminalWidth, activePtyId, history,
|
|
115
|
+
const { terminalWidth, activePtyId, history, backgroundTasks, backgroundTaskHeight, shortcutsHelpVisible, } = useUIState();
|
|
112
116
|
const [suppressCompletion, setSuppressCompletion] = useState(false);
|
|
113
117
|
const { handlePress: registerPlainTabPress, resetCount: resetPlainTabPress } = useRepeatedKeyPress({
|
|
114
118
|
windowMs: DOUBLE_TAB_CLEAN_UI_TOGGLE_WINDOW_MS,
|
|
@@ -140,6 +144,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
140
144
|
const pasteTimeoutRef = useRef(null);
|
|
141
145
|
const innerBoxRef = useRef(null);
|
|
142
146
|
const hasUserNavigatedSuggestions = useRef(false);
|
|
147
|
+
const listRef = useRef(null);
|
|
143
148
|
const [reverseSearchActive, setReverseSearchActive] = useState(false);
|
|
144
149
|
const [commandSearchActive, setCommandSearchActive] = useState(false);
|
|
145
150
|
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = useState('');
|
|
@@ -181,7 +186,10 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
181
186
|
const activeCompletion = getActiveCompletion();
|
|
182
187
|
const shouldShowSuggestions = activeCompletion.showSuggestions;
|
|
183
188
|
const { forceShowShellSuggestions, setForceShowShellSuggestions, isShellSuggestionsVisible, } = completion;
|
|
184
|
-
const showCursor = focus && isShellFocused && !isEmbeddedShellFocused;
|
|
189
|
+
const showCursor = focus && isShellFocused && !isEmbeddedShellFocused && !copyModeEnabled;
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
appEvents.emit(AppEvent.ScrollToBottom);
|
|
192
|
+
}, [buffer.text, buffer.cursor]);
|
|
185
193
|
// Notify parent component about escape prompt state changes
|
|
186
194
|
useEffect(() => {
|
|
187
195
|
if (onEscapePromptChange) {
|
|
@@ -239,7 +247,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
239
247
|
if (isSlash) {
|
|
240
248
|
const { commandToExecute } = parseSlashCommand(trimmedMessage, slashCommands);
|
|
241
249
|
if (commandToExecute?.isSafeConcurrent) {
|
|
242
|
-
|
|
250
|
+
handleSubmitAndClear(trimmedMessage);
|
|
243
251
|
return;
|
|
244
252
|
}
|
|
245
253
|
}
|
|
@@ -253,6 +261,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
253
261
|
streamingState,
|
|
254
262
|
setQueueErrorMessage,
|
|
255
263
|
slashCommands,
|
|
264
|
+
handleSubmitAndClear,
|
|
256
265
|
]);
|
|
257
266
|
// Effect to reset completion if history navigation just occurred and set the text
|
|
258
267
|
useEffect(() => {
|
|
@@ -354,7 +363,8 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
354
363
|
if (isEmbeddedShellFocused) {
|
|
355
364
|
setEmbeddedShellFocused(false);
|
|
356
365
|
}
|
|
357
|
-
const
|
|
366
|
+
const currentScrollTop = Math.round(listRef.current?.getScrollState().scrollTop ?? buffer.visualScrollRow);
|
|
367
|
+
const visualRow = currentScrollTop + relY;
|
|
358
368
|
buffer.moveToVisualPosition(visualRow, relX);
|
|
359
369
|
}, { isActive: focus });
|
|
360
370
|
const isAlternateBuffer = useAlternateBuffer();
|
|
@@ -362,14 +372,15 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
362
372
|
useMouseClick(innerBoxRef, (_event, relX, relY) => {
|
|
363
373
|
if (!isAlternateBuffer)
|
|
364
374
|
return;
|
|
365
|
-
const
|
|
375
|
+
const currentScrollTop = Math.round(listRef.current?.getScrollState().scrollTop ?? buffer.visualScrollRow);
|
|
376
|
+
const visualLine = buffer.allVisualLines[currentScrollTop + relY];
|
|
366
377
|
if (!visualLine)
|
|
367
378
|
return;
|
|
368
379
|
// Even if we click past the end of the line, we might want to collapse an expanded paste
|
|
369
380
|
const isPastEndOfLine = relX >= stringWidth(visualLine);
|
|
370
381
|
const logicalPos = isPastEndOfLine
|
|
371
382
|
? null
|
|
372
|
-
: buffer.getLogicalPositionFromVisual(
|
|
383
|
+
: buffer.getLogicalPositionFromVisual(currentScrollTop + relY, relX);
|
|
373
384
|
// Check for paste placeholder (collapsed state)
|
|
374
385
|
if (logicalPos) {
|
|
375
386
|
const transform = getTransformUnderCursor(logicalPos.row, logicalPos.col, buffer.transformationsByLine, { includeEdge: true });
|
|
@@ -380,7 +391,9 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
380
391
|
}
|
|
381
392
|
// If we didn't click a placeholder to expand, check if we are inside or after
|
|
382
393
|
// an expanded paste region and collapse it.
|
|
383
|
-
const
|
|
394
|
+
const visualRow = currentScrollTop + relY;
|
|
395
|
+
const mapEntry = buffer.visualToLogicalMap[visualRow];
|
|
396
|
+
const row = mapEntry ? mapEntry[0] : visualRow;
|
|
384
397
|
const expandedId = buffer.getExpandedPasteAtLine(row);
|
|
385
398
|
if (expandedId) {
|
|
386
399
|
buffer.togglePasteExpansion(expandedId, row, logicalPos?.col ?? relX);
|
|
@@ -444,16 +457,32 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
444
457
|
setShortcutsHelpVisible(false);
|
|
445
458
|
return true;
|
|
446
459
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return false;
|
|
451
|
-
}
|
|
460
|
+
const isGenerating = streamingState === StreamingState.Responding ||
|
|
461
|
+
streamingState === StreamingState.WaitingForConfirmation;
|
|
462
|
+
const isQueueMessageKey = keyMatchers[Command.QUEUE_MESSAGE](key);
|
|
452
463
|
const isPlainTab = key.name === 'tab' && !key.shift && !key.alt && !key.ctrl && !key.cmd;
|
|
453
464
|
const hasTabCompletionInteraction = (completion.showSuggestions && isShellSuggestionsVisible) ||
|
|
454
465
|
Boolean(completion.promptCompletion.text) ||
|
|
455
466
|
reverseSearchActive ||
|
|
456
467
|
commandSearchActive;
|
|
468
|
+
if (isGenerating &&
|
|
469
|
+
isQueueMessageKey &&
|
|
470
|
+
!hasTabCompletionInteraction &&
|
|
471
|
+
buffer.text.trim().length > 0) {
|
|
472
|
+
const trimmedMessage = buffer.text.trim();
|
|
473
|
+
const isSlash = isSlashCommand(trimmedMessage);
|
|
474
|
+
if (isSlash || shellModeActive) {
|
|
475
|
+
setQueueErrorMessage(`${shellModeActive ? 'Shell' : 'Slash'} commands cannot be queued`);
|
|
476
|
+
}
|
|
477
|
+
else if (onQueueMessage) {
|
|
478
|
+
onQueueMessage(buffer.text);
|
|
479
|
+
buffer.setText('');
|
|
480
|
+
resetCompletionState();
|
|
481
|
+
resetReverseSearchCompletionState();
|
|
482
|
+
}
|
|
483
|
+
resetPlainTabPress();
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
457
486
|
if (isPlainTab && shellModeActive) {
|
|
458
487
|
resetPlainTabPress();
|
|
459
488
|
if (!shouldShowSuggestions) {
|
|
@@ -600,6 +629,11 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
600
629
|
resetEscapeState();
|
|
601
630
|
return true;
|
|
602
631
|
}
|
|
632
|
+
// If we're generating and no local overlay consumed Escape, let it
|
|
633
|
+
// propagate to the global cancellation handler.
|
|
634
|
+
if (isGenerating) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
603
637
|
handleEscPress();
|
|
604
638
|
return true;
|
|
605
639
|
}
|
|
@@ -886,6 +920,14 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
886
920
|
buffer.openInExternalEditor();
|
|
887
921
|
return true;
|
|
888
922
|
}
|
|
923
|
+
if (keyMatchers[Command.DEPRECATED_OPEN_EXTERNAL_EDITOR](key)) {
|
|
924
|
+
const cmdKey = formatCommand(Command.OPEN_EXTERNAL_EDITOR);
|
|
925
|
+
appEvents.emit(AppEvent.TransientMessage, {
|
|
926
|
+
message: `Use ${cmdKey} to open the external editor.`,
|
|
927
|
+
type: TransientMessageType.Hint,
|
|
928
|
+
});
|
|
929
|
+
return true;
|
|
930
|
+
}
|
|
889
931
|
// Ctrl+V for clipboard paste
|
|
890
932
|
if (keyMatchers[Command.PASTE_CLIPBOARD](key)) {
|
|
891
933
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -897,7 +939,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
897
939
|
}
|
|
898
940
|
if (keyMatchers[Command.FOCUS_SHELL_INPUT](key)) {
|
|
899
941
|
if (activePtyId ||
|
|
900
|
-
(
|
|
942
|
+
(backgroundTasks.size > 0 && backgroundTaskHeight > 0)) {
|
|
901
943
|
setEmbeddedShellFocused(true);
|
|
902
944
|
return true;
|
|
903
945
|
}
|
|
@@ -947,11 +989,14 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
947
989
|
shortcutsHelpVisible,
|
|
948
990
|
setShortcutsHelpVisible,
|
|
949
991
|
tryLoadQueuedMessages,
|
|
992
|
+
onQueueMessage,
|
|
993
|
+
setQueueErrorMessage,
|
|
994
|
+
resetReverseSearchCompletionState,
|
|
950
995
|
setBannerVisible,
|
|
951
996
|
activePtyId,
|
|
952
997
|
setEmbeddedShellFocused,
|
|
953
|
-
|
|
954
|
-
|
|
998
|
+
backgroundTasks.size,
|
|
999
|
+
backgroundTaskHeight,
|
|
955
1000
|
streamingState,
|
|
956
1001
|
handleEscPress,
|
|
957
1002
|
registerPlainTabPress,
|
|
@@ -965,12 +1010,10 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
965
1010
|
settings,
|
|
966
1011
|
]);
|
|
967
1012
|
useKeypress(handleInput, {
|
|
968
|
-
isActive: !isEmbeddedShellFocused,
|
|
1013
|
+
isActive: !isEmbeddedShellFocused && !copyModeEnabled,
|
|
969
1014
|
priority: true,
|
|
970
1015
|
});
|
|
971
|
-
const linesToRender = buffer.viewportVisualLines;
|
|
972
1016
|
const [cursorVisualRowAbsolute, cursorVisualColAbsolute] = buffer.visualCursor;
|
|
973
|
-
const scrollVisualRow = buffer.visualScrollRow;
|
|
974
1017
|
const getGhostTextLines = useCallback(() => {
|
|
975
1018
|
if (!completion.promptCompletion.text ||
|
|
976
1019
|
!buffer.text ||
|
|
@@ -1068,6 +1111,94 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
1068
1111
|
inputWidth,
|
|
1069
1112
|
]);
|
|
1070
1113
|
const { inlineGhost, additionalLines } = getGhostTextLines();
|
|
1114
|
+
const scrollableData = useMemo(() => {
|
|
1115
|
+
const items = buffer.allVisualLines.map((lineText, index) => ({
|
|
1116
|
+
type: 'visualLine',
|
|
1117
|
+
lineText,
|
|
1118
|
+
absoluteVisualIdx: index,
|
|
1119
|
+
}));
|
|
1120
|
+
additionalLines.forEach((ghostLine, index) => {
|
|
1121
|
+
items.push({
|
|
1122
|
+
type: 'ghostLine',
|
|
1123
|
+
ghostLine,
|
|
1124
|
+
index,
|
|
1125
|
+
});
|
|
1126
|
+
});
|
|
1127
|
+
return items;
|
|
1128
|
+
}, [buffer.allVisualLines, additionalLines]);
|
|
1129
|
+
const renderItem = useCallback(({ item }) => {
|
|
1130
|
+
if (item.type === 'ghostLine') {
|
|
1131
|
+
const padding = Math.max(0, inputWidth - stringWidth(item.ghostLine));
|
|
1132
|
+
return (_jsx(Box, { height: 1, children: _jsxs(Text, { color: theme.text.secondary, children: [item.ghostLine, ' '.repeat(padding)] }) }));
|
|
1133
|
+
}
|
|
1134
|
+
const { lineText, absoluteVisualIdx } = item;
|
|
1135
|
+
// console.log('renderItem called with:', lineText);
|
|
1136
|
+
const mapEntry = buffer.visualToLogicalMap[absoluteVisualIdx];
|
|
1137
|
+
if (!mapEntry)
|
|
1138
|
+
return _jsx(Text, { children: " " });
|
|
1139
|
+
const isOnCursorLine = focus && absoluteVisualIdx === cursorVisualRowAbsolute;
|
|
1140
|
+
const renderedLine = [];
|
|
1141
|
+
const [logicalLineIdx] = mapEntry;
|
|
1142
|
+
const logicalLine = buffer.lines[logicalLineIdx] || '';
|
|
1143
|
+
const transformations = buffer.transformationsByLine[logicalLineIdx] ?? [];
|
|
1144
|
+
const tokens = parseInputForHighlighting(logicalLine, logicalLineIdx, transformations, ...(focus && buffer.cursor[0] === logicalLineIdx
|
|
1145
|
+
? [buffer.cursor[1]]
|
|
1146
|
+
: []));
|
|
1147
|
+
const visualStartCol = buffer.visualToTransformedMap[absoluteVisualIdx] ?? 0;
|
|
1148
|
+
const visualEndCol = visualStartCol + cpLen(lineText);
|
|
1149
|
+
const segments = parseSegmentsFromTokens(tokens, visualStartCol, visualEndCol);
|
|
1150
|
+
let charCount = 0;
|
|
1151
|
+
segments.forEach((seg, segIdx) => {
|
|
1152
|
+
const segLen = cpLen(seg.text);
|
|
1153
|
+
let display = seg.text;
|
|
1154
|
+
if (isOnCursorLine) {
|
|
1155
|
+
const relCol = cursorVisualColAbsolute;
|
|
1156
|
+
const segStart = charCount;
|
|
1157
|
+
const segEnd = segStart + segLen;
|
|
1158
|
+
if (relCol >= segStart && relCol < segEnd) {
|
|
1159
|
+
const charToHighlight = cpSlice(display, relCol - segStart, relCol - segStart + 1);
|
|
1160
|
+
const highlighted = showCursor
|
|
1161
|
+
? chalk.inverse(charToHighlight)
|
|
1162
|
+
: charToHighlight;
|
|
1163
|
+
display =
|
|
1164
|
+
cpSlice(display, 0, relCol - segStart) +
|
|
1165
|
+
highlighted +
|
|
1166
|
+
cpSlice(display, relCol - segStart + 1);
|
|
1167
|
+
}
|
|
1168
|
+
charCount = segEnd;
|
|
1169
|
+
}
|
|
1170
|
+
else {
|
|
1171
|
+
charCount += segLen;
|
|
1172
|
+
}
|
|
1173
|
+
const color = seg.type === 'command' || seg.type === 'file' || seg.type === 'paste'
|
|
1174
|
+
? theme.text.accent
|
|
1175
|
+
: theme.text.primary;
|
|
1176
|
+
renderedLine.push(_jsx(Text, { color: color, children: display }, `token-${segIdx}`));
|
|
1177
|
+
});
|
|
1178
|
+
const currentLineGhost = isOnCursorLine ? inlineGhost : '';
|
|
1179
|
+
if (isOnCursorLine &&
|
|
1180
|
+
cursorVisualColAbsolute === cpLen(lineText) &&
|
|
1181
|
+
!currentLineGhost) {
|
|
1182
|
+
renderedLine.push(_jsx(Text, { children: showCursor ? chalk.inverse(' ') : ' ' }, `cursor-end-${cursorVisualColAbsolute}`));
|
|
1183
|
+
}
|
|
1184
|
+
const showCursorBeforeGhost = focus &&
|
|
1185
|
+
isOnCursorLine &&
|
|
1186
|
+
cursorVisualColAbsolute === cpLen(lineText) &&
|
|
1187
|
+
currentLineGhost;
|
|
1188
|
+
return (_jsx(Box, { height: 1, children: _jsxs(Text, { terminalCursorFocus: showCursor && isOnCursorLine, terminalCursorPosition: cpIndexToOffset(lineText, cursorVisualColAbsolute), children: [renderedLine, showCursorBeforeGhost && (showCursor ? chalk.inverse(' ') : ' '), currentLineGhost && (_jsx(Text, { color: theme.text.secondary, children: currentLineGhost }))] }) }));
|
|
1189
|
+
}, [
|
|
1190
|
+
buffer.visualToLogicalMap,
|
|
1191
|
+
buffer.lines,
|
|
1192
|
+
buffer.transformationsByLine,
|
|
1193
|
+
buffer.cursor,
|
|
1194
|
+
buffer.visualToTransformedMap,
|
|
1195
|
+
focus,
|
|
1196
|
+
cursorVisualRowAbsolute,
|
|
1197
|
+
cursorVisualColAbsolute,
|
|
1198
|
+
showCursor,
|
|
1199
|
+
inlineGhost,
|
|
1200
|
+
inputWidth,
|
|
1201
|
+
]);
|
|
1071
1202
|
const useBackgroundColor = config.getUseBackgroundColor();
|
|
1072
1203
|
const isLowColor = isLowColorDepth();
|
|
1073
1204
|
const terminalBg = theme.background.primary || 'black';
|
|
@@ -1083,6 +1214,38 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
1083
1214
|
}
|
|
1084
1215
|
return false;
|
|
1085
1216
|
}, [useBackgroundColor, isLowColor, terminalBg]);
|
|
1217
|
+
const prevCursorRef = useRef(buffer.visualCursor);
|
|
1218
|
+
const prevTextRef = useRef(buffer.text);
|
|
1219
|
+
// Effect to ensure cursor remains visible after interactions
|
|
1220
|
+
useEffect(() => {
|
|
1221
|
+
const cursorChanged = prevCursorRef.current !== buffer.visualCursor;
|
|
1222
|
+
const textChanged = prevTextRef.current !== buffer.text;
|
|
1223
|
+
prevCursorRef.current = buffer.visualCursor;
|
|
1224
|
+
prevTextRef.current = buffer.text;
|
|
1225
|
+
if (!cursorChanged && !textChanged)
|
|
1226
|
+
return;
|
|
1227
|
+
if (!listRef.current || !focus)
|
|
1228
|
+
return;
|
|
1229
|
+
const { scrollTop, innerHeight } = listRef.current.getScrollState();
|
|
1230
|
+
if (innerHeight === 0)
|
|
1231
|
+
return;
|
|
1232
|
+
const cursorVisualRow = buffer.visualCursor[0];
|
|
1233
|
+
const actualScrollTop = Math.round(scrollTop);
|
|
1234
|
+
// If cursor is out of the currently visible viewport...
|
|
1235
|
+
if (cursorVisualRow < actualScrollTop ||
|
|
1236
|
+
cursorVisualRow >= actualScrollTop + innerHeight) {
|
|
1237
|
+
// Calculate minimal scroll to make it visible
|
|
1238
|
+
let newScrollTop = actualScrollTop;
|
|
1239
|
+
if (cursorVisualRow < actualScrollTop) {
|
|
1240
|
+
newScrollTop = cursorVisualRow;
|
|
1241
|
+
}
|
|
1242
|
+
else if (cursorVisualRow >= actualScrollTop + innerHeight) {
|
|
1243
|
+
newScrollTop = cursorVisualRow - innerHeight + 1;
|
|
1244
|
+
}
|
|
1245
|
+
listRef.current.scrollToIndex({ index: newScrollTop });
|
|
1246
|
+
}
|
|
1247
|
+
}, [buffer.visualCursor, buffer.text, focus]);
|
|
1248
|
+
const listBackgroundColor = useLineFallback || !useBackgroundColor ? undefined : theme.background.input;
|
|
1086
1249
|
useEffect(() => {
|
|
1087
1250
|
if (onSuggestionsVisibilityChange) {
|
|
1088
1251
|
onSuggestionsVisibilityChange(shouldShowSuggestions);
|
|
@@ -1120,74 +1283,16 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
1120
1283
|
const borderColor = isShellFocused && !isEmbeddedShellFocused
|
|
1121
1284
|
? (statusColor ?? theme.ui.focus)
|
|
1122
1285
|
: theme.border.default;
|
|
1123
|
-
return (_jsxs(_Fragment, { children: [suggestionsPosition === 'above' && suggestionsNode, useLineFallback ? (_jsx(Box, { borderStyle: "round", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: borderColor, width: terminalWidth, flexDirection: "row", alignItems: "flex-start", height: 0 })) : null, _jsx(HalfLinePaddedBox, { backgroundBaseColor: theme.background.input, backgroundOpacity: 1, useBackgroundColor: useBackgroundColor, children: _jsxs(Box, { flexGrow: 1, flexDirection: "row", paddingX: 1, borderColor: borderColor, borderStyle: useLineFallback ? 'round' : undefined, borderTop: false, borderBottom: false, borderLeft: !useBackgroundColor, borderRight: !useBackgroundColor, children: [_jsxs(Text, { color: statusColor ?? theme.text.accent, "aria-label": statusText || undefined, children: [shellModeActive ? (reverseSearchActive ? (_jsxs(Text, { color: theme.text.link, "aria-label": SCREEN_READER_USER_PREFIX, children: ["(r:)", ' '] })) : ('!')) : commandSearchActive ? (_jsx(Text, { color: theme.text.accent, children: "(r:) " })) : showYoloStyling ? ('*') : ('>'), ' '] }), _jsx(Box, { flexGrow: 1, flexDirection: "column", ref: innerBoxRef, children: buffer.text.length === 0 && placeholder ? (showCursor ? (_jsxs(Text, { terminalCursorFocus: showCursor, terminalCursorPosition: 0, children: [chalk.inverse(placeholder.slice(0, 1)), _jsx(Text, { color: theme.text.secondary, children: placeholder.slice(1) })] })) : (_jsx(Text, { color: theme.text.secondary, children: placeholder }))) : (
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
const transformations = buffer.transformationsByLine[logicalLineIdx] ?? [];
|
|
1135
|
-
const tokens = parseInputForHighlighting(logicalLine, logicalLineIdx, transformations, ...(focus && buffer.cursor[0] === logicalLineIdx
|
|
1136
|
-
? [buffer.cursor[1]]
|
|
1137
|
-
: []));
|
|
1138
|
-
const startColInTransformed = buffer.visualToTransformedMap[absoluteVisualIdx] ?? 0;
|
|
1139
|
-
const visualStartCol = startColInTransformed;
|
|
1140
|
-
const visualEndCol = visualStartCol + cpLen(lineText);
|
|
1141
|
-
const segments = parseSegmentsFromTokens(tokens, visualStartCol, visualEndCol);
|
|
1142
|
-
let charCount = 0;
|
|
1143
|
-
segments.forEach((seg, segIdx) => {
|
|
1144
|
-
const segLen = cpLen(seg.text);
|
|
1145
|
-
let display = seg.text;
|
|
1146
|
-
if (isOnCursorLine) {
|
|
1147
|
-
const relativeVisualColForHighlight = cursorVisualColAbsolute;
|
|
1148
|
-
const segStart = charCount;
|
|
1149
|
-
const segEnd = segStart + segLen;
|
|
1150
|
-
if (relativeVisualColForHighlight >= segStart &&
|
|
1151
|
-
relativeVisualColForHighlight < segEnd) {
|
|
1152
|
-
const charToHighlight = cpSlice(display, relativeVisualColForHighlight - segStart, relativeVisualColForHighlight - segStart + 1);
|
|
1153
|
-
const highlighted = showCursor
|
|
1154
|
-
? chalk.inverse(charToHighlight)
|
|
1155
|
-
: charToHighlight;
|
|
1156
|
-
display =
|
|
1157
|
-
cpSlice(display, 0, relativeVisualColForHighlight - segStart) +
|
|
1158
|
-
highlighted +
|
|
1159
|
-
cpSlice(display, relativeVisualColForHighlight - segStart + 1);
|
|
1160
|
-
}
|
|
1161
|
-
charCount = segEnd;
|
|
1162
|
-
}
|
|
1163
|
-
else {
|
|
1164
|
-
// Advance the running counter even when not on cursor line
|
|
1165
|
-
charCount += segLen;
|
|
1166
|
-
}
|
|
1167
|
-
const color = seg.type === 'command' ||
|
|
1168
|
-
seg.type === 'file' ||
|
|
1169
|
-
seg.type === 'paste'
|
|
1170
|
-
? theme.text.accent
|
|
1171
|
-
: theme.text.primary;
|
|
1172
|
-
renderedLine.push(_jsx(Text, { color: color, children: display }, `token-${segIdx}`));
|
|
1173
|
-
});
|
|
1174
|
-
const currentLineGhost = isOnCursorLine ? inlineGhost : '';
|
|
1175
|
-
if (isOnCursorLine &&
|
|
1176
|
-
cursorVisualColAbsolute === cpLen(lineText)) {
|
|
1177
|
-
if (!currentLineGhost) {
|
|
1178
|
-
renderedLine.push(_jsx(Text, { children: showCursor ? chalk.inverse(' ') : ' ' }, `cursor-end-${cursorVisualColAbsolute}`));
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
const showCursorBeforeGhost = focus &&
|
|
1182
|
-
isOnCursorLine &&
|
|
1183
|
-
cursorVisualColAbsolute === cpLen(lineText) &&
|
|
1184
|
-
currentLineGhost;
|
|
1185
|
-
return (_jsx(Box, { height: 1, children: _jsxs(Text, { terminalCursorFocus: showCursor && isOnCursorLine, terminalCursorPosition: cpIndexToOffset(lineText, cursorVisualColAbsolute), children: [renderedLine, showCursorBeforeGhost &&
|
|
1186
|
-
(showCursor ? chalk.inverse(' ') : ' '), currentLineGhost && (_jsx(Text, { color: theme.text.secondary, children: currentLineGhost }))] }) }, `line-${visualIdxInRenderedSet}`));
|
|
1187
|
-
})
|
|
1188
|
-
.concat(additionalLines.map((ghostLine, index) => {
|
|
1189
|
-
const padding = Math.max(0, inputWidth - stringWidth(ghostLine));
|
|
1190
|
-
return (_jsxs(Text, { color: theme.text.secondary, children: [ghostLine, ' '.repeat(padding)] }, `ghost-line-${index}`));
|
|
1191
|
-
}))) })] }) }), useLineFallback ? (_jsx(Box, { borderStyle: "round", borderTop: false, borderBottom: true, borderLeft: false, borderRight: false, borderColor: borderColor, width: terminalWidth, flexDirection: "row", alignItems: "flex-start", height: 0 })) : null, suggestionsPosition === 'below' && suggestionsNode] }));
|
|
1286
|
+
return (_jsxs(_Fragment, { children: [suggestionsPosition === 'above' && suggestionsNode, useLineFallback ? (_jsx(Box, { borderStyle: "round", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: borderColor, width: terminalWidth, flexDirection: "row", alignItems: "flex-start", height: 0 })) : null, _jsx(HalfLinePaddedBox, { backgroundBaseColor: theme.background.input, backgroundOpacity: 1, useBackgroundColor: useBackgroundColor, children: _jsxs(Box, { flexGrow: 1, flexDirection: "row", paddingX: 1, borderColor: borderColor, borderStyle: useLineFallback ? 'round' : undefined, borderTop: false, borderBottom: false, borderLeft: !useBackgroundColor, borderRight: !useBackgroundColor, children: [_jsxs(Text, { color: statusColor ?? theme.text.accent, "aria-label": statusText || undefined, children: [shellModeActive ? (reverseSearchActive ? (_jsxs(Text, { color: theme.text.link, "aria-label": SCREEN_READER_USER_PREFIX, children: ["(r:)", ' '] })) : ('!')) : commandSearchActive ? (_jsx(Text, { color: theme.text.accent, children: "(r:) " })) : showYoloStyling ? ('*') : ('>'), ' '] }), _jsx(Box, { flexGrow: 1, flexDirection: "column", ref: innerBoxRef, children: buffer.text.length === 0 && placeholder ? (showCursor ? (_jsxs(Text, { terminalCursorFocus: showCursor, terminalCursorPosition: 0, children: [chalk.inverse(placeholder.slice(0, 1)), _jsx(Text, { color: theme.text.secondary, children: placeholder.slice(1) })] })) : (_jsx(Text, { color: theme.text.secondary, children: placeholder }))) : (_jsx(Box, { flexDirection: "column", height: Math.min(buffer.viewportHeight, scrollableData.length), width: "100%", children: isAlternateBuffer ? (_jsx(ScrollableList, { ref: listRef, hasFocus: focus, data: scrollableData, renderItem: renderItem, estimatedItemHeight: () => 1, fixedItemHeight: true, keyExtractor: (item) => item.type === 'visualLine'
|
|
1287
|
+
? `line-${item.absoluteVisualIdx}`
|
|
1288
|
+
: `ghost-${item.index}`, width: inputWidth, backgroundColor: listBackgroundColor, containerHeight: Math.min(buffer.viewportHeight, scrollableData.length) })) : (scrollableData
|
|
1289
|
+
.slice(buffer.visualScrollRow, buffer.visualScrollRow + buffer.viewportHeight)
|
|
1290
|
+
.map((item, index) => {
|
|
1291
|
+
const actualIndex = buffer.visualScrollRow + index;
|
|
1292
|
+
const key = item.type === 'visualLine'
|
|
1293
|
+
? `line-${item.absoluteVisualIdx}`
|
|
1294
|
+
: `ghost-${item.index}`;
|
|
1295
|
+
return (_jsx(Fragment, { children: renderItem({ item, index: actualIndex }) }, key));
|
|
1296
|
+
})) })) })] }) }), useLineFallback ? (_jsx(Box, { borderStyle: "round", borderTop: false, borderBottom: true, borderLeft: false, borderRight: false, borderColor: borderColor, width: terminalWidth, flexDirection: "row", alignItems: "flex-start", height: 0 })) : null, suggestionsPosition === 'below' && suggestionsNode] }));
|
|
1192
1297
|
};
|
|
1193
1298
|
//# sourceMappingURL=InputPrompt.js.map
|