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,41 +1,80 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
import { formatFileSize } 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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { formatFileSize } from "../../services/clipboard-service.js";
|
|
4
|
+
const ClipboardFileAutocomplete = ({
|
|
5
|
+
files,
|
|
6
|
+
selectedIndex,
|
|
7
|
+
isLoading = false
|
|
8
|
+
}) => {
|
|
9
|
+
if (isLoading) {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(
|
|
11
|
+
Box,
|
|
12
|
+
{
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
borderStyle: "round",
|
|
15
|
+
borderColor: "#ff9900",
|
|
16
|
+
paddingX: 1,
|
|
17
|
+
marginLeft: 1,
|
|
18
|
+
marginTop: 0
|
|
19
|
+
},
|
|
20
|
+
/* @__PURE__ */ React.createElement(Box, { marginBottom: 0 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "Checking clipboard...")),
|
|
21
|
+
/* @__PURE__ */ React.createElement(Box, { paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, "\u23F3 Loading..."))
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
if (files.length === 0) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
Box,
|
|
27
|
+
{
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
borderStyle: "round",
|
|
30
|
+
borderColor: "#ff9900",
|
|
31
|
+
paddingX: 1,
|
|
32
|
+
marginLeft: 1,
|
|
33
|
+
marginTop: 0
|
|
34
|
+
},
|
|
35
|
+
/* @__PURE__ */ React.createElement(Box, { marginBottom: 0 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "Clipboard Files")),
|
|
36
|
+
/* @__PURE__ */ React.createElement(Box, { paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#888888" }, "No files in clipboard")),
|
|
37
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "Copy a file or image first"))
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ React.createElement(
|
|
41
|
+
Box,
|
|
42
|
+
{
|
|
43
|
+
flexDirection: "column",
|
|
44
|
+
borderStyle: "round",
|
|
45
|
+
borderColor: "#ff9900",
|
|
46
|
+
paddingX: 1,
|
|
47
|
+
marginLeft: 1,
|
|
48
|
+
marginTop: 0
|
|
49
|
+
},
|
|
50
|
+
/* @__PURE__ */ React.createElement(Box, { marginBottom: 0 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "Clipboard Files (# to attach)")),
|
|
51
|
+
files.map((file, index) => {
|
|
52
|
+
const isSelected = index === selectedIndex;
|
|
53
|
+
const icon = file.mimeType?.startsWith("image/") ? "\u{1F4CB}" : "\u{1F4C4}";
|
|
54
|
+
return /* @__PURE__ */ React.createElement(
|
|
55
|
+
Box,
|
|
56
|
+
{
|
|
57
|
+
key: file.id,
|
|
58
|
+
paddingX: 1
|
|
59
|
+
},
|
|
60
|
+
/* @__PURE__ */ React.createElement(
|
|
61
|
+
Text,
|
|
62
|
+
{
|
|
63
|
+
color: isSelected ? "#ff9900" : "#aaaaaa",
|
|
64
|
+
bold: isSelected,
|
|
65
|
+
inverse: isSelected
|
|
66
|
+
},
|
|
67
|
+
icon,
|
|
68
|
+
" ",
|
|
69
|
+
file.displayName
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " ", formatFileSize(file.sizeBytes))
|
|
72
|
+
);
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "\u2191\u2193 to select, Enter to attach"))
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
ClipboardFileAutocomplete
|
|
40
79
|
};
|
|
41
80
|
//# sourceMappingURL=ClipboardFileAutocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/ClipboardFileAutocomplete.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text } from 'ink';\r\nimport { formatFileSize, ClipboardFile } from '../../services/clipboard-service.js';\r\n\r\ninterface ClipboardFileAutocompleteProps {\r\n files: ClipboardFile[];\r\n selectedIndex: number;\r\n isLoading?: boolean;\r\n}\r\n\r\nexport const ClipboardFileAutocomplete: React.FC<ClipboardFileAutocompleteProps> = ({\r\n files,\r\n selectedIndex,\r\n isLoading = false\r\n}) => {\r\n // Show loading state\r\n if (isLoading) {\r\n return (\r\n <Box\r\n flexDirection=\"column\"\r\n borderStyle=\"round\"\r\n borderColor=\"#ff9900\"\r\n paddingX={1}\r\n marginLeft={1}\r\n marginTop={0}\r\n >\r\n <Box marginBottom={0}>\r\n <Text color=\"#666666\" dimColor>Checking clipboard...</Text>\r\n </Box>\r\n <Box paddingX={1}>\r\n <Text color=\"#ff9900\">⏳ Loading...</Text>\r\n </Box>\r\n </Box>\r\n );\r\n }\r\n\r\n // Show empty state\r\n if (files.length === 0) {\r\n return (\r\n <Box\r\n flexDirection=\"column\"\r\n borderStyle=\"round\"\r\n borderColor=\"#ff9900\"\r\n paddingX={1}\r\n marginLeft={1}\r\n marginTop={0}\r\n >\r\n <Box marginBottom={0}>\r\n <Text color=\"#666666\" dimColor>Clipboard Files</Text>\r\n </Box>\r\n <Box paddingX={1}>\r\n <Text color=\"#888888\">No files in clipboard</Text>\r\n </Box>\r\n <Box marginTop={0}>\r\n <Text color=\"#666666\" dimColor>Copy a file or image first</Text>\r\n </Box>\r\n </Box>\r\n );\r\n }\r\n\r\n return (\r\n <Box\r\n flexDirection=\"column\"\r\n borderStyle=\"round\"\r\n borderColor=\"#ff9900\"\r\n paddingX={1}\r\n marginLeft={1}\r\n marginTop={0}\r\n >\r\n <Box marginBottom={0}>\r\n <Text color=\"#666666\" dimColor>Clipboard Files (# to attach)</Text>\r\n </Box>\r\n {files.map((file, index) => {\r\n const isSelected = index === selectedIndex;\r\n const icon = file.mimeType?.startsWith('image/') ? '📋' : '📄';\r\n\r\n return (\r\n <Box\r\n key={file.id}\r\n paddingX={1}\r\n >\r\n <Text\r\n color={isSelected ? '#ff9900' : '#aaaaaa'}\r\n bold={isSelected}\r\n inverse={isSelected}\r\n >\r\n {icon} {file.displayName}\r\n </Text>\r\n <Text color=\"#666666\"> {formatFileSize(file.sizeBytes)}</Text>\r\n </Box>\r\n );\r\n })}\r\n <Box marginTop={0}>\r\n <Text color=\"#666666\" dimColor>↑↓ to select, Enter to attach</Text>\r\n </Box>\r\n </Box>\r\n );\r\n};\r\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,YAAY;AAC1B,SAAS,sBAAqC;AAQvC,MAAM,4BAAsE,CAAC;AAAA,EAChF;AAAA,EACA;AAAA,EACA,YAAY;AAChB,MAAM;AAEF,MAAI,WAAW;AACX,WACI;AAAA,MAAC;AAAA;AAAA,QACG,eAAc;AAAA,QACd,aAAY;AAAA,QACZ,aAAY;AAAA,QACZ,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,WAAW;AAAA;AAAA,MAEX,oCAAC,OAAI,cAAc,KACf,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,uBAAqB,CACxD;AAAA,MACA,oCAAC,OAAI,UAAU,KACX,oCAAC,QAAK,OAAM,aAAU,mBAAY,CACtC;AAAA,IACJ;AAAA,EAER;AAGA,MAAI,MAAM,WAAW,GAAG;AACpB,WACI;AAAA,MAAC;AAAA;AAAA,QACG,eAAc;AAAA,QACd,aAAY;AAAA,QACZ,aAAY;AAAA,QACZ,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,WAAW;AAAA;AAAA,MAEX,oCAAC,OAAI,cAAc,KACf,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,iBAAe,CAClD;AAAA,MACA,oCAAC,OAAI,UAAU,KACX,oCAAC,QAAK,OAAM,aAAU,uBAAqB,CAC/C;AAAA,MACA,oCAAC,OAAI,WAAW,KACZ,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,4BAA0B,CAC7D;AAAA,IACJ;AAAA,EAER;AAEA,SACI;AAAA,IAAC;AAAA;AAAA,MACG,eAAc;AAAA,MACd,aAAY;AAAA,MACZ,aAAY;AAAA,MACZ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,WAAW;AAAA;AAAA,IAEX,oCAAC,OAAI,cAAc,KACf,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,+BAA6B,CAChE;AAAA,IACC,MAAM,IAAI,CAAC,MAAM,UAAU;AACxB,YAAM,aAAa,UAAU;AAC7B,YAAM,OAAO,KAAK,UAAU,WAAW,QAAQ,IAAI,cAAO;AAE1D,aACI;AAAA,QAAC;AAAA;AAAA,UACG,KAAK,KAAK;AAAA,UACV,UAAU;AAAA;AAAA,QAEV;AAAA,UAAC;AAAA;AAAA,YACG,OAAO,aAAa,YAAY;AAAA,YAChC,MAAM;AAAA,YACN,SAAS;AAAA;AAAA,UAER;AAAA,UAAK;AAAA,UAAE,KAAK;AAAA,QACjB;AAAA,QACA,oCAAC,QAAK,OAAM,aAAU,MAAG,eAAe,KAAK,SAAS,CAAE;AAAA,MAC5D;AAAA,IAER,CAAC;AAAA,IACD,oCAAC,OAAI,WAAW,KACZ,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,yCAA6B,CAChE;AAAA,EACJ;AAER;","names":[]}
|
|
@@ -1,45 +1,27 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { Box, Text, useInput } from
|
|
3
|
-
// Maximum number of lines to show before truncating
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
4
3
|
const MAX_PREVIEW_LINES = 8;
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
25
|
-
"\uD83D\uDCC4 ",
|
|
26
|
-
title),
|
|
27
|
-
language && React.createElement(Text, { color: "#666666" },
|
|
28
|
-
" (",
|
|
29
|
-
language,
|
|
30
|
-
")")),
|
|
31
|
-
React.createElement(Text, { color: "#666666", dimColor: true }, showFull ? 'Press Ctrl+O to collapse' : 'Press Ctrl+O to expand'))),
|
|
32
|
-
displayLines.map((line, idx) => (React.createElement(Box, { key: idx },
|
|
33
|
-
React.createElement(Text, { color: "#666666" },
|
|
34
|
-
String(idx + 1).padStart(3, ' '),
|
|
35
|
-
" \u2502 "),
|
|
36
|
-
React.createElement(Text, { color: "#ffffff" }, line)))),
|
|
37
|
-
shouldTruncate && (React.createElement(Box, { marginTop: 1 },
|
|
38
|
-
React.createElement(Text, { color: "#00ccff", dimColor: true },
|
|
39
|
-
"... ",
|
|
40
|
-
hiddenLines,
|
|
41
|
-
" more ",
|
|
42
|
-
hiddenLines === 1 ? 'line' : 'lines',
|
|
43
|
-
" not shown ...")))));
|
|
4
|
+
const MAX_FULL_VIEW_LINES = 1e3;
|
|
5
|
+
const CodeBlock = React.memo(({
|
|
6
|
+
code,
|
|
7
|
+
language = "text",
|
|
8
|
+
title
|
|
9
|
+
}) => {
|
|
10
|
+
const [showFull, setShowFull] = useState(false);
|
|
11
|
+
useInput((input, key) => {
|
|
12
|
+
if (input === "o" && key.ctrl) {
|
|
13
|
+
setShowFull((prev) => !prev);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const lines = code.split("\n");
|
|
17
|
+
const totalLines = lines.length;
|
|
18
|
+
const limit = showFull ? MAX_FULL_VIEW_LINES : MAX_PREVIEW_LINES;
|
|
19
|
+
const shouldTruncate = totalLines > limit;
|
|
20
|
+
const displayLines = shouldTruncate ? lines.slice(0, limit) : lines;
|
|
21
|
+
const hiddenLines = shouldTruncate ? totalLines - limit : 0;
|
|
22
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, paddingY: 1 }, title && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1, justifyContent: "space-between" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "\u{1F4C4} ", title), language && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", language, ")")), /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, showFull ? "Press Ctrl+O to collapse" : "Press Ctrl+O to expand")), displayLines.map((line, idx) => /* @__PURE__ */ React.createElement(Box, { key: idx }, /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, String(idx + 1).padStart(3, " "), " \u2502 "), /* @__PURE__ */ React.createElement(Text, { color: "#ffffff" }, line))), shouldTruncate && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", dimColor: true }, "... ", hiddenLines, " more ", hiddenLines === 1 ? "line" : "lines", " not shown ...")));
|
|
44
23
|
});
|
|
24
|
+
export {
|
|
25
|
+
CodeBlock
|
|
26
|
+
};
|
|
45
27
|
//# sourceMappingURL=CodeBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/CodeBlock.tsx"],"sourcesContent":["import React, { useState } from 'react';\r\nimport { Box, Text, useInput } from 'ink';\r\n\r\ninterface CodeBlockProps {\r\n code: string;\r\n language?: string;\r\n title?: string;\r\n}\r\n\r\n// Maximum number of lines to show before truncating\r\nconst MAX_PREVIEW_LINES = 8;\r\n// Maximum number of lines to show in full view\r\nconst MAX_FULL_VIEW_LINES = 1000;\r\n\r\nexport const CodeBlock: React.FC<CodeBlockProps> = React.memo(({\r\n code,\r\n language = 'text',\r\n title\r\n}) => {\r\n const [showFull, setShowFull] = useState(false);\r\n\r\n useInput((input, key) => {\r\n if (input === 'o' && key.ctrl) {\r\n setShowFull(prev => !prev);\r\n }\r\n });\r\n\r\n const lines = code.split('\\n');\r\n\r\n // Determine if we need to truncate\r\n const totalLines = lines.length;\r\n const limit = showFull ? MAX_FULL_VIEW_LINES : MAX_PREVIEW_LINES;\r\n const shouldTruncate = totalLines > limit;\r\n const displayLines = shouldTruncate ? lines.slice(0, limit) : lines;\r\n const hiddenLines = shouldTruncate ? totalLines - limit : 0;\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor=\"#003b59\" paddingX={1} paddingY={1}>\r\n {title && (\r\n <Box marginBottom={1} justifyContent=\"space-between\">\r\n <Box>\r\n <Text color=\"#00ccff\" bold>📄 {title}</Text>\r\n {language && <Text color=\"#666666\"> ({language})</Text>}\r\n </Box>\r\n <Text color=\"#666666\" dimColor>\r\n {showFull ? 'Press Ctrl+O to collapse' : 'Press Ctrl+O to expand'}\r\n </Text>\r\n </Box>\r\n )}\r\n\r\n {displayLines.map((line, idx) => (\r\n <Box key={idx}>\r\n <Text color=\"#666666\">{String(idx + 1).padStart(3, ' ')} │ </Text>\r\n <Text color=\"#ffffff\">{line}</Text>\r\n </Box>\r\n ))}\r\n\r\n {/* Truncation notice */}\r\n {shouldTruncate && (\r\n <Box marginTop={1}>\r\n <Text color=\"#00ccff\" dimColor>\r\n ... {hiddenLines} more {hiddenLines === 1 ? 'line' : 'lines'} not shown ...\r\n </Text>\r\n </Box>\r\n )}\r\n </Box>\r\n );\r\n});\r\n"],"mappings":"AAAA,OAAO,SAAS,gBAAgB;AAChC,SAAS,KAAK,MAAM,gBAAgB;AASpC,MAAM,oBAAoB;AAE1B,MAAM,sBAAsB;AAErB,MAAM,YAAsC,MAAM,KAAK,CAAC;AAAA,EAC7D;AAAA,EACA,WAAW;AAAA,EACX;AACF,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,WAAS,CAAC,OAAO,QAAQ;AACvB,QAAI,UAAU,OAAO,IAAI,MAAM;AAC7B,kBAAY,UAAQ,CAAC,IAAI;AAAA,IAC3B;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,KAAK,MAAM,IAAI;AAG7B,QAAM,aAAa,MAAM;AACzB,QAAM,QAAQ,WAAW,sBAAsB;AAC/C,QAAM,iBAAiB,aAAa;AACpC,QAAM,eAAe,iBAAiB,MAAM,MAAM,GAAG,KAAK,IAAI;AAC9D,QAAM,cAAc,iBAAiB,aAAa,QAAQ;AAE1D,SACE,oCAAC,OAAI,eAAc,UAAS,aAAY,SAAQ,aAAY,WAAU,UAAU,GAAG,UAAU,KAC1F,SACC,oCAAC,OAAI,cAAc,GAAG,gBAAe,mBACnC,oCAAC,WACC,oCAAC,QAAK,OAAM,WAAU,MAAI,QAAC,cAAI,KAAM,GACpC,YAAY,oCAAC,QAAK,OAAM,aAAU,MAAG,UAAS,GAAC,CAClD,GACA,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAC3B,WAAW,6BAA6B,wBAC3C,CACF,GAGD,aAAa,IAAI,CAAC,MAAM,QACvB,oCAAC,OAAI,KAAK,OACR,oCAAC,QAAK,OAAM,aAAW,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,GAAG,GAAE,UAAG,GAC3D,oCAAC,QAAK,OAAM,aAAW,IAAK,CAC9B,CACD,GAGA,kBACC,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,QACxB,aAAY,UAAO,gBAAgB,IAAI,SAAS,SAAQ,gBAC/D,CACF,CAEJ;AAEJ,CAAC;","names":[]}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text, useInput } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
React.createElement(Text, { color: "#ffaa00" }, "API Key: "),
|
|
20
|
-
React.createElement(Text, { color: "#ffffff" }, apiKeyMasked)),
|
|
21
|
-
React.createElement(Box, { marginBottom: 1 },
|
|
22
|
-
React.createElement(Text, { color: "#ffaa00" }, "Auto-Accept: "),
|
|
23
|
-
React.createElement(Text, { color: autoAcceptMode ? '#00cc66' : '#ff3366' }, autoAcceptMode ? 'ON' : 'OFF')),
|
|
24
|
-
React.createElement(Box, { marginTop: 1 },
|
|
25
|
-
React.createElement(Text, { color: "#666666", dimColor: true }, "Press ESC or Q to close"))));
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
const ConfigViewer = ({
|
|
4
|
+
provider,
|
|
5
|
+
model,
|
|
6
|
+
apiKeyMasked,
|
|
7
|
+
autoAcceptMode,
|
|
8
|
+
onClose
|
|
9
|
+
}) => {
|
|
10
|
+
useInput((input, key) => {
|
|
11
|
+
if (key.escape || input === "q") {
|
|
12
|
+
onClose();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Current Configuration")), /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ffaa00" }, "Provider: "), /* @__PURE__ */ React.createElement(Text, { color: "#ffffff" }, provider)), /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ffaa00" }, "Model: "), /* @__PURE__ */ React.createElement(Text, { color: "#ffffff" }, model)), /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ffaa00" }, "API Key: "), /* @__PURE__ */ React.createElement(Text, { color: "#ffffff" }, apiKeyMasked)), /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ffaa00" }, "Auto-Accept: "), /* @__PURE__ */ React.createElement(Text, { color: autoAcceptMode ? "#00cc66" : "#ff3366" }, autoAcceptMode ? "ON" : "OFF")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#666666", dimColor: true }, "Press ESC or Q to close")));
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
ConfigViewer
|
|
26
19
|
};
|
|
27
20
|
//# sourceMappingURL=ConfigViewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/ConfigViewer.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text, useInput } from 'ink';\r\n\r\ninterface ConfigViewerProps {\r\n provider: string;\r\n model: string;\r\n apiKeyMasked: string;\r\n autoAcceptMode: boolean;\r\n onClose: () => void;\r\n}\r\n\r\nexport const ConfigViewer: React.FC<ConfigViewerProps> = ({ \r\n provider, \r\n model, \r\n apiKeyMasked, \r\n autoAcceptMode,\r\n onClose \r\n}) => {\r\n useInput((input, key) => {\r\n if (key.escape || input === 'q') {\r\n onClose();\r\n }\r\n });\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor=\"#00ccff\" paddingX={1} marginY={1}>\r\n <Box marginBottom={1}>\r\n <Text color=\"#00ccff\" bold>Current Configuration</Text>\r\n </Box>\r\n \r\n <Box marginBottom={1}>\r\n <Text color=\"#ffaa00\">Provider: </Text>\r\n <Text color=\"#ffffff\">{provider}</Text>\r\n </Box>\r\n \r\n <Box marginBottom={1}>\r\n <Text color=\"#ffaa00\">Model: </Text>\r\n <Text color=\"#ffffff\">{model}</Text>\r\n </Box>\r\n \r\n <Box marginBottom={1}>\r\n <Text color=\"#ffaa00\">API Key: </Text>\r\n <Text color=\"#ffffff\">{apiKeyMasked}</Text>\r\n </Box>\r\n \r\n <Box marginBottom={1}>\r\n <Text color=\"#ffaa00\">Auto-Accept: </Text>\r\n <Text color={autoAcceptMode ? '#00cc66' : '#ff3366'}>\r\n {autoAcceptMode ? 'ON' : 'OFF'}\r\n </Text>\r\n </Box>\r\n\r\n <Box marginTop={1}>\r\n <Text color=\"#666666\" dimColor>\r\n Press ESC or Q 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;AAU7B,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,WAAS,CAAC,OAAO,QAAQ;AACvB,QAAI,IAAI,UAAU,UAAU,KAAK;AAC/B,cAAQ;AAAA,IACV;AAAA,EACF,CAAC;AAED,SACE,oCAAC,OAAI,eAAc,UAAS,aAAY,SAAQ,aAAY,WAAU,UAAU,GAAG,SAAS,KAC1F,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAM,WAAU,MAAI,QAAC,uBAAqB,CAClD,GAEA,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAM,aAAU,YAAU,GAChC,oCAAC,QAAK,OAAM,aAAW,QAAS,CAClC,GAEA,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAM,aAAU,SAAO,GAC7B,oCAAC,QAAK,OAAM,aAAW,KAAM,CAC/B,GAEA,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAM,aAAU,WAAS,GAC/B,oCAAC,QAAK,OAAM,aAAW,YAAa,CACtC,GAEA,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAM,aAAU,eAAa,GACnC,oCAAC,QAAK,OAAO,iBAAiB,YAAY,aACvC,iBAAiB,OAAO,KAC3B,CACF,GAEA,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAM,WAAU,UAAQ,QAAC,yBAE/B,CACF,CACF;AAEJ;","names":[]}
|
|
@@ -1,74 +1,52 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { Box, Text, useInput } from
|
|
3
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: warningMessage ? "#ff6600" : "#ffaa00", paddingX: 1, paddingY: 1 },
|
|
49
|
-
warningMessage && (React.createElement(Box, { marginBottom: 1, borderStyle: "single", borderColor: "#ff3366", paddingX: 1 },
|
|
50
|
-
React.createElement(Text, { color: "#ff3366", bold: true },
|
|
51
|
-
"\u26A0\uFE0F ",
|
|
52
|
-
warningMessage))),
|
|
53
|
-
React.createElement(Box, { marginBottom: 1 },
|
|
54
|
-
React.createElement(Text, { color: "#ffaa00", bold: true }, message)),
|
|
55
|
-
React.createElement(Box, { flexDirection: "column" },
|
|
56
|
-
React.createElement(Box, null,
|
|
57
|
-
React.createElement(Text, { color: selected === 'yes' ? '#00cc66' : '#666666', bold: selected === 'yes' },
|
|
58
|
-
selected === 'yes' ? '> ' : ' ',
|
|
59
|
-
"1. Yes")),
|
|
60
|
-
React.createElement(Box, null,
|
|
61
|
-
React.createElement(Text, { color: selected === 'no' ? '#ff3366' : '#666666', bold: selected === 'no' },
|
|
62
|
-
selected === 'no' ? '> ' : ' ',
|
|
63
|
-
"2. No")),
|
|
64
|
-
showFeedbackOption && (React.createElement(Box, null,
|
|
65
|
-
React.createElement(Text, { color: selected === 'feedback' ? '#00ccff' : '#666666', bold: selected === 'feedback' },
|
|
66
|
-
selected === 'feedback' ? '> ' : ' ',
|
|
67
|
-
"3. Feedback"))))));
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
const ConfirmPrompt = React.memo(({
|
|
4
|
+
message,
|
|
5
|
+
onYes,
|
|
6
|
+
onNo,
|
|
7
|
+
onFeedback,
|
|
8
|
+
showFeedbackOption = false,
|
|
9
|
+
warningMessage
|
|
10
|
+
}) => {
|
|
11
|
+
const [selected, setSelected] = useState("yes");
|
|
12
|
+
useInput((input, key) => {
|
|
13
|
+
if (key.upArrow || key.downArrow) {
|
|
14
|
+
if (showFeedbackOption) {
|
|
15
|
+
setSelected((prev) => {
|
|
16
|
+
const options = ["yes", "no", "feedback"];
|
|
17
|
+
const currentIdx = options.indexOf(prev);
|
|
18
|
+
const nextIdx = key.upArrow ? (currentIdx - 1 + options.length) % options.length : (currentIdx + 1) % options.length;
|
|
19
|
+
return options[nextIdx];
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
setSelected((prev) => prev === "yes" ? "no" : "yes");
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (input === "y" || input === "Y") {
|
|
27
|
+
onYes();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (input === "n" || input === "N") {
|
|
31
|
+
onNo();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (showFeedbackOption && (input === "f" || input === "F") && onFeedback) {
|
|
35
|
+
onFeedback();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (key.return) {
|
|
39
|
+
if (selected === "yes") onYes();
|
|
40
|
+
else if (selected === "no") onNo();
|
|
41
|
+
else if (selected === "feedback" && onFeedback) onFeedback();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: warningMessage ? "#ff6600" : "#ffaa00", paddingX: 1, paddingY: 1 }, warningMessage && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1, borderStyle: "single", borderColor: "#ff3366", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366", bold: true }, "\u26A0\uFE0F ", warningMessage)), /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#ffaa00", bold: true }, message)), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: selected === "yes" ? "#00cc66" : "#666666", bold: selected === "yes" }, selected === "yes" ? "> " : " ", "1. Yes")), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: selected === "no" ? "#ff3366" : "#666666", bold: selected === "no" }, selected === "no" ? "> " : " ", "2. No")), showFeedbackOption && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: selected === "feedback" ? "#00ccff" : "#666666", bold: selected === "feedback" }, selected === "feedback" ? "> " : " ", "3. Feedback"))));
|
|
68
46
|
}, (prevProps, nextProps) => {
|
|
69
|
-
|
|
70
|
-
return prevProps.message === nextProps.message &&
|
|
71
|
-
prevProps.showFeedbackOption === nextProps.showFeedbackOption &&
|
|
72
|
-
prevProps.warningMessage === nextProps.warningMessage;
|
|
47
|
+
return prevProps.message === nextProps.message && prevProps.showFeedbackOption === nextProps.showFeedbackOption && prevProps.warningMessage === nextProps.warningMessage;
|
|
73
48
|
});
|
|
49
|
+
export {
|
|
50
|
+
ConfirmPrompt
|
|
51
|
+
};
|
|
74
52
|
//# sourceMappingURL=ConfirmPrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/ConfirmPrompt.tsx"],"sourcesContent":["import React, { useState } from 'react';\r\nimport { Box, Text, useInput } from 'ink';\r\n\r\ninterface ConfirmPromptProps {\r\n message: string;\r\n onYes: () => void;\r\n onNo: () => void;\r\n onFeedback?: () => void;\r\n showFeedbackOption?: boolean;\r\n /** Optional warning message to display above the prompt (shown in orange/red) */\r\n warningMessage?: string;\r\n}\r\n\r\nexport const ConfirmPrompt: React.FC<ConfirmPromptProps> = React.memo(({\r\n message,\r\n onYes,\r\n onNo,\r\n onFeedback,\r\n showFeedbackOption = false,\r\n warningMessage\r\n}) => {\r\n const [selected, setSelected] = useState<'yes' | 'no' | 'feedback'>('yes');\r\n\r\n useInput((input, key) => {\r\n if (key.upArrow || key.downArrow) {\r\n if (showFeedbackOption) {\r\n setSelected(prev => {\r\n const options: Array<'yes' | 'no' | 'feedback'> = ['yes', 'no', 'feedback'];\r\n const currentIdx = options.indexOf(prev);\r\n const nextIdx = key.upArrow\r\n ? (currentIdx - 1 + options.length) % options.length\r\n : (currentIdx + 1) % options.length;\r\n return options[nextIdx];\r\n });\r\n } else {\r\n setSelected(prev => prev === 'yes' ? 'no' : 'yes');\r\n }\r\n return;\r\n }\r\n\r\n // Y key for yes\r\n if (input === 'y' || input === 'Y') {\r\n onYes();\r\n return;\r\n }\r\n\r\n // N key for no\r\n if (input === 'n' || input === 'N') {\r\n onNo();\r\n return;\r\n }\r\n\r\n // F key for feedback\r\n if (showFeedbackOption && (input === 'f' || input === 'F') && onFeedback) {\r\n onFeedback();\r\n return;\r\n }\r\n\r\n // Enter key to confirm selection\r\n if (key.return) {\r\n if (selected === 'yes') onYes();\r\n else if (selected === 'no') onNo();\r\n else if (selected === 'feedback' && onFeedback) onFeedback();\r\n return;\r\n }\r\n });\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={warningMessage ? \"#ff6600\" : \"#ffaa00\"} paddingX={1} paddingY={1}>\r\n {/* Warning message if provided */}\r\n {warningMessage && (\r\n <Box marginBottom={1} borderStyle=\"single\" borderColor=\"#ff3366\" paddingX={1}>\r\n <Text color=\"#ff3366\" bold>⚠️ {warningMessage}</Text>\r\n </Box>\r\n )}\r\n <Box marginBottom={1}>\r\n <Text color=\"#ffaa00\" bold>{message}</Text>\r\n </Box>\r\n <Box flexDirection=\"column\">\r\n <Box>\r\n <Text color={selected === 'yes' ? '#00cc66' : '#666666'} bold={selected === 'yes'}>\r\n {selected === 'yes' ? '> ' : ' '}1. Yes\r\n </Text>\r\n </Box>\r\n <Box>\r\n <Text color={selected === 'no' ? '#ff3366' : '#666666'} bold={selected === 'no'}>\r\n {selected === 'no' ? '> ' : ' '}2. No\r\n </Text>\r\n </Box>\r\n {showFeedbackOption && (\r\n <Box>\r\n <Text color={selected === 'feedback' ? '#00ccff' : '#666666'} bold={selected === 'feedback'}>\r\n {selected === 'feedback' ? '> ' : ' '}3. Feedback\r\n </Text>\r\n </Box>\r\n )}\r\n </Box>\r\n </Box>\r\n );\r\n}, (prevProps, nextProps) => {\r\n // Only re-render if message or showFeedbackOption changes\r\n return prevProps.message === nextProps.message &&\r\n prevProps.showFeedbackOption === nextProps.showFeedbackOption &&\r\n prevProps.warningMessage === nextProps.warningMessage;\r\n});\r\n\r\n"],"mappings":"AAAA,OAAO,SAAS,gBAAgB;AAChC,SAAS,KAAK,MAAM,gBAAgB;AAY7B,MAAM,gBAA8C,MAAM,KAAK,CAAC;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB;AACF,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAoC,KAAK;AAEzE,WAAS,CAAC,OAAO,QAAQ;AACvB,QAAI,IAAI,WAAW,IAAI,WAAW;AAChC,UAAI,oBAAoB;AACtB,oBAAY,UAAQ;AAClB,gBAAM,UAA4C,CAAC,OAAO,MAAM,UAAU;AAC1E,gBAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,gBAAM,UAAU,IAAI,WACf,aAAa,IAAI,QAAQ,UAAU,QAAQ,UAC3C,aAAa,KAAK,QAAQ;AAC/B,iBAAO,QAAQ,OAAO;AAAA,QACxB,CAAC;AAAA,MACH,OAAO;AACL,oBAAY,UAAQ,SAAS,QAAQ,OAAO,KAAK;AAAA,MACnD;AACA;AAAA,IACF;AAGA,QAAI,UAAU,OAAO,UAAU,KAAK;AAClC,YAAM;AACN;AAAA,IACF;AAGA,QAAI,UAAU,OAAO,UAAU,KAAK;AAClC,WAAK;AACL;AAAA,IACF;AAGA,QAAI,uBAAuB,UAAU,OAAO,UAAU,QAAQ,YAAY;AACxE,iBAAW;AACX;AAAA,IACF;AAGA,QAAI,IAAI,QAAQ;AACd,UAAI,aAAa,MAAO,OAAM;AAAA,eACrB,aAAa,KAAM,MAAK;AAAA,eACxB,aAAa,cAAc,WAAY,YAAW;AAC3D;AAAA,IACF;AAAA,EACF,CAAC;AAED,SACE,oCAAC,OAAI,eAAc,UAAS,aAAY,SAAQ,aAAa,iBAAiB,YAAY,WAAW,UAAU,GAAG,UAAU,KAEzH,kBACC,oCAAC,OAAI,cAAc,GAAG,aAAY,UAAS,aAAY,WAAU,UAAU,KACzE,oCAAC,QAAK,OAAM,WAAU,MAAI,QAAC,iBAAI,cAAe,CAChD,GAEF,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAM,WAAU,MAAI,QAAE,OAAQ,CACtC,GACA,oCAAC,OAAI,eAAc,YACjB,oCAAC,WACC,oCAAC,QAAK,OAAO,aAAa,QAAQ,YAAY,WAAW,MAAM,aAAa,SACzE,aAAa,QAAQ,OAAO,MAAK,QACpC,CACF,GACA,oCAAC,WACC,oCAAC,QAAK,OAAO,aAAa,OAAO,YAAY,WAAW,MAAM,aAAa,QACxE,aAAa,OAAO,OAAO,MAAK,OACnC,CACF,GACC,sBACC,oCAAC,WACC,oCAAC,QAAK,OAAO,aAAa,aAAa,YAAY,WAAW,MAAM,aAAa,cAC9E,aAAa,aAAa,OAAO,MAAK,aACzC,CACF,CAEJ,CACF;AAEJ,GAAG,CAAC,WAAW,cAAc;AAE3B,SAAO,UAAU,YAAY,UAAU,WACrC,UAAU,uBAAuB,UAAU,sBAC3C,UAAU,mBAAmB,UAAU;AAC3C,CAAC;","names":[]}
|
|
@@ -1,87 +1,36 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
import Spinner from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
// CONNECTING state - shows spinner
|
|
18
|
-
if (status.status === 'connecting') {
|
|
19
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#9945FF", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" },
|
|
20
|
-
React.createElement(Box, null,
|
|
21
|
-
React.createElement(Text, { color: "#00ccff" },
|
|
22
|
-
React.createElement(Spinner, { type: "dots" })),
|
|
23
|
-
React.createElement(Text, { color: "#9945FF" },
|
|
24
|
-
" Tunnelling to ",
|
|
25
|
-
getTypeLabel(),
|
|
26
|
-
" environment..."))));
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import Spinner from "ink-spinner";
|
|
4
|
+
const ConnectionStatusMessage = React.memo(({ status }) => {
|
|
5
|
+
const getTypeLabel = () => {
|
|
6
|
+
switch (status.type) {
|
|
7
|
+
case "ssh":
|
|
8
|
+
return "ssh";
|
|
9
|
+
case "wsl":
|
|
10
|
+
return "WSL";
|
|
11
|
+
case "docker":
|
|
12
|
+
return "Docker";
|
|
13
|
+
default:
|
|
14
|
+
return status.type;
|
|
27
15
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"]")))));
|
|
43
|
-
}
|
|
44
|
-
// ERROR state
|
|
45
|
-
if (status.status === 'error') {
|
|
46
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" },
|
|
47
|
-
React.createElement(Box, null,
|
|
48
|
-
React.createElement(Text, { color: "#ff3366", bold: true }, "\u2717"),
|
|
49
|
-
React.createElement(Text, { color: "#ff3366" },
|
|
50
|
-
" Failed to connect to ",
|
|
51
|
-
getTypeLabel(),
|
|
52
|
-
" environment")),
|
|
53
|
-
status.error && (React.createElement(Box, { paddingLeft: 1, marginTop: 0 },
|
|
54
|
-
React.createElement(Text, { color: "#ff3366" },
|
|
55
|
-
status.error.slice(0, 300),
|
|
56
|
-
status.error.length > 300 ? '...' : '')))));
|
|
57
|
-
}
|
|
58
|
-
// DISCONNECTED state - shows disconnect notification
|
|
59
|
-
if (status.status === 'disconnected') {
|
|
60
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" },
|
|
61
|
-
React.createElement(Box, null,
|
|
62
|
-
React.createElement(Text, { color: "#ff9900", bold: true }, "\u2717"),
|
|
63
|
-
React.createElement(Text, { color: "#ff9900" },
|
|
64
|
-
" Disconnected from ",
|
|
65
|
-
getTypeLabel(),
|
|
66
|
-
" environment"),
|
|
67
|
-
status.connectionString && (React.createElement(Text, { color: "#666666" },
|
|
68
|
-
" [",
|
|
69
|
-
getTypeLabel(),
|
|
70
|
-
" ",
|
|
71
|
-
status.connectionString,
|
|
72
|
-
"]"))),
|
|
73
|
-
status.error && (React.createElement(Box, null,
|
|
74
|
-
React.createElement(Text, { color: "#ff9900" },
|
|
75
|
-
" ",
|
|
76
|
-
status.error.slice(0, 300),
|
|
77
|
-
status.error.length > 300 ? '...' : '')))));
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
16
|
+
};
|
|
17
|
+
if (status.status === "connecting") {
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#9945FF", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, /* @__PURE__ */ React.createElement(Spinner, { type: "dots" })), /* @__PURE__ */ React.createElement(Text, { color: "#9945FF" }, " Tunnelling to ", getTypeLabel(), " environment...")));
|
|
19
|
+
}
|
|
20
|
+
if (status.status === "connected") {
|
|
21
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#00cc66", bold: true }, "\u2713"), /* @__PURE__ */ React.createElement(Text, { color: "#00cc66" }, " Established Wormhole to ", getTypeLabel(), " environment"), status.connectionString && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " [", getTypeLabel(), " ", status.connectionString, "]")));
|
|
22
|
+
}
|
|
23
|
+
if (status.status === "error") {
|
|
24
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366", bold: true }, "\u2717"), /* @__PURE__ */ React.createElement(Text, { color: "#ff3366" }, " Failed to connect to ", getTypeLabel(), " environment")), status.error && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1, marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: "#ff3366" }, status.error.slice(0, 300), status.error.length > 300 ? "..." : "")));
|
|
25
|
+
}
|
|
26
|
+
if (status.status === "disconnected") {
|
|
27
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginBottom: 1, alignSelf: "flex-start" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff9900", bold: true }, "\u2717"), /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, " Disconnected from ", getTypeLabel(), " environment"), status.connectionString && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " [", getTypeLabel(), " ", status.connectionString, "]")), status.error && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ff9900" }, " ", status.error.slice(0, 300), status.error.length > 300 ? "..." : "")));
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
80
30
|
}, (prevProps, nextProps) => {
|
|
81
|
-
|
|
82
|
-
return prevProps.status.status === nextProps.status.status &&
|
|
83
|
-
prevProps.status.type === nextProps.status.type &&
|
|
84
|
-
prevProps.status.connectionString === nextProps.status.connectionString &&
|
|
85
|
-
prevProps.status.error === nextProps.status.error;
|
|
31
|
+
return prevProps.status.status === nextProps.status.status && prevProps.status.type === nextProps.status.type && prevProps.status.connectionString === nextProps.status.connectionString && prevProps.status.error === nextProps.status.error;
|
|
86
32
|
});
|
|
33
|
+
export {
|
|
34
|
+
ConnectionStatusMessage
|
|
35
|
+
};
|
|
87
36
|
//# sourceMappingURL=ConnectionStatusMessage.js.map
|