centaurus-cli 3.0.0 → 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 -5037
- 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 +1513 -973
- 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 +605 -537
- 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 -400
- 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 -3249
- 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 -511
- 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 -167
- 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,17 +1,24 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
const ToolResult = ({
|
|
4
|
+
toolName,
|
|
5
|
+
result,
|
|
6
|
+
success,
|
|
7
|
+
duration
|
|
8
|
+
}) => {
|
|
9
|
+
return /* @__PURE__ */ React.createElement(
|
|
10
|
+
Box,
|
|
11
|
+
{
|
|
12
|
+
flexDirection: "column",
|
|
13
|
+
borderStyle: "round",
|
|
14
|
+
borderColor: success ? "#00cc66" : "#ff3366",
|
|
15
|
+
paddingX: 1
|
|
16
|
+
},
|
|
17
|
+
/* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: success ? "#00cc66" : "#ff3366", bold: true }, success ? "\u2713" : "\u2717", " ", toolName), duration && /* @__PURE__ */ React.createElement(Text, { color: "#666666" }, " (", duration, "ms)")),
|
|
18
|
+
/* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#ffffff", wrap: "wrap" }, result))
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
ToolResult
|
|
16
23
|
};
|
|
17
24
|
//# sourceMappingURL=ToolResult.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/ToolResult.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text } from 'ink';\r\n\r\ninterface ToolResultProps {\r\n toolName: string;\r\n result: string;\r\n success: boolean;\r\n duration?: number;\r\n}\r\n\r\nexport const ToolResult: React.FC<ToolResultProps> = ({\r\n toolName,\r\n result,\r\n success,\r\n duration\r\n}) => {\r\n return (\r\n <Box\r\n flexDirection=\"column\"\r\n borderStyle=\"round\"\r\n borderColor={success ? '#00cc66' : '#ff3366'}\r\n paddingX={1}\r\n >\r\n <Box marginBottom={1}>\r\n <Text color={success ? '#00cc66' : '#ff3366'} bold>\r\n {success ? '✓' : '✗'} {toolName}\r\n </Text>\r\n {duration && (\r\n <Text color=\"#666666\"> ({duration}ms)</Text>\r\n )}\r\n </Box>\r\n\r\n <Box>\r\n <Text color=\"#ffffff\" wrap=\"wrap\">{result}</Text>\r\n </Box>\r\n </Box>\r\n );\r\n};\r\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,YAAY;AASnB,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,aAAY;AAAA,MACZ,aAAa,UAAU,YAAY;AAAA,MACnC,UAAU;AAAA;AAAA,IAEV,oCAAC,OAAI,cAAc,KACjB,oCAAC,QAAK,OAAO,UAAU,YAAY,WAAW,MAAI,QAC/C,UAAU,WAAM,UAAI,KAAE,QACzB,GACC,YACC,oCAAC,QAAK,OAAM,aAAU,MAAG,UAAS,KAAG,CAEzC;AAAA,IAEA,oCAAC,WACC,oCAAC,QAAK,OAAM,WAAU,MAAK,UAAQ,MAAO,CAC5C;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,123 +1,91 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from
|
|
2
|
-
import { Box, Text, useApp } from
|
|
3
|
-
import Spinner from
|
|
4
|
-
import { spawn } from
|
|
5
|
-
import { logInfo } from
|
|
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
|
-
|
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
+
import { Box, Text, useApp } from "ink";
|
|
3
|
+
import Spinner from "ink-spinner";
|
|
4
|
+
import { spawn } from "child_process";
|
|
5
|
+
import { logInfo } from "../../utils/logger.js";
|
|
6
|
+
const VersionUpdatePrompt = ({
|
|
7
|
+
currentVersion,
|
|
8
|
+
latestVersion,
|
|
9
|
+
onComplete
|
|
10
|
+
}) => {
|
|
11
|
+
const [status, setStatus] = useState("pending");
|
|
12
|
+
const [errorMessage, setErrorMessage] = useState("");
|
|
13
|
+
const hasStartedRef = useRef(false);
|
|
14
|
+
const { exit } = useApp();
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (hasStartedRef.current) return;
|
|
20
|
+
hasStartedRef.current = true;
|
|
21
|
+
const timer = setTimeout(() => {
|
|
22
|
+
setStatus("installing");
|
|
23
|
+
performUpdate();
|
|
24
|
+
}, 1500);
|
|
25
|
+
return () => clearTimeout(timer);
|
|
26
|
+
}, []);
|
|
27
|
+
const performUpdate = () => {
|
|
28
|
+
const isWindows = process.platform === "win32";
|
|
29
|
+
const npmCmd = isWindows ? "npm.cmd" : "npm";
|
|
30
|
+
const installProcess = spawn(
|
|
31
|
+
npmCmd,
|
|
32
|
+
["install", "-g", "centaurus-cli@latest"],
|
|
33
|
+
{
|
|
34
|
+
shell: true,
|
|
35
|
+
stdio: "pipe",
|
|
36
|
+
// Capture output for error handling
|
|
37
|
+
detached: false
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
let stderrOutput = "";
|
|
41
|
+
let stdoutOutput = "";
|
|
42
|
+
if (installProcess.stdout) {
|
|
43
|
+
installProcess.stdout.on("data", (data) => {
|
|
44
|
+
stdoutOutput += data.toString();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (installProcess.stderr) {
|
|
48
|
+
installProcess.stderr.on("data", (data) => {
|
|
49
|
+
stderrOutput += data.toString();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
installProcess.on("error", (err) => {
|
|
53
|
+
setStatus("error");
|
|
54
|
+
setErrorMessage(`Failed to start update: ${err.message}`);
|
|
55
|
+
});
|
|
56
|
+
installProcess.on("close", (code) => {
|
|
57
|
+
if (code === 0) {
|
|
58
|
+
setStatus("success");
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
restartCLI();
|
|
61
|
+
}, 1500);
|
|
62
|
+
} else {
|
|
63
|
+
setStatus("error");
|
|
64
|
+
let friendlyError = "Update failed. Please try manually: npm install -g centaurus-cli@latest";
|
|
65
|
+
if (stderrOutput.includes("EACCES") || stderrOutput.includes("permission")) {
|
|
66
|
+
friendlyError = "Permission denied. Try running with sudo (Linux/Mac) or as Administrator (Windows).";
|
|
67
|
+
} else if (stderrOutput.includes("ENOTFOUND") || stderrOutput.includes("network")) {
|
|
68
|
+
friendlyError = "Network error. Please check your internet connection and try again.";
|
|
69
|
+
} else if (stderrOutput.includes("ETIMEOUT")) {
|
|
70
|
+
friendlyError = "Connection timed out. Please check your internet connection and try again.";
|
|
42
71
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
setStatus('error');
|
|
62
|
-
// Parse common error messages for better user feedback
|
|
63
|
-
let friendlyError = 'Update failed. Please try manually: npm install -g centaurus-cli@latest';
|
|
64
|
-
if (stderrOutput.includes('EACCES') || stderrOutput.includes('permission')) {
|
|
65
|
-
friendlyError = 'Permission denied. Try running with sudo (Linux/Mac) or as Administrator (Windows).';
|
|
66
|
-
}
|
|
67
|
-
else if (stderrOutput.includes('ENOTFOUND') || stderrOutput.includes('network')) {
|
|
68
|
-
friendlyError = 'Network error. Please check your internet connection and try again.';
|
|
69
|
-
}
|
|
70
|
-
else if (stderrOutput.includes('ETIMEOUT')) {
|
|
71
|
-
friendlyError = 'Connection timed out. Please check your internet connection and try again.';
|
|
72
|
-
}
|
|
73
|
-
setErrorMessage(friendlyError);
|
|
74
|
-
// After showing error, continue to chat after a delay
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
onComplete();
|
|
77
|
-
}, 5000);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
const restartCLI = () => {
|
|
82
|
-
// Exit the Ink app first
|
|
83
|
-
exit();
|
|
84
|
-
// Clear screen and show success message
|
|
85
|
-
process.stdout.write('\x1b[2J\x1b[3J\x1b[H');
|
|
86
|
-
logInfo('Update complete! Centaurus has been updated to the latest version.');
|
|
87
|
-
logInfo('User should run "centaurus" to start the updated CLI.');
|
|
88
|
-
process.exit(0);
|
|
89
|
-
};
|
|
90
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, marginTop: 1 },
|
|
91
|
-
React.createElement(Box, { marginBottom: 1 },
|
|
92
|
-
React.createElement(Text, { color: "cyan", bold: true }, "\uD83D\uDE80 New Update Available!")),
|
|
93
|
-
React.createElement(Box, { marginBottom: 1 },
|
|
94
|
-
React.createElement(Text, null,
|
|
95
|
-
"Current: ",
|
|
96
|
-
React.createElement(Text, { color: "gray" }, currentVersion),
|
|
97
|
-
" \u2192 Latest: ",
|
|
98
|
-
React.createElement(Text, { color: "green", bold: true }, latestVersion))),
|
|
99
|
-
status === 'pending' && (React.createElement(Box, null,
|
|
100
|
-
React.createElement(Text, { color: "yellow" },
|
|
101
|
-
React.createElement(Spinner, { type: "dots" }),
|
|
102
|
-
" Preparing to update..."))),
|
|
103
|
-
status === 'installing' && (React.createElement(Box, { flexDirection: "column" },
|
|
104
|
-
React.createElement(Box, null,
|
|
105
|
-
React.createElement(Text, { color: "cyan" },
|
|
106
|
-
React.createElement(Spinner, { type: "dots" }),
|
|
107
|
-
" Installing update...")),
|
|
108
|
-
React.createElement(Box, { marginTop: 1 },
|
|
109
|
-
React.createElement(Text, { dimColor: true }, "Please wait while we update Centaurus to the latest version.")))),
|
|
110
|
-
status === 'success' && (React.createElement(Box, { flexDirection: "column" },
|
|
111
|
-
React.createElement(Box, null,
|
|
112
|
-
React.createElement(Text, { color: "green", bold: true }, "\u2705 Update successful!")),
|
|
113
|
-
React.createElement(Box, { marginTop: 1 },
|
|
114
|
-
React.createElement(Text, { dimColor: true }, "Restarting Centaurus...")))),
|
|
115
|
-
status === 'error' && (React.createElement(Box, { flexDirection: "column" },
|
|
116
|
-
React.createElement(Box, null,
|
|
117
|
-
React.createElement(Text, { color: "red", bold: true }, "\u274C Update Failed")),
|
|
118
|
-
React.createElement(Box, { marginTop: 1 },
|
|
119
|
-
React.createElement(Text, { color: "yellow" }, errorMessage)),
|
|
120
|
-
React.createElement(Box, { marginTop: 1 },
|
|
121
|
-
React.createElement(Text, { dimColor: true }, "Continuing to chat in a few seconds..."))))));
|
|
72
|
+
setErrorMessage(friendlyError);
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
onComplete();
|
|
75
|
+
}, 5e3);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const restartCLI = () => {
|
|
80
|
+
exit();
|
|
81
|
+
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
82
|
+
logInfo("Update complete! Centaurus has been updated to the latest version.");
|
|
83
|
+
logInfo('User should run "centaurus" to start the updated CLI.');
|
|
84
|
+
process.exit(0);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1, marginTop: 1 }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "cyan", bold: true }, "\u{1F680} New Update Available!")), /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Current: ", /* @__PURE__ */ React.createElement(Text, { color: "gray" }, currentVersion), " \u2192 Latest: ", /* @__PURE__ */ React.createElement(Text, { color: "green", bold: true }, latestVersion))), status === "pending" && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "yellow" }, /* @__PURE__ */ React.createElement(Spinner, { type: "dots" }), " Preparing to update...")), status === "installing" && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "cyan" }, /* @__PURE__ */ React.createElement(Spinner, { type: "dots" }), " Installing update...")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Please wait while we update Centaurus to the latest version."))), status === "success" && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "green", bold: true }, "\u2705 Update successful!")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Restarting Centaurus..."))), status === "error" && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "red", bold: true }, "\u274C Update Failed")), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "yellow" }, errorMessage)), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, "Continuing to chat in a few seconds..."))));
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
VersionUpdatePrompt
|
|
122
90
|
};
|
|
123
91
|
//# sourceMappingURL=VersionUpdatePrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/VersionUpdatePrompt.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\nimport { Box, Text, useApp } from 'ink';\r\nimport Spinner from 'ink-spinner';\r\nimport { spawn } from 'child_process';\r\nimport { logInfo } from '../../utils/logger.js';\r\n\r\ninterface VersionUpdatePromptProps {\r\n currentVersion: string;\r\n latestVersion: string;\r\n onComplete: () => void;\r\n}\r\n\r\ntype UpdateStatus = 'pending' | 'installing' | 'success' | 'error';\r\n\r\nexport const VersionUpdatePrompt: React.FC<VersionUpdatePromptProps> = ({\r\n currentVersion,\r\n latestVersion,\r\n onComplete\r\n}) => {\r\n const [status, setStatus] = useState<UpdateStatus>('pending');\r\n const [errorMessage, setErrorMessage] = useState<string>('');\r\n const hasStartedRef = useRef(false);\r\n const { exit } = useApp();\r\n\r\n // Clear the screen on mount to prevent banner duplication from Static component\r\n useEffect(() => {\r\n // Clear terminal to remove any previous Static content that might persist\r\n process.stdout.write('\\x1b[2J\\x1b[3J\\x1b[H');\r\n }, []);\r\n\r\n // Auto-start installation after a brief delay\r\n useEffect(() => {\r\n if (hasStartedRef.current) return;\r\n hasStartedRef.current = true;\r\n\r\n const timer = setTimeout(() => {\r\n setStatus('installing');\r\n performUpdate();\r\n }, 1500); // Brief delay so user can see the update notification\r\n\r\n return () => clearTimeout(timer);\r\n }, []);\r\n\r\n const performUpdate = () => {\r\n // Determine the package manager - prefer npm as it's most commonly used\r\n const isWindows = process.platform === 'win32';\r\n const npmCmd = isWindows ? 'npm.cmd' : 'npm';\r\n\r\n const installProcess = spawn(\r\n npmCmd,\r\n ['install', '-g', 'centaurus-cli@latest'],\r\n {\r\n shell: true,\r\n stdio: 'pipe', // Capture output for error handling\r\n detached: false\r\n }\r\n );\r\n\r\n let stderrOutput = '';\r\n let stdoutOutput = '';\r\n\r\n if (installProcess.stdout) {\r\n installProcess.stdout.on('data', (data) => {\r\n stdoutOutput += data.toString();\r\n });\r\n }\r\n\r\n if (installProcess.stderr) {\r\n installProcess.stderr.on('data', (data) => {\r\n stderrOutput += data.toString();\r\n });\r\n }\r\n\r\n installProcess.on('error', (err) => {\r\n setStatus('error');\r\n setErrorMessage(`Failed to start update: ${err.message}`);\r\n });\r\n\r\n installProcess.on('close', (code) => {\r\n if (code === 0) {\r\n setStatus('success');\r\n // Wait a moment so user can see success message, then restart\r\n setTimeout(() => {\r\n restartCLI();\r\n }, 1500);\r\n } else {\r\n setStatus('error');\r\n // Parse common error messages for better user feedback\r\n let friendlyError = 'Update failed. Please try manually: npm install -g centaurus-cli@latest';\r\n\r\n if (stderrOutput.includes('EACCES') || stderrOutput.includes('permission')) {\r\n friendlyError = 'Permission denied. Try running with sudo (Linux/Mac) or as Administrator (Windows).';\r\n } else if (stderrOutput.includes('ENOTFOUND') || stderrOutput.includes('network')) {\r\n friendlyError = 'Network error. Please check your internet connection and try again.';\r\n } else if (stderrOutput.includes('ETIMEOUT')) {\r\n friendlyError = 'Connection timed out. Please check your internet connection and try again.';\r\n }\r\n\r\n setErrorMessage(friendlyError);\r\n\r\n // After showing error, continue to chat after a delay\r\n setTimeout(() => {\r\n onComplete();\r\n }, 5000);\r\n }\r\n });\r\n };\r\n\r\n const restartCLI = () => {\r\n // Exit the Ink app first\r\n exit();\r\n\r\n // Clear screen and show success message\r\n process.stdout.write('\\x1b[2J\\x1b[3J\\x1b[H');\r\n logInfo('Update complete! Centaurus has been updated to the latest version.');\r\n logInfo('User should run \"centaurus\" to start the updated CLI.');\r\n\r\n process.exit(0);\r\n };\r\n\r\n return (\r\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor=\"cyan\" paddingX={2} paddingY={1} marginTop={1}>\r\n <Box marginBottom={1}>\r\n <Text color=\"cyan\" bold>🚀 New Update Available!</Text>\r\n </Box>\r\n\r\n <Box marginBottom={1}>\r\n <Text>\r\n Current: <Text color=\"gray\">{currentVersion}</Text> → Latest: <Text color=\"green\" bold>{latestVersion}</Text>\r\n </Text>\r\n </Box>\r\n\r\n {status === 'pending' && (\r\n <Box>\r\n <Text color=\"yellow\">\r\n <Spinner type=\"dots\" /> Preparing to update...\r\n </Text>\r\n </Box>\r\n )}\r\n\r\n {status === 'installing' && (\r\n <Box flexDirection=\"column\">\r\n <Box>\r\n <Text color=\"cyan\">\r\n <Spinner type=\"dots\" /> Installing update...\r\n </Text>\r\n </Box>\r\n <Box marginTop={1}>\r\n <Text dimColor>Please wait while we update Centaurus to the latest version.</Text>\r\n </Box>\r\n </Box>\r\n )}\r\n\r\n {status === 'success' && (\r\n <Box flexDirection=\"column\">\r\n <Box>\r\n <Text color=\"green\" bold>✅ Update successful!</Text>\r\n </Box>\r\n <Box marginTop={1}>\r\n <Text dimColor>Restarting Centaurus...</Text>\r\n </Box>\r\n </Box>\r\n )}\r\n\r\n {status === 'error' && (\r\n <Box flexDirection=\"column\">\r\n <Box>\r\n <Text color=\"red\" bold>❌ Update Failed</Text>\r\n </Box>\r\n <Box marginTop={1}>\r\n <Text color=\"yellow\">{errorMessage}</Text>\r\n </Box>\r\n <Box marginTop={1}>\r\n <Text dimColor>Continuing to chat in a few seconds...</Text>\r\n </Box>\r\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BACzB,CACF,GAGD,WAAW,gBACV,oCAAC,OAAI,eAAc,YACjB,oCAAC,WACC,oCAAC,QAAK,OAAM,UACV,oCAAC,WAAQ,MAAK,QAAO,GAAE,uBACzB,CACF,GACA,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,UAAQ,QAAC,8DAA4D,CAC7E,CACF,GAGD,WAAW,aACV,oCAAC,OAAI,eAAc,YACjB,oCAAC,WACC,oCAAC,QAAK,OAAM,SAAQ,MAAI,QAAC,2BAAoB,CAC/C,GACA,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,UAAQ,QAAC,yBAAuB,CACxC,CACF,GAGD,WAAW,WACV,oCAAC,OAAI,eAAc,YACjB,oCAAC,WACC,oCAAC,QAAK,OAAM,OAAM,MAAI,QAAC,sBAAe,CACxC,GACA,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,OAAM,YAAU,YAAa,CACrC,GACA,oCAAC,OAAI,WAAW,KACd,oCAAC,QAAK,UAAQ,QAAC,wCAAsC,CACvD,CACF,CAEJ;AAEJ;","names":[]}
|
|
@@ -1,28 +1,178 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } 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
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import * as fs from "fs";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
import * as os from "os";
|
|
6
|
+
import { getCurrentVersion } from "../../utils/version-checker.js";
|
|
7
|
+
import { localChatStorage } from "../../services/local-chat-storage.js";
|
|
8
|
+
import { sessionQuotaManager } from "../../services/session-quota-manager.js";
|
|
9
|
+
import { apiClient } from "../../services/api-client.js";
|
|
10
|
+
import { rulesStorage } from "../../services/rules-storage.js";
|
|
11
|
+
import { ConfigManager } from "../../config/manager.js";
|
|
12
|
+
import { MCPConfigManager } from "../../config/mcp-config-manager.js";
|
|
13
|
+
function tryDecodeUserFromToken() {
|
|
14
|
+
try {
|
|
15
|
+
const sessionPath = path.join(os.homedir(), ".centaurus", "session.json");
|
|
16
|
+
const raw = fs.readFileSync(sessionPath, "utf-8");
|
|
17
|
+
const { sessionToken } = JSON.parse(raw);
|
|
18
|
+
if (!sessionToken) return null;
|
|
19
|
+
const parts = sessionToken.split(".");
|
|
20
|
+
if (parts.length < 2) return null;
|
|
21
|
+
const payload = JSON.parse(Buffer.from(parts[1], "base64").toString("utf-8"));
|
|
22
|
+
const name = payload.name ?? payload.fullName ?? payload.given_name ?? void 0;
|
|
23
|
+
const email = payload.email ?? payload.sub ?? void 0;
|
|
24
|
+
return name || email ? { name, email } : null;
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const WelcomeBanner = React.memo(() => {
|
|
30
|
+
const version = getCurrentVersion();
|
|
31
|
+
const recentChats = localChatStorage.listChats().slice(0, 3);
|
|
32
|
+
const cols = process.stdout.columns || 120;
|
|
33
|
+
const isAuth = apiClient.isAuthenticated();
|
|
34
|
+
const cachedUser = apiClient.getCachedUser();
|
|
35
|
+
const userInfo = isAuth ? cachedUser ? { name: cachedUser.fullName, email: cachedUser.email } : tryDecodeUserFromToken() : null;
|
|
36
|
+
const plan = sessionQuotaManager.getPlan();
|
|
37
|
+
const msgUsed = sessionQuotaManager.getMessagesUsed();
|
|
38
|
+
const msgLeft = sessionQuotaManager.getRemainingMessages();
|
|
39
|
+
const quota = sessionQuotaManager.getCurrentConfig();
|
|
40
|
+
const maxMsgs = quota.maxMessagesPerSession;
|
|
41
|
+
const sessionHrs = Math.round(quota.sessionDurationMs / (1e3 * 60 * 60));
|
|
42
|
+
const sessStart = sessionQuotaManager.getSessionStartTime();
|
|
43
|
+
const timeLeft = sessStart > 0 ? sessionQuotaManager.getFormattedTimeRemaining() : null;
|
|
44
|
+
let mcpEnabled = 0;
|
|
45
|
+
let mcpTotal = 0;
|
|
46
|
+
let autoSuggest = false;
|
|
47
|
+
let rulesCount = 0;
|
|
48
|
+
try {
|
|
49
|
+
const cfg = new ConfigManager().load();
|
|
50
|
+
autoSuggest = cfg.aiAutoSuggest ?? false;
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const mcpMgr = new MCPConfigManager();
|
|
55
|
+
mcpEnabled = mcpMgr.getServers().length;
|
|
56
|
+
mcpTotal = mcpMgr.getAllServers().length;
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
rulesCount = rulesStorage.list().length;
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
const contentW = cols - 4;
|
|
64
|
+
const rightC = cols - 91;
|
|
65
|
+
const showRight = rightC >= 22;
|
|
66
|
+
const tipsCount = rightC >= 40 ? 5 : rightC >= 34 ? 4 : rightC >= 28 ? 3 : 2;
|
|
67
|
+
const chatsCount = rightC >= 36 ? 3 : rightC >= 26 ? 2 : 1;
|
|
68
|
+
const titleLen = Math.max(8, rightC - 12);
|
|
69
|
+
const sepLen = Math.max(10, rightC);
|
|
70
|
+
const showLogo = cols >= 86;
|
|
71
|
+
const titleStr = " CENTAURUS CLI ";
|
|
72
|
+
const verStr = ` v${version} `;
|
|
73
|
+
const innerW = cols - 2;
|
|
74
|
+
const fillLen = Math.max(2, innerW - titleStr.length - verStr.length - 2);
|
|
75
|
+
const topBorder = `\u256D\u2500${titleStr}${"\u2500".repeat(fillLen)}${verStr}\u2500\u256E`;
|
|
76
|
+
const bottomBorder = `\u2570${"\u2500".repeat(innerW)}\u256F`;
|
|
77
|
+
const centaurusLines = [
|
|
78
|
+
" \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
|
|
79
|
+
"\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D",
|
|
80
|
+
"\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
|
|
81
|
+
"\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551",
|
|
82
|
+
"\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551",
|
|
83
|
+
" \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"
|
|
84
|
+
];
|
|
85
|
+
const cliLines = [
|
|
86
|
+
" \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557",
|
|
87
|
+
" \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
88
|
+
" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
89
|
+
" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
90
|
+
" \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551",
|
|
91
|
+
" \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D"
|
|
92
|
+
];
|
|
93
|
+
const allTips = [
|
|
94
|
+
{ key: "/help", desc: "List all commands" },
|
|
95
|
+
{ key: "/clean-ui", desc: "Refresh the chat UI" },
|
|
96
|
+
{ key: "/model", desc: "Switch AI model" },
|
|
97
|
+
{ key: "/docs", desc: "View documentation" },
|
|
98
|
+
{ key: "/plan", desc: "Switch to plan mode" }
|
|
99
|
+
];
|
|
100
|
+
const tips = allTips.slice(0, tipsCount);
|
|
101
|
+
const displayChats = recentChats.slice(0, chatsCount);
|
|
102
|
+
const fmtDate = (iso) => new Date(iso).toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
103
|
+
const trunc = (s, n) => s.length > n ? s.slice(0, n - 1) + "\u2026" : s;
|
|
104
|
+
const InfoRow = ({ label, children }) => /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "#555" }, label.padEnd(10)), children);
|
|
105
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, topBorder), /* @__PURE__ */ React.createElement(
|
|
106
|
+
Box,
|
|
107
|
+
{
|
|
108
|
+
borderStyle: "round",
|
|
109
|
+
borderTop: false,
|
|
110
|
+
borderBottom: false,
|
|
111
|
+
borderLeft: true,
|
|
112
|
+
borderRight: true,
|
|
113
|
+
borderColor: "#00ccff",
|
|
114
|
+
flexDirection: "column",
|
|
115
|
+
paddingX: 1,
|
|
116
|
+
width: cols
|
|
117
|
+
},
|
|
118
|
+
/* @__PURE__ */ React.createElement(Box, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginRight: 3 }, showLogo ? /* @__PURE__ */ React.createElement(React.Fragment, null, centaurusLines.map((line, i) => /* @__PURE__ */ React.createElement(Text, { key: `c${i}`, color: "#00ccff" }, line)), cliLines.map((line, i) => /* @__PURE__ */ React.createElement(Text, { key: `l${i}`, color: "#00ccff" }, line))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "CENTAURUS"), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "CLI"))), showRight && /* @__PURE__ */ React.createElement(
|
|
119
|
+
Box,
|
|
120
|
+
{
|
|
121
|
+
borderStyle: "single",
|
|
122
|
+
borderColor: "#1a5a7a",
|
|
123
|
+
flexDirection: "column",
|
|
124
|
+
paddingX: 1,
|
|
125
|
+
flexGrow: 1
|
|
126
|
+
},
|
|
127
|
+
/* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Beginner Tips"),
|
|
128
|
+
/* @__PURE__ */ React.createElement(Text, null, " "),
|
|
129
|
+
tips.map((t, i) => /* @__PURE__ */ React.createElement(Box, { key: i }, /* @__PURE__ */ React.createElement(Text, { color: "#00aacc" }, t.key.padEnd(8)), /* @__PURE__ */ React.createElement(Text, { color: "#666" }, t.desc))),
|
|
130
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#1a5a7a" }, "\u2500".repeat(sepLen))),
|
|
131
|
+
/* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Recent Activity"),
|
|
132
|
+
/* @__PURE__ */ React.createElement(Text, null, " "),
|
|
133
|
+
displayChats.length === 0 ? /* @__PURE__ */ React.createElement(Text, { color: "#444" }, "No recent chats yet.") : displayChats.map((chat) => /* @__PURE__ */ React.createElement(Box, { key: chat.id }, /* @__PURE__ */ React.createElement(Text, { color: "#00aacc" }, "\u25CF "), /* @__PURE__ */ React.createElement(Text, { color: "white" }, trunc(chat.title, titleLen)), /* @__PURE__ */ React.createElement(Text, { color: "#444" }, " ", fmtDate(chat.updatedAt)))),
|
|
134
|
+
/* @__PURE__ */ React.createElement(Text, null, " "),
|
|
135
|
+
/* @__PURE__ */ React.createElement(Text, { color: "#444" }, "/chat resume to continue")
|
|
136
|
+
)),
|
|
137
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "#1a4a6a" }, "\u2500".repeat(contentW))),
|
|
138
|
+
/* @__PURE__ */ React.createElement(Box, { flexDirection: "row", marginBottom: 1 }, /* @__PURE__ */ React.createElement(
|
|
139
|
+
Box,
|
|
140
|
+
{
|
|
141
|
+
borderStyle: "single",
|
|
142
|
+
borderColor: "#1a5a7a",
|
|
143
|
+
flexDirection: "column",
|
|
144
|
+
paddingX: 1,
|
|
145
|
+
flexGrow: 1,
|
|
146
|
+
flexBasis: 0,
|
|
147
|
+
marginRight: 2
|
|
148
|
+
},
|
|
149
|
+
/* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Subscription & Session Info"),
|
|
150
|
+
/* @__PURE__ */ React.createElement(Text, null, " "),
|
|
151
|
+
userInfo?.name && /* @__PURE__ */ React.createElement(InfoRow, { label: "User" }, /* @__PURE__ */ React.createElement(Text, { color: "white" }, userInfo.name)),
|
|
152
|
+
userInfo?.email && /* @__PURE__ */ React.createElement(InfoRow, { label: "Email" }, /* @__PURE__ */ React.createElement(Text, { color: "#888" }, userInfo.email)),
|
|
153
|
+
!userInfo && /* @__PURE__ */ React.createElement(InfoRow, { label: "Account" }, /* @__PURE__ */ React.createElement(Text, { color: isAuth ? "#00dd77" : "#ff5555" }, isAuth ? "\u25CF Signed in" : "\u25CB Not logged in")),
|
|
154
|
+
/* @__PURE__ */ React.createElement(InfoRow, { label: "Plan" }, /* @__PURE__ */ React.createElement(Text, { color: plan.toLowerCase() === "pro" ? "#f0c040" : "#00aacc" }, plan.charAt(0).toUpperCase() + plan.slice(1))),
|
|
155
|
+
/* @__PURE__ */ React.createElement(InfoRow, { label: "Messages" }, /* @__PURE__ */ React.createElement(Text, { color: "white" }, msgUsed), /* @__PURE__ */ React.createElement(Text, { color: "#555" }, " / ", maxMsgs, " used "), /* @__PURE__ */ React.createElement(Text, { color: msgLeft < 10 ? "#ffaa00" : "#00dd77" }, "(", msgLeft, " left)")),
|
|
156
|
+
/* @__PURE__ */ React.createElement(InfoRow, { label: "Window" }, /* @__PURE__ */ React.createElement(Text, { color: "#888" }, sessionHrs, "h session"), timeLeft ? /* @__PURE__ */ React.createElement(Text, { color: "#555" }, " \u2014 ", timeLeft, " remaining") : /* @__PURE__ */ React.createElement(Text, { color: "#444" }, " \u2014 not started"))
|
|
157
|
+
), /* @__PURE__ */ React.createElement(
|
|
158
|
+
Box,
|
|
159
|
+
{
|
|
160
|
+
borderStyle: "single",
|
|
161
|
+
borderColor: "#1a5a7a",
|
|
162
|
+
flexDirection: "column",
|
|
163
|
+
paddingX: 1,
|
|
164
|
+
flexGrow: 1,
|
|
165
|
+
flexBasis: 0
|
|
166
|
+
},
|
|
167
|
+
/* @__PURE__ */ React.createElement(Text, { color: "#00ccff", bold: true }, "Current Config"),
|
|
168
|
+
/* @__PURE__ */ React.createElement(Text, null, " "),
|
|
169
|
+
/* @__PURE__ */ React.createElement(InfoRow, { label: "MCPs" }, mcpTotal === 0 ? /* @__PURE__ */ React.createElement(Text, { color: "#444" }, "None configured") : /* @__PURE__ */ React.createElement(Text, { color: "white" }, mcpEnabled, " enabled", /* @__PURE__ */ React.createElement(Text, { color: "#555" }, " (", mcpTotal, " total)"))),
|
|
170
|
+
/* @__PURE__ */ React.createElement(InfoRow, { label: "AutoFill" }, /* @__PURE__ */ React.createElement(Text, { color: autoSuggest ? "#00dd77" : "#555" }, autoSuggest ? "On" : "Off")),
|
|
171
|
+
/* @__PURE__ */ React.createElement(InfoRow, { label: "Rules" }, rulesCount === 0 ? /* @__PURE__ */ React.createElement(Text, { color: "#444" }, "None configured") : /* @__PURE__ */ React.createElement(Text, { color: "white" }, rulesCount, " rule", rulesCount !== 1 ? "s" : "", " configured"))
|
|
172
|
+
))
|
|
173
|
+
), /* @__PURE__ */ React.createElement(Text, { color: "#00ccff" }, bottomBorder));
|
|
27
174
|
});
|
|
175
|
+
export {
|
|
176
|
+
WelcomeBanner
|
|
177
|
+
};
|
|
28
178
|
//# sourceMappingURL=WelcomeBanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WelcomeBanner.js","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,MAAM,CAAC,MAAM,aAAa,GAAa,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;IAErD,uDAAuD;IACvD,MAAM,KAAK,GAAG;QACZ,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,EAAE;QACF,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;KAC1C,CAAC;IAEF,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;QAEzC,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,IACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,oBAAC,IAAI,IAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAC,SAAS,IAAE,IAAI,CAAQ,CAC5C,CAAC,CACE;QAGN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,QAAQ;;gBAAM,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,YAAa;gCAAoB,CACtE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/components/WelcomeBanner.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Box, Text } from 'ink';\r\nimport * as fs from 'fs';\r\nimport * as path from 'path';\r\nimport * as os from 'os';\r\nimport { getCurrentVersion } from '../../utils/version-checker.js';\r\nimport { localChatStorage } from '../../services/local-chat-storage.js';\r\nimport { sessionQuotaManager } from '../../services/session-quota-manager.js';\r\nimport { apiClient } from '../../services/api-client.js';\r\nimport { rulesStorage } from '../../services/rules-storage.js';\r\nimport { ConfigManager } from '../../config/manager.js';\r\nimport { MCPConfigManager } from '../../config/mcp-config-manager.js';\r\n\r\n/** Attempt to extract name/email from the saved session token without a network call.\r\n * Works when the server issues JWTs; silently returns null for opaque tokens. */\r\nfunction tryDecodeUserFromToken(): { name?: string; email?: string } | null {\r\n try {\r\n const sessionPath = path.join(os.homedir(), '.centaurus', 'session.json');\r\n const raw = fs.readFileSync(sessionPath, 'utf-8');\r\n const { sessionToken } = JSON.parse(raw) as { sessionToken?: string };\r\n if (!sessionToken) return null;\r\n const parts = sessionToken.split('.');\r\n if (parts.length < 2) return null;\r\n const payload = JSON.parse(Buffer.from(parts[1], 'base64').toString('utf-8'));\r\n const name = payload.name ?? payload.fullName ?? payload.given_name ?? undefined;\r\n const email = payload.email ?? payload.sub ?? undefined;\r\n return (name || email) ? { name, email } : null;\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\nexport const WelcomeBanner: React.FC = React.memo(() => {\r\n const version = getCurrentVersion();\r\n const recentChats = localChatStorage.listChats().slice(0, 3);\r\n const cols = process.stdout.columns || 120;\r\n\r\n // ── Session / account data ───────────────────────────────────────\r\n const isAuth = apiClient.isAuthenticated();\r\n const cachedUser = apiClient.getCachedUser();\r\n const userInfo = isAuth\r\n ? (cachedUser\r\n ? { name: cachedUser.fullName, email: cachedUser.email }\r\n : tryDecodeUserFromToken())\r\n : null;\r\n const plan = sessionQuotaManager.getPlan();\r\n const msgUsed = sessionQuotaManager.getMessagesUsed();\r\n const msgLeft = sessionQuotaManager.getRemainingMessages();\r\n const quota = sessionQuotaManager.getCurrentConfig();\r\n const maxMsgs = quota.maxMessagesPerSession;\r\n const sessionHrs = Math.round(quota.sessionDurationMs / (1000 * 60 * 60));\r\n const sessStart = sessionQuotaManager.getSessionStartTime();\r\n const timeLeft = sessStart > 0 ? sessionQuotaManager.getFormattedTimeRemaining() : null;\r\n\r\n // ── Config data ──────────────────────────────────────────────────\r\n let mcpEnabled = 0;\r\n let mcpTotal = 0;\r\n let autoSuggest = false;\r\n let rulesCount = 0;\r\n try {\r\n const cfg = new ConfigManager().load();\r\n autoSuggest = cfg.aiAutoSuggest ?? false;\r\n } catch { /* use defaults */ }\r\n try {\r\n const mcpMgr = new MCPConfigManager();\r\n mcpEnabled = mcpMgr.getServers().length;\r\n mcpTotal = mcpMgr.getAllServers().length;\r\n } catch { /* show 0 */ }\r\n try { rulesCount = rulesStorage.list().length; } catch { /* show 0 */ }\r\n\r\n // ── Layout math ──────────────────────────────────────────────────\r\n const contentW = cols - 4; // outer Box: border(2) + paddingX(2) consumed\r\n const rightC = cols - 91; // content cols available inside right info panel\r\n const showRight = rightC >= 22;\r\n const tipsCount = rightC >= 40 ? 5 : rightC >= 34 ? 4 : rightC >= 28 ? 3 : 2;\r\n const chatsCount = rightC >= 36 ? 3 : rightC >= 26 ? 2 : 1;\r\n const titleLen = Math.max(8, rightC - 12);\r\n const sepLen = Math.max(10, rightC);\r\n\r\n // Show the 80-char block logo only when the terminal is wide enough.\r\n // Below 86 cols the art would wrap; fall back to a plain-text header instead.\r\n const showLogo = cols >= 86;\r\n\r\n // ── Custom border strings ────────────────────────────────────────\r\n const titleStr = ' CENTAURUS CLI ';\r\n const verStr = ` v${version} `;\r\n const innerW = cols - 2;\r\n const fillLen = Math.max(2, innerW - titleStr.length - verStr.length - 2);\r\n const topBorder = `╭─${titleStr}${'─'.repeat(fillLen)}${verStr}─╮`;\r\n const bottomBorder = `╰${'─'.repeat(innerW)}╯`;\r\n\r\n // ── ASCII art — correct 6-row ANSI Shadow, SINGLE layer ──────────\r\n // The old 5-row version was missing Row 4 entirely. That row contains\r\n // the crucial ╚════██║ segment that forms the lower curve of S (and the\r\n // corresponding intermediate strokes for E, N, U, R). Without it every\r\n // letter that has a middle horizontal looked truncated and S was broken.\r\n const centaurusLines = [\r\n ' ██████╗███████╗███╗ ██╗████████╗ █████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗',\r\n '██╔════╝██╔════╝████╗ ██║╚══██╔══╝██╔══██╗██║ ██║██╔══██╗██║ ██║██╔════╝',\r\n '██║ █████╗ ██╔██╗ ██║ ██║ ███████║██║ ██║██████╔╝██║ ██║███████╗',\r\n '██║ ██╔══╝ ██║╚██╗██║ ██║ ██╔══██║██║ ██║██╔══██╗██║ ██║╚════██║',\r\n '╚██████╗███████╗██║ ╚████║ ██║ ██║ ██║╚██████╔╝██║ ██║╚██████╔╝███████║',\r\n ' ╚═════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝',\r\n ];\r\n // CLI — correct 6-row version (rows 3 & 4 identical for C, L, I — correct)\r\n const cliLines = [\r\n ' ██████╗██╗ ██╗',\r\n ' ██╔════╝██║ ██║',\r\n ' ██║ ██║ ██║',\r\n ' ██║ ██║ ██║',\r\n ' ╚██████╗███████╗██║',\r\n ' ╚═════╝╚══════╝╚═╝',\r\n ];\r\n\r\n // ── Helpers ──────────────────────────────────────────────────────\r\n const allTips = [\r\n { key: '/help', desc: 'List all commands' },\r\n { key: '/clean-ui', desc: 'Refresh the chat UI' },\r\n { key: '/model', desc: 'Switch AI model' },\r\n { key: '/docs', desc: 'View documentation' },\r\n { key: '/plan', desc: 'Switch to plan mode' },\r\n ];\r\n const tips = allTips.slice(0, tipsCount);\r\n const displayChats = recentChats.slice(0, chatsCount);\r\n\r\n const fmtDate = (iso: string) =>\r\n new Date(iso).toLocaleDateString('en-US', { month: 'short', day: 'numeric' });\r\n\r\n const trunc = (s: string, n: number) =>\r\n s.length > n ? s.slice(0, n - 1) + '\\u2026' : s;\r\n\r\n const InfoRow = ({ label, children }: { label: string; children: React.ReactNode }) => (\r\n <Box>\r\n <Text color=\"#555\">{label.padEnd(10)}</Text>\r\n {children}\r\n </Box>\r\n );\r\n\r\n return (\r\n <Box flexDirection=\"column\" marginBottom={1}>\r\n\r\n {/* ══ Custom top border: ╭─ CENTAURUS CLI ──── v{x} ─╮ ══ */}\r\n <Text color=\"#00ccff\">{topBorder}</Text>\r\n\r\n {/* ══ Content — left + right borders only (top/bottom are the Text lines above/below) ══ */}\r\n <Box\r\n borderStyle=\"round\"\r\n borderTop={false}\r\n borderBottom={false}\r\n borderLeft={true}\r\n borderRight={true}\r\n borderColor=\"#00ccff\"\r\n flexDirection=\"column\"\r\n paddingX={1}\r\n width={cols}\r\n >\r\n\r\n {/* ── Top row: logo (left) | Tips + Recent (right) ── */}\r\n <Box flexDirection=\"row\" marginTop={1}>\r\n\r\n {/* Logo column — full block art, or plain-text fallback for narrow terminals */}\r\n <Box flexDirection=\"column\" marginRight={3}>\r\n {showLogo ? (\r\n <>\r\n {centaurusLines.map((line, i) => (\r\n <Text key={`c${i}`} color=\"#00ccff\">{line}</Text>\r\n ))}\r\n {cliLines.map((line, i) => (\r\n <Text key={`l${i}`} color=\"#00ccff\">{line}</Text>\r\n ))}\r\n </>\r\n ) : (\r\n <>\r\n <Text color=\"#00ccff\" bold>CENTAURUS</Text>\r\n <Text color=\"#00ccff\" bold>CLI</Text>\r\n </>\r\n )}\r\n </Box>\r\n\r\n {/* Tips + Recent Activity — hidden when terminal too narrow */}\r\n {showRight && (\r\n <Box\r\n borderStyle=\"single\"\r\n borderColor=\"#1a5a7a\"\r\n flexDirection=\"column\"\r\n paddingX={1}\r\n flexGrow={1}\r\n >\r\n <Text color=\"#00ccff\" bold>Beginner Tips</Text>\r\n <Text> </Text>\r\n {tips.map((t, i) => (\r\n <Box key={i}>\r\n <Text color=\"#00aacc\">{t.key.padEnd(8)}</Text>\r\n <Text color=\"#666\">{t.desc}</Text>\r\n </Box>\r\n ))}\r\n <Box marginTop={1}>\r\n <Text color=\"#1a5a7a\">{'─'.repeat(sepLen)}</Text>\r\n </Box>\r\n <Text color=\"#00ccff\" bold>Recent Activity</Text>\r\n <Text> </Text>\r\n {displayChats.length === 0 ? (\r\n <Text color=\"#444\">No recent chats yet.</Text>\r\n ) : (\r\n displayChats.map((chat) => (\r\n <Box key={chat.id}>\r\n <Text color=\"#00aacc\">{'● '}</Text>\r\n <Text color=\"white\">{trunc(chat.title, titleLen)}</Text>\r\n <Text color=\"#444\">{' '}{fmtDate(chat.updatedAt)}</Text>\r\n </Box>\r\n ))\r\n )}\r\n <Text> </Text>\r\n <Text color=\"#444\">/chat resume to continue</Text>\r\n </Box>\r\n )}\r\n </Box>\r\n\r\n {/* ── Full-width divider ── */}\r\n <Box marginTop={1} marginBottom={1}>\r\n <Text color=\"#1a4a6a\">{'─'.repeat(contentW)}</Text>\r\n </Box>\r\n\r\n {/* ── Bottom row: Session Info | Current Config ── */}\r\n <Box flexDirection=\"row\" marginBottom={1}>\r\n\r\n {/* Session Info */}\r\n <Box\r\n borderStyle=\"single\"\r\n borderColor=\"#1a5a7a\"\r\n flexDirection=\"column\"\r\n paddingX={1}\r\n flexGrow={1}\r\n flexBasis={0}\r\n marginRight={2}\r\n >\r\n <Text color=\"#00ccff\" bold>Subscription & Session Info</Text>\r\n <Text> </Text>\r\n {userInfo?.name && (\r\n <InfoRow label=\"User\">\r\n <Text color=\"white\">{userInfo.name}</Text>\r\n </InfoRow>\r\n )}\r\n {userInfo?.email && (\r\n <InfoRow label=\"Email\">\r\n <Text color=\"#888\">{userInfo.email}</Text>\r\n </InfoRow>\r\n )}\r\n {!userInfo && (\r\n <InfoRow label=\"Account\">\r\n <Text color={isAuth ? '#00dd77' : '#ff5555'}>\r\n {isAuth ? '● Signed in' : '○ Not logged in'}\r\n </Text>\r\n </InfoRow>\r\n )}\r\n <InfoRow label=\"Plan\">\r\n <Text color={plan.toLowerCase() === 'pro' ? '#f0c040' : '#00aacc'}>\r\n {plan.charAt(0).toUpperCase() + plan.slice(1)}\r\n </Text>\r\n </InfoRow>\r\n <InfoRow label=\"Messages\">\r\n <Text color=\"white\">{msgUsed}</Text>\r\n <Text color=\"#555\"> / {maxMsgs} used </Text>\r\n <Text color={msgLeft < 10 ? '#ffaa00' : '#00dd77'}>({msgLeft} left)</Text>\r\n </InfoRow>\r\n <InfoRow label=\"Window\">\r\n <Text color=\"#888\">{sessionHrs}h session</Text>\r\n {timeLeft\r\n ? <Text color=\"#555\"> — {timeLeft} remaining</Text>\r\n : <Text color=\"#444\"> — not started</Text>\r\n }\r\n </InfoRow>\r\n </Box>\r\n\r\n {/* Current Config */}\r\n <Box\r\n borderStyle=\"single\"\r\n borderColor=\"#1a5a7a\"\r\n flexDirection=\"column\"\r\n paddingX={1}\r\n flexGrow={1}\r\n flexBasis={0}\r\n >\r\n <Text color=\"#00ccff\" bold>Current Config</Text>\r\n <Text> </Text>\r\n <InfoRow label=\"MCPs\">\r\n {mcpTotal === 0\r\n ? <Text color=\"#444\">None configured</Text>\r\n : <Text color=\"white\">{mcpEnabled} enabled<Text color=\"#555\"> ({mcpTotal} total)</Text></Text>\r\n }\r\n </InfoRow>\r\n <InfoRow label=\"AutoFill\">\r\n <Text color={autoSuggest ? '#00dd77' : '#555'}>\r\n {autoSuggest ? 'On' : 'Off'}\r\n </Text>\r\n </InfoRow>\r\n <InfoRow label=\"Rules\">\r\n {rulesCount === 0\r\n ? <Text color=\"#444\">None configured</Text>\r\n : <Text color=\"white\">{rulesCount} rule{rulesCount !== 1 ? 's' : ''} configured</Text>\r\n }\r\n </InfoRow>\r\n </Box>\r\n\r\n </Box>\r\n </Box>\r\n\r\n {/* ══ Custom bottom border: ╰───╯ ══ */}\r\n <Text color=\"#00ccff\">{bottomBorder}</Text>\r\n\r\n </Box>\r\n );\r\n});\r\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,YAAY;AAC1B,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AACpB,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAA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