centaurus-cli 3.0.1 → 3.1.0
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/ai/types.js +0 -1
- package/dist/ai/types.js.map +1 -1
- package/dist/cli-adapter.js +5047 -5158
- package/dist/cli-adapter.js.map +1 -1
- package/dist/commands/CommandParser.js +372 -315
- package/dist/commands/CommandParser.js.map +1 -1
- package/dist/config/build-config.js +11 -42
- package/dist/config/build-config.js.map +1 -1
- package/dist/config/defaultConfig.js +94 -82
- package/dist/config/defaultConfig.js.map +1 -1
- package/dist/config/manager.js +144 -160
- package/dist/config/manager.js.map +1 -1
- package/dist/config/mcp-config-manager.js +411 -364
- package/dist/config/mcp-config-manager.js.map +1 -1
- package/dist/config/models.js +118 -185
- package/dist/config/models.js.map +1 -1
- package/dist/config/slash-commands.js +186 -184
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/config/types.js +33 -26
- package/dist/config/types.js.map +1 -1
- package/dist/context/command-detector.js +63 -67
- package/dist/context/command-detector.js.map +1 -1
- package/dist/context/context-manager.js +533 -518
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/handlers/docker-handler.js +518 -576
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.js +1050 -1109
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/handlers/wsl-handler.js +558 -630
- package/dist/context/handlers/wsl-handler.js.map +1 -1
- package/dist/context/index.js +42 -6
- package/dist/context/index.js.map +1 -1
- package/dist/context/subshell-handler.js +0 -4
- package/dist/context/subshell-handler.js.map +1 -1
- package/dist/context/types.js +20 -31
- package/dist/context/types.js.map +1 -1
- package/dist/hooks/useConnectivity.js +13 -10
- package/dist/hooks/useConnectivity.js.map +1 -1
- package/dist/hooks/useTerminalDimensions.js +67 -79
- package/dist/hooks/useTerminalDimensions.js.map +1 -1
- package/dist/index.js +228 -251
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcp-command-handler.js +297 -260
- package/dist/mcp/mcp-command-handler.js.map +1 -1
- package/dist/mcp/mcp-server-manager.js +139 -155
- package/dist/mcp/mcp-server-manager.js.map +1 -1
- package/dist/mcp/mcp-tool-wrapper.js +74 -94
- package/dist/mcp/mcp-tool-wrapper.js.map +1 -1
- package/dist/services/ai-autocomplete-agent.js +169 -181
- package/dist/services/ai-autocomplete-agent.js.map +1 -1
- package/dist/services/ai-context-injector.js +180 -93
- package/dist/services/ai-context-injector.js.map +1 -1
- package/dist/services/ai-service-client.js +513 -456
- package/dist/services/ai-service-client.js.map +1 -1
- package/dist/services/api-client.js +443 -441
- package/dist/services/api-client.js.map +1 -1
- package/dist/services/auth-handler.js +162 -198
- package/dist/services/auth-handler.js.map +1 -1
- package/dist/services/background-task-manager.js +258 -282
- package/dist/services/background-task-manager.js.map +1 -1
- package/dist/services/checkpoint-manager.js +1526 -1512
- package/dist/services/checkpoint-manager.js.map +1 -1
- package/dist/services/clipboard-service.js +151 -200
- package/dist/services/clipboard-service.js.map +1 -1
- package/dist/services/connectivity-manager.js +63 -65
- package/dist/services/connectivity-manager.js.map +1 -1
- package/dist/services/conversation-manager.js +118 -121
- package/dist/services/conversation-manager.js.map +1 -1
- package/dist/services/environment-context-injector.js +160 -187
- package/dist/services/environment-context-injector.js.map +1 -1
- package/dist/services/fast-context-agent.js +203 -243
- package/dist/services/fast-context-agent.js.map +1 -1
- package/dist/services/input-detection-agent.js +190 -202
- package/dist/services/input-detection-agent.js.map +1 -1
- package/dist/services/input-requirement-detector.js +155 -189
- package/dist/services/input-requirement-detector.js.map +1 -1
- package/dist/services/local-chat-storage.js +342 -365
- package/dist/services/local-chat-storage.js.map +1 -1
- package/dist/services/monitored-shell-manager.js +225 -233
- package/dist/services/monitored-shell-manager.js.map +1 -1
- package/dist/services/ollama-service.js +293 -310
- package/dist/services/ollama-service.js.map +1 -1
- package/dist/services/rules-storage.js +142 -0
- package/dist/services/rules-storage.js.map +1 -0
- package/dist/services/session-quota-manager.js +219 -235
- package/dist/services/session-quota-manager.js.map +1 -1
- package/dist/services/shell-input-agent.js +299 -334
- package/dist/services/shell-input-agent.js.map +1 -1
- package/dist/services/sub-agent-manager.js +459 -501
- package/dist/services/sub-agent-manager.js.map +1 -1
- package/dist/services/warpify-detector.js +133 -183
- package/dist/services/warpify-detector.js.map +1 -1
- package/dist/services/workflow-storage.js +202 -217
- package/dist/services/workflow-storage.js.map +1 -1
- package/dist/test-ssh-handler.js +148 -193
- package/dist/test-ssh-handler.js.map +1 -1
- package/dist/tools/add-mcp.js +161 -0
- package/dist/tools/add-mcp.js.map +1 -0
- package/dist/tools/background-command.js +240 -273
- package/dist/tools/background-command.js.map +1 -1
- package/dist/tools/command.js +447 -440
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/create-image.js +172 -202
- package/dist/tools/create-image.js.map +1 -1
- package/dist/tools/enter-remote-session.js +169 -215
- package/dist/tools/enter-remote-session.js.map +1 -1
- package/dist/tools/fast-context.js +60 -67
- package/dist/tools/fast-context.js.map +1 -1
- package/dist/tools/file-ops.js +601 -572
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/find-files.js +262 -303
- package/dist/tools/find-files.js.map +1 -1
- package/dist/tools/get-diff.js +423 -406
- package/dist/tools/get-diff.js.map +1 -1
- package/dist/tools/grep-search.js +966 -948
- package/dist/tools/grep-search.js.map +1 -1
- package/dist/tools/inspect-symbol.js +308 -323
- package/dist/tools/inspect-symbol.js.map +1 -1
- package/dist/tools/plan-mode.js +459 -503
- package/dist/tools/plan-mode.js.map +1 -1
- package/dist/tools/read-binary-file.js +160 -190
- package/dist/tools/read-binary-file.js.map +1 -1
- package/dist/tools/registry.js +100 -84
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/reproduce_issue.js +170 -151
- package/dist/tools/reproduce_issue.js.map +1 -1
- package/dist/tools/sub-agent.js +223 -228
- package/dist/tools/sub-agent.js.map +1 -1
- package/dist/tools/task-complete.js +28 -27
- package/dist/tools/task-complete.js.map +1 -1
- package/dist/tools/types.js +0 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/validation.js +96 -118
- package/dist/tools/validation.js.map +1 -1
- package/dist/tools/web-search.js +194 -194
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/workflow-tool.js +77 -82
- package/dist/tools/workflow-tool.js.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/rule.js +1 -0
- package/dist/types/rule.js.map +1 -0
- package/dist/types/workflow.js +0 -7
- package/dist/types/workflow.js.map +1 -1
- package/dist/ui/components/AgentTimer.js +24 -25
- package/dist/ui/components/AgentTimer.js.map +1 -1
- package/dist/ui/components/App.js +3266 -3263
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/AuthScreen.js +22 -34
- package/dist/ui/components/AuthScreen.js.map +1 -1
- package/dist/ui/components/AuthWelcomeScreen.js +30 -24
- package/dist/ui/components/AuthWelcomeScreen.js.map +1 -1
- package/dist/ui/components/Breadcrumbs.js +53 -82
- package/dist/ui/components/Breadcrumbs.js.map +1 -1
- package/dist/ui/components/CircularSelectInput.js +59 -67
- package/dist/ui/components/CircularSelectInput.js.map +1 -1
- package/dist/ui/components/ClipboardFileAutocomplete.js +78 -39
- package/dist/ui/components/ClipboardFileAutocomplete.js.map +1 -1
- package/dist/ui/components/CodeBlock.js +24 -42
- package/dist/ui/components/CodeBlock.js.map +1 -1
- package/dist/ui/components/ConfigViewer.js +18 -25
- package/dist/ui/components/ConfigViewer.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +49 -71
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/ConnectionStatusMessage.js +32 -83
- package/dist/ui/components/ConnectionStatusMessage.js.map +1 -1
- package/dist/ui/components/ContextWindowIndicator.js +34 -49
- package/dist/ui/components/ContextWindowIndicator.js.map +1 -1
- package/dist/ui/components/DetailedPlanReviewScreen.js +104 -106
- package/dist/ui/components/DetailedPlanReviewScreen.js.map +1 -1
- package/dist/ui/components/DiffViewer.js +68 -121
- package/dist/ui/components/DiffViewer.js.map +1 -1
- package/dist/ui/components/ErrorBoundary.js +40 -48
- package/dist/ui/components/ErrorBoundary.js.map +1 -1
- package/dist/ui/components/FileCreationPreview.js +29 -60
- package/dist/ui/components/FileCreationPreview.js.map +1 -1
- package/dist/ui/components/FileOperation.js +34 -29
- package/dist/ui/components/FileOperation.js.map +1 -1
- package/dist/ui/components/FileTagAutocomplete.js +55 -25
- package/dist/ui/components/FileTagAutocomplete.js.map +1 -1
- package/dist/ui/components/FontRecommendation.js.map +1 -1
- package/dist/ui/components/GitDiffBreadcrumb.js +29 -0
- package/dist/ui/components/GitDiffBreadcrumb.js.map +1 -0
- package/dist/ui/components/InputBox.js +1620 -2150
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.js +234 -352
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/KeyboardHelp.js +34 -35
- package/dist/ui/components/KeyboardHelp.js.map +1 -1
- package/dist/ui/components/LoadingIndicator.js +22 -25
- package/dist/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/ui/components/MCPAddScreen.js +40 -51
- package/dist/ui/components/MCPAddScreen.js.map +1 -1
- package/dist/ui/components/MCPListScreen.js +40 -48
- package/dist/ui/components/MCPListScreen.js.map +1 -1
- package/dist/ui/components/MCPServerListScreen.js +49 -56
- package/dist/ui/components/MCPServerListScreen.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +69 -96
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/MessageBox.js +66 -48
- package/dist/ui/components/MessageBox.js.map +1 -1
- package/dist/ui/components/MessageDisplay.js +150 -142
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/MonitorModeAIPanel.js +46 -65
- package/dist/ui/components/MonitorModeAIPanel.js.map +1 -1
- package/dist/ui/components/MultiLineInput.js +243 -277
- package/dist/ui/components/MultiLineInput.js.map +1 -1
- package/dist/ui/components/PasswordPrompt.js +37 -18
- package/dist/ui/components/PasswordPrompt.js.map +1 -1
- package/dist/ui/components/PlanAcceptedMessage.js +27 -38
- package/dist/ui/components/PlanAcceptedMessage.js.map +1 -1
- package/dist/ui/components/PlanReviewScreen.js +46 -50
- package/dist/ui/components/PlanReviewScreen.js.map +1 -1
- package/dist/ui/components/RulesEditorScreen.js +81 -0
- package/dist/ui/components/RulesEditorScreen.js.map +1 -0
- package/dist/ui/components/SelectPrompt.js +19 -8
- package/dist/ui/components/SelectPrompt.js.map +1 -1
- package/dist/ui/components/ShimmerText.js +44 -0
- package/dist/ui/components/ShimmerText.js.map +1 -0
- package/dist/ui/components/SlashCommandAutocomplete.js +49 -22
- package/dist/ui/components/SlashCommandAutocomplete.js.map +1 -1
- package/dist/ui/components/StatusBar.js +56 -87
- package/dist/ui/components/StatusBar.js.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +116 -99
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/TaskCompletedMessage.js +28 -23
- package/dist/ui/components/TaskCompletedMessage.js.map +1 -1
- package/dist/ui/components/TaskProgressIndicator.js +44 -70
- package/dist/ui/components/TaskProgressIndicator.js.map +1 -1
- package/dist/ui/components/ThinkingDisplay.js +44 -41
- package/dist/ui/components/ThinkingDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +772 -1326
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/ToolExecutionStatus.js +53 -84
- package/dist/ui/components/ToolExecutionStatus.js.map +1 -1
- package/dist/ui/components/ToolResult.js +22 -15
- package/dist/ui/components/ToolResult.js.map +1 -1
- package/dist/ui/components/VersionUpdatePrompt.js +88 -120
- package/dist/ui/components/VersionUpdatePrompt.js.map +1 -1
- package/dist/ui/components/WelcomeBanner.js +176 -26
- package/dist/ui/components/WelcomeBanner.js.map +1 -1
- package/dist/ui/components/WorkflowCreatorScreen.js +94 -161
- package/dist/ui/components/WorkflowCreatorScreen.js.map +1 -1
- package/dist/utils/ansi-encoder.js +30 -61
- package/dist/utils/ansi-encoder.js.map +1 -1
- package/dist/utils/chat-formatter.js +327 -305
- package/dist/utils/chat-formatter.js.map +1 -1
- package/dist/utils/command-history.js +152 -174
- package/dist/utils/command-history.js.map +1 -1
- package/dist/utils/context-sanitizer.js +49 -112
- package/dist/utils/context-sanitizer.js.map +1 -1
- package/dist/utils/conversation-logger.js +292 -324
- package/dist/utils/conversation-logger.js.map +1 -1
- package/dist/utils/custom-commands-manager.js +126 -131
- package/dist/utils/custom-commands-manager.js.map +1 -1
- package/dist/utils/editor-utils.js +732 -837
- package/dist/utils/editor-utils.js.map +1 -1
- package/dist/utils/file.js +174 -213
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/git-stats.js +169 -0
- package/dist/utils/git-stats.js.map +1 -0
- package/dist/utils/input-classifier.js +960 -482
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/logger.js +48 -73
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/markdown-parser.js +277 -310
- package/dist/utils/markdown-parser.js.map +1 -1
- package/dist/utils/rule-reference-resolver.js +54 -0
- package/dist/utils/rule-reference-resolver.js.map +1 -0
- package/dist/utils/shell.js +144 -156
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/state.js +23 -22
- package/dist/utils/state.js.map +1 -1
- package/dist/utils/syntax-checker.js +279 -327
- package/dist/utils/syntax-checker.js.map +1 -1
- package/dist/utils/terminal-output.js +199 -302
- package/dist/utils/terminal-output.js.map +1 -1
- package/dist/utils/text-clipboard.js +47 -70
- package/dist/utils/text-clipboard.js.map +1 -1
- package/dist/utils/unicode-sanitizer.js +134 -197
- package/dist/utils/unicode-sanitizer.js.map +1 -1
- package/dist/utils/version-checker.js +46 -56
- package/dist/utils/version-checker.js.map +1 -1
- package/package.json +6 -4
- package/dist/ai/types.d.ts +0 -20
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/cli-adapter.d.ts +0 -514
- package/dist/cli-adapter.d.ts.map +0 -1
- package/dist/commands/CommandParser.d.ts +0 -27
- package/dist/commands/CommandParser.d.ts.map +0 -1
- package/dist/config/build-config.d.ts +0 -42
- package/dist/config/build-config.d.ts.map +0 -1
- package/dist/config/defaultConfig.d.ts +0 -79
- package/dist/config/defaultConfig.d.ts.map +0 -1
- package/dist/config/manager.d.ts +0 -62
- package/dist/config/manager.d.ts.map +0 -1
- package/dist/config/mcp-config-manager.d.ts +0 -79
- package/dist/config/mcp-config-manager.d.ts.map +0 -1
- package/dist/config/models.d.ts +0 -83
- package/dist/config/models.d.ts.map +0 -1
- package/dist/config/slash-commands.d.ts +0 -23
- package/dist/config/slash-commands.d.ts.map +0 -1
- package/dist/config/types.d.ts +0 -35
- package/dist/config/types.d.ts.map +0 -1
- package/dist/context/command-detector.d.ts +0 -50
- package/dist/context/command-detector.d.ts.map +0 -1
- package/dist/context/context-manager.d.ts +0 -157
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/handlers/docker-handler.d.ts +0 -130
- package/dist/context/handlers/docker-handler.d.ts.map +0 -1
- package/dist/context/handlers/ssh-handler.d.ts +0 -201
- package/dist/context/handlers/ssh-handler.d.ts.map +0 -1
- package/dist/context/handlers/wsl-handler.d.ts +0 -146
- package/dist/context/handlers/wsl-handler.d.ts.map +0 -1
- package/dist/context/index.d.ts +0 -8
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/subshell-handler.d.ts +0 -165
- package/dist/context/subshell-handler.d.ts.map +0 -1
- package/dist/context/types.d.ts +0 -70
- package/dist/context/types.d.ts.map +0 -1
- package/dist/hooks/useConnectivity.d.ts +0 -2
- package/dist/hooks/useConnectivity.d.ts.map +0 -1
- package/dist/hooks/useTerminalDimensions.d.ts +0 -41
- package/dist/hooks/useTerminalDimensions.d.ts.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/mcp/mcp-command-handler.d.ts +0 -47
- package/dist/mcp/mcp-command-handler.d.ts.map +0 -1
- package/dist/mcp/mcp-server-manager.d.ts +0 -30
- package/dist/mcp/mcp-server-manager.d.ts.map +0 -1
- package/dist/mcp/mcp-tool-wrapper.d.ts +0 -12
- package/dist/mcp/mcp-tool-wrapper.d.ts.map +0 -1
- package/dist/services/ai-autocomplete-agent.d.ts +0 -39
- package/dist/services/ai-autocomplete-agent.d.ts.map +0 -1
- package/dist/services/ai-context-injector.d.ts +0 -41
- package/dist/services/ai-context-injector.d.ts.map +0 -1
- package/dist/services/ai-service-client.d.ts +0 -128
- package/dist/services/ai-service-client.d.ts.map +0 -1
- package/dist/services/api-client.d.ts +0 -353
- package/dist/services/api-client.d.ts.map +0 -1
- package/dist/services/auth-handler.d.ts +0 -30
- package/dist/services/auth-handler.d.ts.map +0 -1
- package/dist/services/background-task-manager.d.ts +0 -114
- package/dist/services/background-task-manager.d.ts.map +0 -1
- package/dist/services/checkpoint-manager.d.ts +0 -204
- package/dist/services/checkpoint-manager.d.ts.map +0 -1
- package/dist/services/clipboard-service.d.ts +0 -37
- package/dist/services/clipboard-service.d.ts.map +0 -1
- package/dist/services/connectivity-manager.d.ts +0 -18
- package/dist/services/connectivity-manager.d.ts.map +0 -1
- package/dist/services/conversation-manager.d.ts +0 -73
- package/dist/services/conversation-manager.d.ts.map +0 -1
- package/dist/services/environment-context-injector.d.ts +0 -69
- package/dist/services/environment-context-injector.d.ts.map +0 -1
- package/dist/services/fast-context-agent.d.ts +0 -12
- package/dist/services/fast-context-agent.d.ts.map +0 -1
- package/dist/services/input-detection-agent.d.ts +0 -40
- package/dist/services/input-detection-agent.d.ts.map +0 -1
- package/dist/services/input-requirement-detector.d.ts +0 -28
- package/dist/services/input-requirement-detector.d.ts.map +0 -1
- package/dist/services/local-chat-storage.d.ts +0 -182
- package/dist/services/local-chat-storage.d.ts.map +0 -1
- package/dist/services/monitored-shell-manager.d.ts +0 -120
- package/dist/services/monitored-shell-manager.d.ts.map +0 -1
- package/dist/services/ollama-service.d.ts +0 -197
- package/dist/services/ollama-service.d.ts.map +0 -1
- package/dist/services/session-quota-manager.d.ts +0 -101
- package/dist/services/session-quota-manager.d.ts.map +0 -1
- package/dist/services/shell-input-agent.d.ts +0 -89
- package/dist/services/shell-input-agent.d.ts.map +0 -1
- package/dist/services/sub-agent-manager.d.ts +0 -140
- package/dist/services/sub-agent-manager.d.ts.map +0 -1
- package/dist/services/warpify-detector.d.ts +0 -43
- package/dist/services/warpify-detector.d.ts.map +0 -1
- package/dist/services/workflow-storage.d.ts +0 -72
- package/dist/services/workflow-storage.d.ts.map +0 -1
- package/dist/test-ssh-handler.d.ts +0 -8
- package/dist/test-ssh-handler.d.ts.map +0 -1
- package/dist/tools/background-command.d.ts +0 -11
- package/dist/tools/background-command.d.ts.map +0 -1
- package/dist/tools/command.d.ts +0 -3
- package/dist/tools/command.d.ts.map +0 -1
- package/dist/tools/create-image.d.ts +0 -10
- package/dist/tools/create-image.d.ts.map +0 -1
- package/dist/tools/enter-remote-session.d.ts +0 -48
- package/dist/tools/enter-remote-session.d.ts.map +0 -1
- package/dist/tools/fast-context.d.ts +0 -3
- package/dist/tools/fast-context.d.ts.map +0 -1
- package/dist/tools/file-ops.d.ts +0 -7
- package/dist/tools/file-ops.d.ts.map +0 -1
- package/dist/tools/find-files.d.ts +0 -49
- package/dist/tools/find-files.d.ts.map +0 -1
- package/dist/tools/get-diff.d.ts +0 -14
- package/dist/tools/get-diff.d.ts.map +0 -1
- package/dist/tools/grep-search.d.ts +0 -155
- package/dist/tools/grep-search.d.ts.map +0 -1
- package/dist/tools/inspect-symbol.d.ts +0 -32
- package/dist/tools/inspect-symbol.d.ts.map +0 -1
- package/dist/tools/plan-mode.d.ts +0 -140
- package/dist/tools/plan-mode.d.ts.map +0 -1
- package/dist/tools/read-binary-file.d.ts +0 -10
- package/dist/tools/read-binary-file.d.ts.map +0 -1
- package/dist/tools/registry.d.ts +0 -31
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/reproduce_issue.d.ts +0 -2
- package/dist/tools/reproduce_issue.d.ts.map +0 -1
- package/dist/tools/sub-agent.d.ts +0 -9
- package/dist/tools/sub-agent.d.ts.map +0 -1
- package/dist/tools/task-complete.d.ts +0 -3
- package/dist/tools/task-complete.d.ts.map +0 -1
- package/dist/tools/types.d.ts +0 -40
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/validation.d.ts +0 -47
- package/dist/tools/validation.d.ts.map +0 -1
- package/dist/tools/web-search.d.ts +0 -24
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/workflow-tool.d.ts +0 -11
- package/dist/tools/workflow-tool.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -123
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/workflow.d.ts +0 -110
- package/dist/types/workflow.d.ts.map +0 -1
- package/dist/ui/components/AgentTimer.d.ts +0 -7
- package/dist/ui/components/AgentTimer.d.ts.map +0 -1
- package/dist/ui/components/App.d.ts +0 -197
- package/dist/ui/components/App.d.ts.map +0 -1
- package/dist/ui/components/AuthScreen.d.ts +0 -8
- package/dist/ui/components/AuthScreen.d.ts.map +0 -1
- package/dist/ui/components/AuthWelcomeScreen.d.ts +0 -8
- package/dist/ui/components/AuthWelcomeScreen.d.ts.map +0 -1
- package/dist/ui/components/Breadcrumbs.d.ts +0 -13
- package/dist/ui/components/Breadcrumbs.d.ts.map +0 -1
- package/dist/ui/components/CircularSelectInput.d.ts +0 -24
- package/dist/ui/components/CircularSelectInput.d.ts.map +0 -1
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts +0 -10
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/CodeBlock.d.ts +0 -9
- package/dist/ui/components/CodeBlock.d.ts.map +0 -1
- package/dist/ui/components/ConfigViewer.d.ts +0 -11
- package/dist/ui/components/ConfigViewer.d.ts.map +0 -1
- package/dist/ui/components/ConfirmPrompt.d.ts +0 -13
- package/dist/ui/components/ConfirmPrompt.d.ts.map +0 -1
- package/dist/ui/components/ConnectionStatusMessage.d.ts +0 -17
- package/dist/ui/components/ConnectionStatusMessage.d.ts.map +0 -1
- package/dist/ui/components/ContextWindowIndicator.d.ts +0 -8
- package/dist/ui/components/ContextWindowIndicator.d.ts.map +0 -1
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts +0 -17
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts.map +0 -1
- package/dist/ui/components/DiffViewer.d.ts +0 -9
- package/dist/ui/components/DiffViewer.d.ts.map +0 -1
- package/dist/ui/components/ErrorBoundary.d.ts +0 -17
- package/dist/ui/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/ui/components/FileCreationPreview.d.ts +0 -8
- package/dist/ui/components/FileCreationPreview.d.ts.map +0 -1
- package/dist/ui/components/FileOperation.d.ts +0 -10
- package/dist/ui/components/FileOperation.d.ts.map +0 -1
- package/dist/ui/components/FileTagAutocomplete.d.ts +0 -11
- package/dist/ui/components/FileTagAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/FontRecommendation.d.ts +0 -1
- package/dist/ui/components/FontRecommendation.d.ts.map +0 -1
- package/dist/ui/components/InputBox.d.ts +0 -42
- package/dist/ui/components/InputBox.d.ts.map +0 -1
- package/dist/ui/components/InteractiveShell.d.ts +0 -30
- package/dist/ui/components/InteractiveShell.d.ts.map +0 -1
- package/dist/ui/components/KeyboardHelp.d.ts +0 -7
- package/dist/ui/components/KeyboardHelp.d.ts.map +0 -1
- package/dist/ui/components/LoadingIndicator.d.ts +0 -3
- package/dist/ui/components/LoadingIndicator.d.ts.map +0 -1
- package/dist/ui/components/MCPAddScreen.d.ts +0 -13
- package/dist/ui/components/MCPAddScreen.d.ts.map +0 -1
- package/dist/ui/components/MCPListScreen.d.ts +0 -17
- package/dist/ui/components/MCPListScreen.d.ts.map +0 -1
- package/dist/ui/components/MCPServerListScreen.d.ts +0 -16
- package/dist/ui/components/MCPServerListScreen.d.ts.map +0 -1
- package/dist/ui/components/MarkdownRenderer.d.ts +0 -8
- package/dist/ui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/ui/components/MessageBox.d.ts +0 -10
- package/dist/ui/components/MessageBox.d.ts.map +0 -1
- package/dist/ui/components/MessageDisplay.d.ts +0 -14
- package/dist/ui/components/MessageDisplay.d.ts.map +0 -1
- package/dist/ui/components/MonitorModeAIPanel.d.ts +0 -23
- package/dist/ui/components/MonitorModeAIPanel.d.ts.map +0 -1
- package/dist/ui/components/MultiLineInput.d.ts +0 -13
- package/dist/ui/components/MultiLineInput.d.ts.map +0 -1
- package/dist/ui/components/PasswordPrompt.d.ts +0 -9
- package/dist/ui/components/PasswordPrompt.d.ts.map +0 -1
- package/dist/ui/components/PlanAcceptedMessage.d.ts +0 -20
- package/dist/ui/components/PlanAcceptedMessage.d.ts.map +0 -1
- package/dist/ui/components/PlanReviewScreen.d.ts +0 -14
- package/dist/ui/components/PlanReviewScreen.d.ts.map +0 -1
- package/dist/ui/components/SelectPrompt.d.ts +0 -12
- package/dist/ui/components/SelectPrompt.d.ts.map +0 -1
- package/dist/ui/components/SlashCommandAutocomplete.d.ts +0 -13
- package/dist/ui/components/SlashCommandAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/StatusBar.d.ts +0 -14
- package/dist/ui/components/StatusBar.d.ts.map +0 -1
- package/dist/ui/components/StreamingMessageDisplay.d.ts +0 -15
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +0 -1
- package/dist/ui/components/TaskCompletedMessage.d.ts +0 -14
- package/dist/ui/components/TaskCompletedMessage.d.ts.map +0 -1
- package/dist/ui/components/TaskProgressIndicator.d.ts +0 -18
- package/dist/ui/components/TaskProgressIndicator.d.ts.map +0 -1
- package/dist/ui/components/ThinkingDisplay.d.ts +0 -15
- package/dist/ui/components/ThinkingDisplay.d.ts.map +0 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts +0 -8
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +0 -1
- package/dist/ui/components/ToolExecutionStatus.d.ts +0 -10
- package/dist/ui/components/ToolExecutionStatus.d.ts.map +0 -1
- package/dist/ui/components/ToolResult.d.ts +0 -10
- package/dist/ui/components/ToolResult.d.ts.map +0 -1
- package/dist/ui/components/VersionUpdatePrompt.d.ts +0 -9
- package/dist/ui/components/VersionUpdatePrompt.d.ts.map +0 -1
- package/dist/ui/components/WelcomeBanner.d.ts +0 -3
- package/dist/ui/components/WelcomeBanner.d.ts.map +0 -1
- package/dist/ui/components/WorkflowCreatorScreen.d.ts +0 -25
- package/dist/ui/components/WorkflowCreatorScreen.d.ts.map +0 -1
- package/dist/utils/ansi-encoder.d.ts +0 -7
- package/dist/utils/ansi-encoder.d.ts.map +0 -1
- package/dist/utils/chat-formatter.d.ts +0 -12
- package/dist/utils/chat-formatter.d.ts.map +0 -1
- package/dist/utils/command-history.d.ts +0 -24
- package/dist/utils/command-history.d.ts.map +0 -1
- package/dist/utils/context-sanitizer.d.ts +0 -50
- package/dist/utils/context-sanitizer.d.ts.map +0 -1
- package/dist/utils/conversation-logger.d.ts +0 -142
- package/dist/utils/conversation-logger.d.ts.map +0 -1
- package/dist/utils/custom-commands-manager.d.ts +0 -59
- package/dist/utils/custom-commands-manager.d.ts.map +0 -1
- package/dist/utils/editor-utils.d.ts +0 -101
- package/dist/utils/editor-utils.d.ts.map +0 -1
- package/dist/utils/file.d.ts +0 -61
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/input-classifier.d.ts +0 -25
- package/dist/utils/input-classifier.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -17
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/markdown-parser.d.ts +0 -60
- package/dist/utils/markdown-parser.d.ts.map +0 -1
- package/dist/utils/shell.d.ts +0 -47
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/state.d.ts +0 -13
- package/dist/utils/state.d.ts.map +0 -1
- package/dist/utils/syntax-checker.d.ts +0 -24
- package/dist/utils/syntax-checker.d.ts.map +0 -1
- package/dist/utils/terminal-output.d.ts +0 -25
- package/dist/utils/terminal-output.d.ts.map +0 -1
- package/dist/utils/text-clipboard.d.ts +0 -12
- package/dist/utils/text-clipboard.d.ts.map +0 -1
- package/dist/utils/unicode-sanitizer.d.ts +0 -44
- package/dist/utils/unicode-sanitizer.d.ts.map +0 -1
- package/dist/utils/version-checker.d.ts +0 -14
- package/dist/utils/version-checker.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveShell.js","sourceRoot":"","sources":["../../../src/ui/components/InteractiveShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAyB,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AA6BnE;;GAEG;AACH,SAAS,oBAAoB,CAAC,GAAW,EAAE,aAAsB;IAC/D,IAAI,aAAa,IAAI,GAAG,EAAE,CAAC;QACzB,OAAO,GAAG,aAAa,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;IACvD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,OAAe,EAAE,YAAoB,EAAE;IAC9D,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS;QAAE,OAAO,OAAO,CAAC;IAC5D,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE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AAC,SAAS;;wBACN,gBAAgB,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE;;wBAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;6DAC/G,CACN,CACJ,CACG;gBACL,YAAY,GAAG,CAAC,IAAI,CACnB,oBAAC,GAAG;oBACF,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ;;wBAChB,YAAY;;wBAAO,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;yDACrD,CACH,CACP,CACG,CACP;YAGA,KAAK,IAAI,CAAC,SAAS,IAAI,CACtB,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;gBACf,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,MAAM,IAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAQ,CAC/D,CACP,CACG;QACL,SAAS,IAAI,CAAC,SAAS,IAAI,CAC1B,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;YAChB,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,8BAAyB,CACnD,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/InteractiveShell.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\r\nimport { Box, Text, useInput } from 'ink';\r\nimport Spinner from 'ink-spinner';\r\nimport stripAnsi from 'strip-ansi';\r\nimport { encodeKeyToAnsi } from '../../utils/ansi-encoder.js';\r\nimport { processTerminalOutput } from '../../utils/terminal-output.js';\r\nimport { getTerminalDimensions, TERMINAL_HEIGHT_CONSTANTS } from '../../hooks/useTerminalDimensions.js';\r\nimport { sanitizeUnicode } from '../../utils/unicode-sanitizer.js';\r\n\r\ninterface InteractiveShellProps {\r\n command: string;\r\n cwd: string;\r\n isRunning: boolean;\r\n output: string;\r\n exitCode?: number;\r\n error?: string;\r\n onInput?: (input: string) => void;\r\n isFocused: boolean;\r\n onFocusChange: (focused: boolean) => void;\r\n /** Whether to show a blinking cursor in focus mode (default: true) */\r\n showCursor?: boolean;\r\n onSignal?: (signal: string) => void;\r\n /** Callback to handle terminal resize */\r\n onResize?: (cols: number, rows: number) => void;\r\n /** Remote context for SSH/WSL/Docker environments */\r\n remoteContext?: string;\r\n /** Unique shell ID for agent control mode */\r\n shellId?: string;\r\n /** Whether agent control mode is enabled */\r\n isAgentControlled?: boolean;\r\n /** Callback when agent control mode is toggled */\r\n onToggleAgentControl?: () => void;\r\n /** Callback to warpify (attach to) the current session */\r\n onWarpifySession?: () => void;\r\n}\r\n\r\n/**\r\n * Format CWD with remote context prefix for SSH/Docker/WSL environments.\r\n */\r\nfunction formatCwdWithContext(cwd: string, remoteContext?: string): string {\r\n if (remoteContext && cwd) {\r\n return `${remoteContext}:${cwd.replace(/\\\\/g, '/')}`;\r\n }\r\n return cwd;\r\n}\r\n\r\n/**\r\n * Truncate long commands for display to prevent rendering issues\r\n * @param command - The command string to truncate\r\n * @param maxLength - Maximum length before truncation (default: 80)\r\n * @returns Truncated command with ellipsis if needed\r\n */\r\nfunction truncateCommand(command: string, maxLength: number = 80): string {\r\n if (!command || command.length <= maxLength) return command;\r\n return command.substring(0, maxLength) + '...';\r\n}\r\n\r\nexport const InteractiveShell: React.FC<InteractiveShellProps> = React.memo(({\r\n command,\r\n cwd,\r\n isRunning,\r\n output,\r\n exitCode,\r\n error,\r\n onInput,\r\n isFocused,\r\n onFocusChange,\r\n onSignal,\r\n onResize,\r\n remoteContext,\r\n shellId,\r\n isAgentControlled = false,\r\n showCursor = true,\r\n onToggleAgentControl,\r\n onWarpifySession\r\n}) => {\r\n const isMac = process.platform === 'darwin';\r\n\r\n // Scroll offset for viewing previous output (0 = at bottom/following latest)\r\n const [scrollOffset, setScrollOffset] = useState(0);\r\n // Track if user has manually scrolled (to disable auto-follow)\r\n const isAutoFollowRef = useRef(true);\r\n // Track total lines for scroll calculations\r\n const totalLinesRef = useRef(0);\r\n\r\n // Blinking cursor state\r\n const [cursorVisible, setCursorVisible] = useState(true);\r\n\r\n // Handle cursor blinking\r\n useEffect(() => {\r\n if (!isFocused || !showCursor) return;\r\n\r\n const interval = setInterval(() => {\r\n setCursorVisible(v => !v);\r\n }, 530); // 530ms is a standard blink rate\r\n\r\n return () => clearInterval(interval);\r\n }, [isFocused, showCursor]);\r\n\r\n // Calculate visible lines based on focus mode and terminal height\r\n // Uses centralized terminal dimensions for consistency\r\n const terminalRows = process.stdout.rows || 24;\r\n const {\r\n INPUT_BOX_RESERVED_HEIGHT,\r\n SAFETY_BUFFER,\r\n MIN_STREAMING_LINES\r\n } = TERMINAL_HEIGHT_CONSTANTS;\r\n\r\n // Shell-specific chrome: header (2), borders (2), focus indicator (1)\r\n const shellChrome = 5;\r\n\r\n // In focus mode, InputBox is hidden so we don't reserve space for it\r\n // Reserve enough to target ~23 visible lines in a typical terminal\r\n const totalReservedFocused = 12; // Header, footer, focus indicator, and safety buffer\r\n const totalReservedUnfocused = INPUT_BOX_RESERVED_HEIGHT + shellChrome + SAFETY_BUFFER;\r\n\r\n // Calculate max visible lines based on focus state\r\n // Calculate max visible lines based on focus state\r\n // User Requirement: Max 75% of screen height\r\n const maxAllowedHeight = Math.floor(terminalRows * 0.75);\r\n\r\n const availableForShellFocused = Math.max(\r\n MIN_STREAMING_LINES,\r\n Math.min(terminalRows - totalReservedFocused, maxAllowedHeight)\r\n );\r\n\r\n const availableForShellUnfocused = Math.max(MIN_STREAMING_LINES, terminalRows - totalReservedUnfocused);\r\n\r\n // When agent controlled, use only half the available height to make room for AI panel\r\n // SAFEGUARD: Ensure we don't calculate a negative or zero height, and maintain a minimum usable area\r\n const rawAgentHeight = Math.floor(availableForShellFocused / 2);\r\n const agentControlledHeight = Math.max(MIN_STREAMING_LINES, rawAgentHeight);\r\n\r\n // If even the minimum agent height would push us beyond available space (very small terminal),\r\n // we might need to compromise. But for now, ensuring it's at least MIN_STREAMING_LINES (3) is key.\r\n const maxVisibleLines = isFocused\r\n ? (isAgentControlled\r\n ? agentControlledHeight // Already clamped above\r\n : Math.max(MIN_STREAMING_LINES, availableForShellFocused)) // Focus mode: use most of terminal\r\n : Math.max(1, Math.min(5, availableForShellUnfocused)); // Unfocused: show at most 5 lines, at least 1\r\n\r\n // Handle terminal resize events\r\n useEffect(() => {\r\n if (!onResize || !isRunning) return;\r\n\r\n const handleResize = () => {\r\n const cols = process.stdout.columns || 80;\r\n const rows = process.stdout.rows || 24;\r\n onResize(cols, rows);\r\n };\r\n\r\n handleResize();\r\n process.stdout.on('resize', handleResize);\r\n return () => {\r\n process.stdout.off('resize', handleResize);\r\n };\r\n }, [onResize, isRunning]);\r\n\r\n // Get processed output and calculate total lines\r\n // Memoize this to prevent expensive re-processing on every render/blink\r\n // Only re-process if output changes or cursor state changes\r\n const { lines, total } = React.useMemo(() => {\r\n if (!output) return { lines: [] as string[], total: 0 };\r\n\r\n const highlightCursor = isFocused && showCursor && cursorVisible;\r\n const processedOutput = processTerminalOutput(output, { highlightCursor });\r\n const splitLines = processedOutput.split('\\n');\r\n return { lines: splitLines, total: splitLines.length };\r\n }, [output, isFocused, showCursor, cursorVisible]);\r\n\r\n // Helper to access lines (replacing getProcessedOutput call)\r\n // const getProcessedOutput = () => ... REMOVED\r\n\r\n // Get visible lines based on scroll offset\r\n const getVisibleOutput = () => {\r\n // const { lines, total } = getProcessedOutput(); // Replaced by useMemo above\r\n totalLinesRef.current = total;\r\n\r\n if (total === 0) return '';\r\n\r\n // SAFETY: Use current terminal width for wrapping calculations\r\n const cols = process.stdout.columns || 80;\r\n\r\n // STRICT HEIGHT CALCULATION\r\n // We must count *visual* lines (how many rows a line takes up when wrapped)\r\n // otherwise a single long line could blow out our height budget\r\n let visualLineCount = 0;\r\n const visualLinesMap: number[] = new Array(lines.length).fill(1);\r\n\r\n // 1. Calculate visual height of all lines\r\n // precise calculation is expensive, so we estimate: length / columns\r\n for (let i = 0; i < lines.length; i++) {\r\n const line = lines[i];\r\n const stripped = stripAnsi(line || '');\r\n // Minimum 1 row, ceil(length/cols) for wrapping\r\n // We add a small buffer for safety margin in calculation logic\r\n const rows = Math.max(1, Math.ceil(stripped.length / cols));\r\n visualLinesMap[i] = rows;\r\n }\r\n\r\n // 2. Determine which lines to show based on scrollOffset\r\n // We work backwards from the bottom (latest output)\r\n\r\n const visibleLinesToRender: string[] = [];\r\n let currentHeight = 0;\r\n\r\n // Apply scroll offset - skip N visual lines from bottom\r\n // This is a simplified approach: we skip logical lines until we pass the visual offset\r\n // Ideally we would skip pixel-perfect but logical-line skipping is safer for now\r\n let linesToSkip = scrollOffset;\r\n let startIndex = lines.length - 1;\r\n\r\n // Adjust start index based on scroll\r\n while (linesToSkip > 0 && startIndex >= 0) {\r\n // We treat scrollOffset as \"logical lines\" for consistency with existing UX controls\r\n // or we could treat it as visual lines? \r\n // Existing behavior: scrollOffset is logical lines. Let's keep that for predictable scrolling.\r\n linesToSkip--;\r\n startIndex--;\r\n }\r\n\r\n // 3. Collect lines that fit in maxVisibleLines\r\n for (let i = startIndex; i >= 0; i--) {\r\n const lineRows = visualLinesMap[i];\r\n\r\n // If adding this line exceeds max height, we stop\r\n // Exception: Always show at least one line if it's the only one\r\n if (currentHeight + lineRows > maxVisibleLines && visibleLinesToRender.length > 0) {\r\n break;\r\n }\r\n\r\n visibleLinesToRender.unshift(lines[i]);\r\n currentHeight += lineRows;\r\n }\r\n\r\n return visibleLinesToRender.join('\\n');\r\n };\r\n\r\n // Reset scroll offset when exiting focus mode\r\n useEffect(() => {\r\n if (!isFocused) {\r\n setScrollOffset(0);\r\n isAutoFollowRef.current = true;\r\n }\r\n }, [isFocused]);\r\n\r\n // Track previous total lines to adjust scroll offset when new output arrives\r\n const prevTotalLinesRef = useRef(0);\r\n\r\n // When new output comes in and user is scrolled up, adjust offset to maintain position\r\n useEffect(() => {\r\n // const { total } = getProcessedOutput(); // Replaced by useMemo\r\n const prevTotal = prevTotalLinesRef.current;\r\n\r\n if (prevTotal > 0 && total > prevTotal && !isAutoFollowRef.current && scrollOffset > 0) {\r\n // New lines were added while user is scrolled up\r\n // Increase scroll offset by the number of new lines to stay at the same position\r\n const newLines = total - prevTotal;\r\n const maxOffset = Math.max(0, total - maxVisibleLines);\r\n setScrollOffset(prev => Math.min(prev + newLines, maxOffset));\r\n }\r\n\r\n prevTotalLinesRef.current = total;\r\n }, [output, maxVisibleLines, total]);\r\n\r\n // Handle input - PTY mode sends everything immediately\r\n useInput((input, key) => {\r\n if (!isFocused) return;\r\n\r\n // Alt+E: Warpify session - detect and attach to remote session\r\n // Mac: Cmd+E (key.meta) OR Ctrl+E (fallback if Cmd intercepted)\r\n // Win: Alt+E (key.meta)\r\n // Note: Ctrl+E might come in as input='\\u0005' (ASCII 5) rather than key.ctrl+e\r\n const isCtrlE = (key.ctrl && input.toLowerCase() === 'e') || input === '\\u0005';\r\n if ((key.meta && input.toLowerCase() === 'e') || isCtrlE) {\r\n if (onWarpifySession) {\r\n onWarpifySession();\r\n }\r\n return;\r\n }\r\n\r\n // Alt+I: Toggle agent control mode\r\n // Mac: Cmd+I (key.meta)\r\n if (key.meta && input.toLowerCase() === 'i') {\r\n if (onToggleAgentControl) {\r\n onToggleAgentControl();\r\n }\r\n return;\r\n }\r\n\r\n // Global: Ctrl+F to exit focus mode\r\n // BUT: Block if agent controlled AND still running\r\n if (key.ctrl && input === 'f') {\r\n if (isAgentControlled && isRunning) {\r\n // Blocked - can't exit focus while agent controlled and running\r\n // User must first disable agent control with Alt+I or wait for completion\r\n return;\r\n }\r\n onFocusChange(false);\r\n return;\r\n }\r\n\r\n // Scroll controls (only in focus mode, don't send to PTY)\r\n // Shift+Up: Scroll up one line\r\n if (key.shift && key.upArrow) {\r\n const maxOffset = Math.max(0, totalLinesRef.current - maxVisibleLines);\r\n if (scrollOffset < maxOffset) {\r\n isAutoFollowRef.current = false;\r\n setScrollOffset(prev => Math.min(prev + 1, maxOffset));\r\n }\r\n return;\r\n }\r\n\r\n // Shift+Down: Scroll down one line\r\n if (key.shift && key.downArrow) {\r\n if (scrollOffset > 0) {\r\n setScrollOffset(prev => {\r\n const newOffset = Math.max(prev - 1, 0);\r\n if (newOffset === 0) {\r\n isAutoFollowRef.current = true;\r\n }\r\n return newOffset;\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Page Up: Scroll up one page\r\n if (key.pageUp) {\r\n const maxOffset = Math.max(0, totalLinesRef.current - maxVisibleLines);\r\n if (scrollOffset < maxOffset) {\r\n isAutoFollowRef.current = false;\r\n setScrollOffset(prev => Math.min(prev + maxVisibleLines, maxOffset));\r\n }\r\n return;\r\n }\r\n\r\n // Page Down: Scroll down one page\r\n if (key.pageDown) {\r\n if (scrollOffset > 0) {\r\n setScrollOffset(prev => {\r\n const newOffset = Math.max(prev - maxVisibleLines, 0);\r\n if (newOffset === 0) {\r\n isAutoFollowRef.current = true;\r\n }\r\n return newOffset;\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Below this point, we need onInput to send to PTY\r\n if (!onInput) return;\r\n\r\n // Ctrl+C - send to PTY AND signal backend for forceful termination\r\n if (key.ctrl && input === 'c') {\r\n onInput('\\x03');\r\n if (onSignal) {\r\n onSignal('SIGINT');\r\n }\r\n return;\r\n }\r\n\r\n // Ctrl+D - EOF\r\n if (key.ctrl && input === 'd') {\r\n onInput('\\x04');\r\n return;\r\n }\r\n\r\n // Ctrl+Z - Suspend\r\n if (key.ctrl && input === 'z') {\r\n onInput('\\x1A');\r\n return;\r\n }\r\n\r\n // Encode and send all keys immediately\r\n const encoded = encodeKeyToAnsi(input, key);\r\n if (encoded) {\r\n onInput(encoded);\r\n }\r\n }, { isActive: isFocused });\r\n\r\n // Determine border color and icon based on status\r\n const getBorderColor = () => {\r\n if (isRunning) return '#00ccff';\r\n if (error || (exitCode !== undefined && exitCode !== 0)) return '#ff3366';\r\n return '#00cc66';\r\n };\r\n\r\n const getStatusIcon = () => {\r\n if (isRunning) return <Spinner type=\"dots\" />;\r\n if (error || (exitCode !== undefined && exitCode !== 0)) return '✗';\r\n return '✓';\r\n };\r\n\r\n const color = getBorderColor();\r\n const visibleOutput = getVisibleOutput();\r\n // Strip ANSI codes then sanitize problematic Unicode (emojis, wide chars)\r\n // to prevent layout issues caused by character width mismatches\r\n const cleanOutput = sanitizeUnicode(visibleOutput);\r\n const truncatedCommand = truncateCommand(command, 80);\r\n\r\n // SAFEGUARD: Check for critically small dimensions that crash Yoga WASM\r\n // Yoga can crash with \"memory access out of bounds\" if containers have negative computed size\r\n // affecting Ink's Box rendering.\r\n const currentCols = process.stdout.columns || 80;\r\n const currentRows = process.stdout.rows || 24;\r\n const SAFE_MIN_WIDTH = 15;\r\n const SAFE_MIN_HEIGHT = 5;\r\n\r\n if (currentCols < SAFE_MIN_WIDTH || currentRows < SAFE_MIN_HEIGHT) {\r\n return (\r\n <Box flexDirection=\"column\" padding={1}>\r\n <Text color=\"yellow\">Terminal too small</Text>\r\n <Text dimColor>{currentCols}x{currentRows}</Text>\r\n </Box>\r\n );\r\n }\r\n\r\n return (\r\n <Box flexDirection=\"column\" marginBottom={1}>\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={color} paddingX={1}>\r\n {/* Header */}\r\n <Box marginBottom={1}>\r\n <Text color={color} bold>\r\n {getStatusIcon()} Shell\r\n </Text>\r\n <Text color=\"#666666\"> {truncatedCommand} </Text>\r\n <Text color=\"#666666\" dimColor>[current working directory {formatCwdWithContext(cwd, remoteContext)}]</Text>\r\n </Box>\r\n\r\n {/* Output area */}\r\n {/* Output area */}\r\n {cleanOutput && (\r\n <Box height={maxVisibleLines} overflow=\"hidden\">\r\n <Text wrap=\"wrap\">{cleanOutput}</Text>\r\n </Box>\r\n )}\r\n\r\n {/* Focus mode indicator */}\r\n {isFocused && isRunning && (\r\n <Box marginTop={1} flexDirection=\"column\">\r\n <Box>\r\n {isAgentControlled ? (\r\n <>\r\n <Text color=\"#9945FF\" bold>[ AGENT CONTROL ] </Text>\r\n <Text color=\"#666666\">\r\n {isMac ? 'Cmd+I' : 'Alt+I'} to disable | Shift+↑↓ scroll | PgUp/PgDn page\r\n </Text>\r\n </>\r\n ) : (\r\n <>\r\n <Text color=\"#ffaa00\" bold>[ FOCUS MODE ] </Text>\r\n <Text color=\"#666666\">\r\n Ctrl+F exit {onWarpifySession ? `| ${isMac ? 'Cmd+E / Ctrl+E' : 'Alt+E'} warpify ` : ''}| {isMac ? 'Cmd+I' : 'Alt+I'} agent | Shift+↑↓ scroll\r\n </Text>\r\n </>\r\n )}\r\n </Box>\r\n {scrollOffset > 0 && (\r\n <Box>\r\n <Text color=\"#666666\" dimColor>\r\n ↑ Scrolled {scrollOffset} line{scrollOffset > 1 ? 's' : ''} from bottom (viewing history)\r\n </Text>\r\n </Box>\r\n )}\r\n </Box>\r\n )}\r\n\r\n {/* Error display */}\r\n {error && !isRunning && (\r\n <Box marginTop={1}>\r\n <Text color=\"#ff3366\" wrap=\"wrap\">{error.replace(/\\r/g, '')}</Text>\r\n </Box>\r\n )}\r\n </Box>\r\n {isRunning && !isFocused && (\r\n <Box marginLeft={1}>\r\n <Text color=\"#666666\" dimColor>ctrl + f to focus</Text>\r\n </Box>\r\n )}\r\n </Box>\r\n );\r\n});\r\n"],"mappings":"AAAA,OAAO,SAAS,WAAW,UAAU,cAAc;AACnD,SAAS,KAAK,MAAM,gBAAgB;AACpC,OAAO,aAAa;AACpB,OAAO,eAAe;AACtB,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAgC,iCAAiC;AACjE,SAAS,uBAAuB;AAgChC,SAAS,qBAAqB,KAAa,eAAgC;AACzE,MAAI,iBAAiB,KAAK;AACxB,WAAO,GAAG,aAAa,IAAI,IAAI,QAAQ,OAAO,GAAG,CAAC;AAAA,EACpD;AACA,SAAO;AACT;AAQA,SAAS,gBAAgB,SAAiB,Y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-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
React.createElement(Text, { color: "#666666", dimColor: true }, "Press ? or ESC to close"))));
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
const KeyboardHelp = ({ onClose }) => {
|
|
4
|
+
useInput((input, key) => {
|
|
5
|
+
if (key.escape || input === "?") {
|
|
6
|
+
onClose();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const isMac = process.platform === "darwin";
|
|
10
|
+
const metaKey = isMac ? "Cmd" : "Alt";
|
|
11
|
+
const altKey = isMac ? "Option" : "Alt";
|
|
12
|
+
const shortcuts = [
|
|
13
|
+
{ key: "Enter", action: "Submit message" },
|
|
14
|
+
{ key: `${altKey}+Enter`, action: "Insert newline (Shift+Enter remap)" },
|
|
15
|
+
{ key: "Ctrl+Enter", action: "Insert newline" },
|
|
16
|
+
{ key: "\\ + Enter", action: "Insert newline fallback" },
|
|
17
|
+
{ key: "Ctrl+D", action: "Toggle command mode" },
|
|
18
|
+
{ key: "Tab", action: "Autocomplete" },
|
|
19
|
+
{ key: "Ctrl+T", action: "Toggle auto-accept" },
|
|
20
|
+
{ key: "Ctrl+C", action: "Cancel / Exit" },
|
|
21
|
+
{ key: `${metaKey}+Z`, action: "Undo" },
|
|
22
|
+
// undo
|
|
23
|
+
{ key: isMac ? "Cmd/Ctrl+E" : "Alt+E", action: "Warpify (Interactive)" },
|
|
24
|
+
{ key: `${isMac ? "Cmd" : "Ctrl"}+Left`, action: "Home / Word Back" },
|
|
25
|
+
// Simplified
|
|
26
|
+
{ key: `${metaKey}+V`, action: "Paste File / Image" },
|
|
27
|
+
{ key: `${metaKey}+X`, action: "Remove Last File" },
|
|
28
|
+
{ key: "/", action: "Slash command" },
|
|
29
|
+
{ key: "?", action: "Show help" }
|
|
30
|
+
];
|
|
31
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "double", borderColor: "#00ccff", paddingX: 1, marginY: 1 }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Keyboard Shortcuts")), shortcuts.map((s, idx) => /* @__PURE__ */ React.createElement(Box, { key: idx, marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, s.key.padEnd(15)), /* @__PURE__ */ React.createElement(Text, { color: "#ffffff" }, s.action))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "Press ? or ESC to close")));
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
KeyboardHelp
|
|
36
35
|
};
|
|
37
36
|
//# sourceMappingURL=KeyboardHelp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/KeyboardHelp.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text, useInput } from 'ink';\r\n\r\ninterface KeyboardHelpProps {\r\n onClose: () => void;\r\n}\r\n\r\nexport const KeyboardHelp: React.FC<KeyboardHelpProps> = ({ onClose }) => {\r\n useInput((input, key) => {\r\n if (key.escape || input === '?') {\r\n onClose();\r\n }\r\n });\r\n\r\n const isMac = process.platform === 'darwin';\r\n const metaKey = isMac ? 'Cmd' : 'Alt';\r\n const altKey = isMac ? 'Option' : 'Alt';\r\n\r\n // Note: Some shortcuts like Ctrl+C are standard across terminals including Mac (Ctrl+C, not Cmd+C)\r\n // But navigation/editing often uses Cmd on Mac.\r\n\r\n const shortcuts = [\r\n { key: 'Enter', action: 'Submit message' },\r\n { key: `${altKey}+Enter`, action: 'Insert newline (Shift+Enter remap)' },\r\n { key: 'Ctrl+Enter', action: 'Insert newline' },\r\n { key: '\\\\ + Enter', action: 'Insert newline fallback' },\r\n { key: 'Ctrl+D', action: 'Toggle command mode' },\r\n { key: 'Tab', action: 'Autocomplete' },\r\n { key: 'Ctrl+T', action: 'Toggle auto-accept' },\r\n { key: 'Ctrl+C', action: 'Cancel / Exit' },\r\n { key: `${metaKey}+Z`, action: 'Undo' }, // undo\r\n { key: isMac ? 'Cmd/Ctrl+E' : 'Alt+E', action: 'Warpify (Interactive)' },\r\n { key: `${isMac ? 'Cmd' : 'Ctrl'}+Left`, action: 'Home / Word Back' }, // Simplified\r\n { key: `${metaKey}+V`, action: 'Paste File / Image' },\r\n { key: `${metaKey}+X`, action: 'Remove Last File' },\r\n { key: '/', action: 'Slash command' },\r\n { key: '?', action: 'Show help' }\r\n ];\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"double\" borderColor=\"#00ccff\" paddingX={1} marginY={1}>\r\n <Box marginBottom={1}>\r\n <Text color=\"#00ccff\" bold>Keyboard Shortcuts</Text>\r\n </Box>\r\n\r\n {shortcuts.map((s, idx) => (\r\n <Box key={idx} marginBottom={1}>\r\n <Text color=\"#00cc66\" bold>{s.key.padEnd(15)}</Text>\r\n <Text color=\"#ffffff\">{s.action}</Text>\r\n </Box>\r\n ))}\r\n\r\n <Box marginTop={1}>\r\n <Text color=\"#666666\" dimColor>\r\n Press ? or ESC to close\r\n </Text>\r\n </Box>\r\n </Box>\r\n );\r\n};\r\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,MAAM,gBAAgB;AAM7B,MAAM,eAA4C,CAAC,EAAE,QAAQ,MAAM;AACxE,WAAS,CAAC,OAAO,QAAQ;AACvB,QAAI,IAAI,UAAU,UAAU,KAAK;AAC/B,cAAQ;AAAA,IACV;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,QAAQ,aAAa;AACnC,QAAM,UAAU,QAAQ,QAAQ;AAChC,QAAM,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AK,OAAM,WAAU,UAAQ,QAAC,yBAE/B,CACF,CACF;AAEJ;","names":[]}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
import Spinner from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import Spinner from "ink-spinner";
|
|
4
|
+
import { ShimmerText } from "./ShimmerText.js";
|
|
4
5
|
const LOADING_MESSAGES = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
"Thrusting",
|
|
7
|
+
"Propelling",
|
|
8
|
+
"Boosting",
|
|
9
|
+
"Launching",
|
|
10
|
+
"Intercepting",
|
|
11
|
+
"Slingshotting",
|
|
12
|
+
"Accelerating",
|
|
13
|
+
"Cruising",
|
|
14
|
+
"Warping",
|
|
15
|
+
"Docking"
|
|
15
16
|
];
|
|
16
|
-
const SPINNER_TYPES = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
25
|
-
" ",
|
|
26
|
-
LOADING_MESSAGES[messageIndex],
|
|
27
|
-
"...")));
|
|
17
|
+
const SPINNER_TYPES = ["dots", "dots2", "line", "star", "arc", "circle", "arrow", "bouncingBar", "bouncingBall", "earth", "moon"];
|
|
18
|
+
const LoadingIndicator = () => {
|
|
19
|
+
const messageIndex = React.useMemo(() => Math.floor(Math.random() * LOADING_MESSAGES.length), []);
|
|
20
|
+
const spinnerType = React.useMemo(() => SPINNER_TYPES[Math.floor(Math.random() * SPINNER_TYPES.length)], []);
|
|
21
|
+
return /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: spinnerType })), /* @__PURE__ */ React.createElement(Text, null, " "), /* @__PURE__ */ React.createElement(ShimmerText, { text: `${LOADING_MESSAGES[messageIndex]}...`, baseColor: "#00ccff", bold: true }));
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
LoadingIndicator
|
|
28
25
|
};
|
|
29
26
|
//# sourceMappingURL=LoadingIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/LoadingIndicator.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text } from 'ink';\r\nimport Spinner from 'ink-spinner';\r\nimport { ShimmerText } from './ShimmerText.js';\r\n\r\nconst LOADING_MESSAGES = [\r\n 'Thrusting',\r\n 'Propelling',\r\n 'Boosting',\r\n 'Launching',\r\n 'Intercepting',\r\n 'Slingshotting',\r\n 'Accelerating',\r\n 'Cruising',\r\n 'Warping',\r\n 'Docking'\r\n];\r\n\r\nconst SPINNER_TYPES = ['dots', 'dots2', 'line', 'star', 'arc', 'circle', 'arrow', 'bouncingBar', 'bouncingBall', 'earth', 'moon'] as const;\r\n\r\nexport const LoadingIndicator: React.FC = () => {\r\n // Use useMemo to pick random message and spinner only once, not on every render\r\n const messageIndex = React.useMemo(() => Math.floor(Math.random() * LOADING_MESSAGES.length), []);\r\n const spinnerType = React.useMemo(() => SPINNER_TYPES[Math.floor(Math.random() * SPINNER_TYPES.length)], []);\r\n\r\n return (\r\n <Box>\r\n <Text color=\"#00ccff\">\r\n <Spinner type={spinnerType} />\r\n </Text>\r\n <Text> </Text>\r\n <ShimmerText text={`${LOADING_MESSAGES[messageIndex]}...`} baseColor=\"#00ccff\" bold />\r\n </Box>\r\n );\r\n};\r\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,YAAY;AAC1B,OAAO,aAAa;AACpB,SAAS,mBAAmB;AAE5B,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,QAAQ,OAAO,UAAU,SAAS,eAAe,gBAAgB,SAAS,MAAM;AAEzH,MAAM,mBAA6B,MAAM;AAE9C,QAAM,eAAe,MAAM,QAAQ,MAAM,KAAK,MAAM,KAAK,OAAO,IAAI,iBAAiB,MAAM,GAAG,CAAC,CAAC;AAChG,QAAM,cAAc,MAAM,QAAQ,MAAM,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,cAAc,MAAM,CAAC,GAAG,CAAC,CAAC;AAE3G,SACE,oCAAC,WACC,oCAAC,QAAK,OAAM,aACV,oCAAC,WAAQ,MAAM,aAAa,CAC9B,GACA,oCAAC,YAAK,GAAC,GACP,oCAAC,eAAY,MAAM,GAAG,iBAAiB,YAAY,CAAC,OAAO,WAAU,WAAU,MAAI,MAAC,CACtF;AAEJ;","names":[]}
|
|
@@ -1,54 +1,43 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
import { MultiLineInput } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
const exampleConfig = `"chrome-devtools": {
|
|
29
|
-
"command": "npx",
|
|
30
|
-
"args": ["-y", "chrome-devtools-mcp@latest"]
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { MultiLineInput } from "./MultiLineInput.js";
|
|
4
|
+
const MCPAddScreen = ({ onAdd, onCancel, validateConfig }) => {
|
|
5
|
+
const [input, setInput] = React.useState("");
|
|
6
|
+
const [validationResult, setValidationResult] = React.useState(null);
|
|
7
|
+
const handleSubmit = () => {
|
|
8
|
+
if (!input.trim()) {
|
|
9
|
+
setValidationResult({ valid: false, error: "Please paste your MCP server configuration" });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const result = validateConfig(input.trim());
|
|
13
|
+
setValidationResult(result);
|
|
14
|
+
if (result.valid && result.config) {
|
|
15
|
+
onAdd(result.config);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const handleInputChange = (value) => {
|
|
19
|
+
setInput(value);
|
|
20
|
+
if (validationResult) {
|
|
21
|
+
setValidationResult(null);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const exampleConfig = `"chrome-devtools": {
|
|
25
|
+
"command": "npx",
|
|
26
|
+
"args": ["-y", "chrome-devtools-mcp@latest"]
|
|
31
27
|
}`;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
validationResult.config?.name,
|
|
47
|
-
"\"...")),
|
|
48
|
-
validationResult?.error && (React.createElement(Text, { color: "#ff6666" },
|
|
49
|
-
"Error: ",
|
|
50
|
-
validationResult.error))),
|
|
51
|
-
React.createElement(Box, { marginTop: 1 },
|
|
52
|
-
React.createElement(Text, { dimColor: true }, "[Enter] Add Server [ESC] Cancel"))));
|
|
28
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Add MCP Server"), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "gray" }, "Example format:")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, borderStyle: "round", borderColor: "gray", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#888888" }, exampleConfig)), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "gray" }, "Paste your MCP server config:")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, borderStyle: "round", borderColor: validationResult?.valid ? "#00cc66" : validationResult?.error ? "#ff6666" : "#555555", paddingX: 1 }, /* @__PURE__ */ React.createElement(
|
|
29
|
+
MultiLineInput,
|
|
30
|
+
{
|
|
31
|
+
value: input,
|
|
32
|
+
onChange: handleInputChange,
|
|
33
|
+
onSubmit: handleSubmit,
|
|
34
|
+
placeholder: '{"name": "...", "command": "...", "args": [...]}',
|
|
35
|
+
minHeight: 3,
|
|
36
|
+
maxHeight: 5
|
|
37
|
+
}
|
|
38
|
+
)), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, !validationResult && /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press Enter to add the server"), validationResult?.valid && /* @__PURE__ */ React.createElement(Text, { color: "#00cc66" }, 'Adding server "', validationResult.config?.name, '"...'), validationResult?.error && /* @__PURE__ */ React.createElement(Text, { color: "#ff6666" }, "Error: ", validationResult.error)), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "[Enter] Add Server [ESC] Cancel")));
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
MCPAddScreen
|
|
53
42
|
};
|
|
54
43
|
//# sourceMappingURL=MCPAddScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/MCPAddScreen.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text } from 'ink';\r\nimport { MultiLineInput } from './MultiLineInput.js';\r\n\r\ninterface MCPAddScreenProps {\r\n onAdd: (config: any) => void;\r\n onCancel: () => void;\r\n validateConfig: (jsonString: string) => { valid: boolean; config?: any; error?: string };\r\n}\r\n\r\nexport const MCPAddScreen: React.FC<MCPAddScreenProps> = ({ onAdd, onCancel, validateConfig }) => {\r\n const [input, setInput] = React.useState('');\r\n const [validationResult, setValidationResult] = React.useState<{ valid: boolean; config?: any; error?: string } | null>(null);\r\n // Note: ESC key handling is done in App.tsx\r\n\r\n const handleSubmit = () => {\r\n if (!input.trim()) {\r\n setValidationResult({ valid: false, error: 'Please paste your MCP server configuration' });\r\n return;\r\n }\r\n\r\n // Validate and add immediately on first Enter\r\n const result = validateConfig(input.trim());\r\n setValidationResult(result);\r\n\r\n if (result.valid && result.config) {\r\n // Add the server immediately\r\n onAdd(result.config);\r\n }\r\n };\r\n\r\n const handleInputChange = (value: string) => {\r\n setInput(value);\r\n // Reset validation when input changes\r\n if (validationResult) {\r\n setValidationResult(null);\r\n }\r\n };\r\n\r\n const exampleConfig = `\"chrome-devtools\": {\r\n \"command\": \"npx\",\r\n \"args\": [\"-y\", \"chrome-devtools-mcp@latest\"]\r\n}`;\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor=\"#00ccff\" paddingX={1}>\r\n <Text color=\"#00ccff\" bold>Add MCP Server</Text>\r\n\r\n <Box marginTop={1}>\r\n <Text color=\"gray\">Example format:</Text>\r\n </Box>\r\n\r\n <Box marginTop={1} borderStyle=\"round\" borderColor=\"gray\" paddingX={1}>\r\n <Text color=\"#888888\">{exampleConfig}</Text>\r\n </Box>\r\n\r\n <Box marginTop={1}>\r\n <Text color=\"gray\">Paste your MCP server config:</Text>\r\n </Box>\r\n\r\n <Box marginTop={1} borderStyle=\"round\" borderColor={validationResult?.valid ? '#00cc66' : (validationResult?.error ? '#ff6666' : '#555555')} paddingX={1}>\r\n <MultiLineInput\r\n value={input}\r\n onChange={handleInputChange}\r\n onSubmit={handleSubmit}\r\n placeholder='{\"name\": \"...\", \"command\": \"...\", \"args\": [...]}'\r\n minHeight={3}\r\n maxHeight={5}\r\n />\r\n </Box>\r\n\r\n {/* Validation result */}\r\n <Box marginTop={1}>\r\n {!validationResult && (\r\n <Text dimColor>Press Enter to add the server</Text>\r\n )}\r\n {validationResult?.valid && (\r\n <Text color=\"#00cc66\">Adding server \"{validationResult.config?.name}\"...</Text>\r\n )}\r\n {validationResult?.error && (\r\n <Text color=\"#ff6666\">Error: {validationResult.error}</Text>\r\n )}\r\n </Box>\r\n\r\n <Box marginTop={1}>\r\n <Text dimColor>[Enter] Add Server [ESC] Cancel</Text>\r\n </Box>\r\n </Box>\r\n );\r\n};\r\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,YAAY;AAC1B,SAAS,sBAAsB;AAQxB,MAAM,eAA4C,CAAC,EAAE,OAAO,UAAU,eAAe,MAAM;AAC9F,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAS,EAAE;AAC3C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,MAAM,SAAkE,IAAI;AAG5H,QAAM,eAAe,MAAM;AACvB,QAAI,CAAC,MAAM,KAAK,GAAG;AACf,0BAAoB,EAAE,OAAO,OAAO,OAAO,6CAA6C,CAAC;AACzF;AAAA,IACJ;AAGA,UAAM,SAAS,eAAe,MAAM,KAAK,CAAC;AAC1C,wBAAoB,MAAM;AAE1B,QAAI,OAAO,SAAS,OAAO,QAAQ;AAE/B,YAAM,OAAO,MAAM;AAAA,IACvB;AAAA,EACJ;AAEA,QAAM,oBAAoB,CAAC,UAAkB;AACzC,aAAS,KAAK;AAEd,QAAI,kBAAkB;AAClB,0BAAoB,IAAI;AAAA,IAC5B;AAAA,EACJ;AAEA,QAAM,gBAAgB;AAAA;AAAA;AAAA;AAKtB,SACI,oCAAC,OAAI,eAAc,UAAS,aAAY,SAAQ,aAAY,WAAU,UAAU,KAC5E,oCAAC,QAAK,OAAM,WAAU,MAAI,QAAC,gBAAc,GAEzC,oCAAC,OAAI,WAAW,KACZ,oCAAC,QAAK,OAAM,UAAO,iB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
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
getStatusIcon(server),
|
|
42
|
-
" ",
|
|
43
|
-
React.createElement(Text, { bold: true }, server.name),
|
|
44
|
-
" - ",
|
|
45
|
-
React.createElement(Text, { color: server.enabled ? 'green' : 'yellow' }, getStatusText(server)))),
|
|
46
|
-
renderToolsBox(server.tools))))),
|
|
47
|
-
React.createElement(Box, { marginTop: 1 },
|
|
48
|
-
React.createElement(Text, { dimColor: true }, "Press ESC to return to chat"))));
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
const MCPListScreen = ({ servers, onClose }) => {
|
|
4
|
+
const getStatusIcon = (server) => {
|
|
5
|
+
if (!server.enabled) return "\u23F8\uFE0F";
|
|
6
|
+
switch (server.status) {
|
|
7
|
+
case "connected":
|
|
8
|
+
return "\u2713";
|
|
9
|
+
case "error":
|
|
10
|
+
return "\u274C";
|
|
11
|
+
case "connecting":
|
|
12
|
+
return "\u26A0\uFE0F";
|
|
13
|
+
default:
|
|
14
|
+
return "\u26A0\uFE0F";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const getStatusText = (server) => {
|
|
18
|
+
if (!server.enabled) return "Disabled";
|
|
19
|
+
switch (server.status) {
|
|
20
|
+
case "connected":
|
|
21
|
+
return "Enabled";
|
|
22
|
+
case "error":
|
|
23
|
+
return "Error";
|
|
24
|
+
case "connecting":
|
|
25
|
+
return "Connecting";
|
|
26
|
+
default:
|
|
27
|
+
return "Unknown";
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const renderToolsBox = (tools) => {
|
|
31
|
+
if (tools.length === 0) {
|
|
32
|
+
return /* @__PURE__ */ React.createElement(Box, { borderStyle: "round", borderColor: "gray", paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "gray" }, "No tools available"));
|
|
33
|
+
}
|
|
34
|
+
const toolNames = tools.map((t) => t.name).join(" ");
|
|
35
|
+
return /* @__PURE__ */ React.createElement(Box, { borderStyle: "round", borderColor: "gray", paddingX: 1, marginTop: 1, flexWrap: "wrap" }, /* @__PURE__ */ React.createElement(Text, { color: "gray" }, toolNames));
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00aaff", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00aaff", bold: true }, "MCP Servers and Tools"), /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "View all configured MCP servers and their available tools"), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, servers.map((server, index) => /* @__PURE__ */ React.createElement(Box, { key: server.name, flexDirection: "column", marginBottom: index < servers.length - 1 ? 1 : 0 }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, null, getStatusIcon(server), " ", /* @__PURE__ */ React.createElement(Text, { bold: true }, server.name), " - ", /* @__PURE__ */ React.createElement(Text, { color: server.enabled ? "green" : "yellow" }, getStatusText(server)))), renderToolsBox(server.tools)))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Press ESC to return to chat")));
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
MCPListScreen
|
|
49
41
|
};
|
|
50
42
|
//# sourceMappingURL=MCPListScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/MCPListScreen.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text } from 'ink';\r\n\r\ninterface MCPTool {\r\n name: string;\r\n}\r\n\r\ninterface MCPServerInfo {\r\n name: string;\r\n enabled: boolean;\r\n status: 'connected' | 'disconnected' | 'error' | 'connecting';\r\n tools: MCPTool[];\r\n}\r\n\r\ninterface MCPListScreenProps {\r\n servers: MCPServerInfo[];\r\n onClose: () => void;\r\n}\r\n\r\nexport const MCPListScreen: React.FC<MCPListScreenProps> = ({ servers, onClose }) => {\r\n // Note: ESC key handling is done in App.tsx\r\n\r\n const getStatusIcon = (server: MCPServerInfo) => {\r\n if (!server.enabled) return '⏸️';\r\n switch (server.status) {\r\n case 'connected': return '✓';\r\n case 'error': return '❌';\r\n case 'connecting': return '⚠️';\r\n default: return '⚠️';\r\n }\r\n };\r\n\r\n const getStatusText = (server: MCPServerInfo) => {\r\n if (!server.enabled) return 'Disabled';\r\n switch (server.status) {\r\n case 'connected': return 'Enabled';\r\n case 'error': return 'Error';\r\n case 'connecting': return 'Connecting';\r\n default: return 'Unknown';\r\n }\r\n };\r\n\r\n const renderToolsBox = (tools: MCPTool[]) => {\r\n if (tools.length === 0) {\r\n return (\r\n <Box borderStyle=\"round\" borderColor=\"gray\" paddingX={1} marginTop={1}>\r\n <Text color=\"gray\">No tools available</Text>\r\n </Box>\r\n );\r\n }\r\n\r\n // Create a string with all tool names separated by spaces\r\n const toolNames = tools.map(t => t.name).join(' ');\r\n\r\n return (\r\n <Box borderStyle=\"round\" borderColor=\"gray\" paddingX={1} marginTop={1} flexWrap=\"wrap\">\r\n <Text color=\"gray\">{toolNames}</Text>\r\n </Box>\r\n );\r\n };\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor=\"#00aaff\" paddingX={1}>\r\n <Text color=\"#00aaff\" bold>MCP Servers and Tools</Text>\r\n <Text dimColor>View all configured MCP servers and their available tools</Text>\r\n\r\n <Box flexDirection=\"column\" marginTop={1}>\r\n {servers.map((server, index) => (\r\n <Box key={server.name} flexDirection=\"column\" marginBottom={index < servers.length - 1 ? 1 : 0}>\r\n <Box>\r\n <Text>\r\n {getStatusIcon(server)} <Text bold>{server.name}</Text> - <Text color={server.enabled ? 'green' : 'yellow'}>{getStatusText(server)}</Text>\r\n </Text>\r\n </Box>\r\n {renderToolsBox(server.tools)}\r\n </Box>\r\n ))}\r\n </Box>\r\n\r\n <Box marginTop={1}>\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