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,511 +1,989 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
import { CustomCommandsManager } from "./custom-commands-manager.js";
|
|
2
|
+
const SLASH_COMMANDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"help",
|
|
4
|
+
"h",
|
|
5
|
+
"?",
|
|
6
|
+
"model",
|
|
7
|
+
"m",
|
|
8
|
+
"models",
|
|
9
|
+
"config",
|
|
10
|
+
"c",
|
|
11
|
+
"settings",
|
|
12
|
+
"clear",
|
|
13
|
+
"cls",
|
|
14
|
+
"reset",
|
|
15
|
+
"sync",
|
|
16
|
+
"clean-ui",
|
|
17
|
+
"refresh-ui",
|
|
18
|
+
"redraw",
|
|
19
|
+
"exit",
|
|
20
|
+
"quit",
|
|
21
|
+
"q",
|
|
22
|
+
"session",
|
|
23
|
+
"s",
|
|
24
|
+
"session-limits",
|
|
25
|
+
"tools",
|
|
26
|
+
"t",
|
|
27
|
+
"plan",
|
|
28
|
+
"init",
|
|
29
|
+
"i",
|
|
30
|
+
"mcp",
|
|
31
|
+
"chat",
|
|
32
|
+
"docs",
|
|
33
|
+
"sign-in",
|
|
34
|
+
"logout",
|
|
35
|
+
"quality",
|
|
36
|
+
"autonomous",
|
|
37
|
+
"add-command",
|
|
38
|
+
"add-command-auto-detect",
|
|
39
|
+
"background-task",
|
|
40
|
+
"bkg",
|
|
41
|
+
"bg-task",
|
|
42
|
+
"copy-chat-context",
|
|
43
|
+
"workflow",
|
|
44
|
+
"wf",
|
|
45
|
+
"rules",
|
|
46
|
+
"revert"
|
|
34
47
|
]);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
48
|
+
const DEFINITE_COMMANDS = /* @__PURE__ */ new Set([
|
|
49
|
+
// Package Managers
|
|
50
|
+
"npm",
|
|
51
|
+
"yarn",
|
|
52
|
+
"pnpm",
|
|
53
|
+
"bun",
|
|
54
|
+
"npx",
|
|
55
|
+
"gem",
|
|
56
|
+
"pip",
|
|
57
|
+
"pip3",
|
|
58
|
+
"conda",
|
|
59
|
+
"cargo",
|
|
60
|
+
"composer",
|
|
61
|
+
"mvn",
|
|
62
|
+
"gradle",
|
|
63
|
+
// Package managers (extended)
|
|
64
|
+
"apt",
|
|
65
|
+
"apt-get",
|
|
66
|
+
"apt-cache",
|
|
67
|
+
"dpkg",
|
|
68
|
+
"yum",
|
|
69
|
+
"dnf",
|
|
70
|
+
"rpm",
|
|
71
|
+
"zypper",
|
|
72
|
+
"pacman",
|
|
73
|
+
"emerge",
|
|
74
|
+
"port",
|
|
75
|
+
"brew",
|
|
76
|
+
"choco",
|
|
77
|
+
"scoop",
|
|
78
|
+
"winget",
|
|
79
|
+
"snap",
|
|
80
|
+
"flatpak",
|
|
81
|
+
"nix",
|
|
82
|
+
"nix-env",
|
|
83
|
+
"apk",
|
|
84
|
+
// Version Control
|
|
85
|
+
"git",
|
|
86
|
+
"svn",
|
|
87
|
+
"hg",
|
|
88
|
+
"gh",
|
|
89
|
+
"gitk",
|
|
90
|
+
"tig",
|
|
91
|
+
// File Operations (non-ambiguous)
|
|
92
|
+
"ls",
|
|
93
|
+
"cd",
|
|
94
|
+
"pwd",
|
|
95
|
+
"mkdir",
|
|
96
|
+
"rm",
|
|
97
|
+
"cp",
|
|
98
|
+
"mv",
|
|
99
|
+
"cat",
|
|
100
|
+
"less",
|
|
101
|
+
"more",
|
|
102
|
+
"chmod",
|
|
103
|
+
"chown",
|
|
104
|
+
"chgrp",
|
|
105
|
+
"ln",
|
|
106
|
+
"stat",
|
|
107
|
+
"file",
|
|
108
|
+
"realpath",
|
|
109
|
+
"basename",
|
|
110
|
+
"dirname",
|
|
111
|
+
"readlink",
|
|
112
|
+
"dd",
|
|
113
|
+
"truncate",
|
|
114
|
+
"shred",
|
|
115
|
+
"sync",
|
|
116
|
+
"mktemp",
|
|
117
|
+
"install",
|
|
118
|
+
"xargs",
|
|
119
|
+
"tee",
|
|
120
|
+
"touch",
|
|
121
|
+
// Editors
|
|
122
|
+
"vim",
|
|
123
|
+
"nvim",
|
|
124
|
+
"vi",
|
|
125
|
+
"nano",
|
|
126
|
+
"emacs",
|
|
127
|
+
"micro",
|
|
128
|
+
"helix",
|
|
129
|
+
"hx",
|
|
130
|
+
"pico",
|
|
131
|
+
"joe",
|
|
132
|
+
"ne",
|
|
133
|
+
"mcedit",
|
|
134
|
+
"code",
|
|
135
|
+
"subl",
|
|
136
|
+
"atom",
|
|
137
|
+
"gedit",
|
|
138
|
+
"kate",
|
|
139
|
+
"notepad",
|
|
140
|
+
"notepad++",
|
|
141
|
+
// System / Process
|
|
142
|
+
"ps",
|
|
143
|
+
"kill",
|
|
144
|
+
"killall",
|
|
145
|
+
"htop",
|
|
146
|
+
"btop",
|
|
147
|
+
"free",
|
|
148
|
+
"df",
|
|
149
|
+
"du",
|
|
150
|
+
"whoami",
|
|
151
|
+
"su",
|
|
152
|
+
"sudo",
|
|
153
|
+
"nice",
|
|
154
|
+
"renice",
|
|
155
|
+
"nohup",
|
|
156
|
+
"timeout",
|
|
157
|
+
"strace",
|
|
158
|
+
"ltrace",
|
|
159
|
+
"pgrep",
|
|
160
|
+
"pkill",
|
|
161
|
+
"fuser",
|
|
162
|
+
"pstree",
|
|
163
|
+
// Network
|
|
164
|
+
"curl",
|
|
165
|
+
"wget",
|
|
166
|
+
"ssh",
|
|
167
|
+
"scp",
|
|
168
|
+
"ping",
|
|
169
|
+
"telnet",
|
|
170
|
+
"nc",
|
|
171
|
+
"netstat",
|
|
172
|
+
"lsof",
|
|
173
|
+
"dig",
|
|
174
|
+
"nslookup",
|
|
175
|
+
"ip",
|
|
176
|
+
"ifconfig",
|
|
177
|
+
"traceroute",
|
|
178
|
+
"arp",
|
|
179
|
+
"route",
|
|
180
|
+
"ss",
|
|
181
|
+
"tcpdump",
|
|
182
|
+
"nmap",
|
|
183
|
+
"iptables",
|
|
184
|
+
"ip6tables",
|
|
185
|
+
"firewall-cmd",
|
|
186
|
+
"ufw",
|
|
187
|
+
"socat",
|
|
188
|
+
"rsync",
|
|
189
|
+
"ftp",
|
|
190
|
+
"sftp",
|
|
191
|
+
"sshfs",
|
|
192
|
+
"rclone",
|
|
193
|
+
"mtr",
|
|
194
|
+
"host",
|
|
195
|
+
"whois",
|
|
196
|
+
// Build / Run (non-ambiguous)
|
|
197
|
+
"cmake",
|
|
198
|
+
"docker",
|
|
199
|
+
"docker-compose",
|
|
200
|
+
"kubectl",
|
|
201
|
+
"python",
|
|
202
|
+
"python3",
|
|
203
|
+
"ruby",
|
|
204
|
+
"perl",
|
|
205
|
+
"php",
|
|
206
|
+
"java",
|
|
207
|
+
"gcc",
|
|
208
|
+
"g++",
|
|
209
|
+
"clang",
|
|
210
|
+
"javac",
|
|
211
|
+
"dotnet",
|
|
212
|
+
"mono",
|
|
213
|
+
"swift",
|
|
214
|
+
"swiftc",
|
|
215
|
+
"kotlinc",
|
|
216
|
+
"scalac",
|
|
217
|
+
"elixir",
|
|
218
|
+
"mix",
|
|
219
|
+
"iex",
|
|
220
|
+
// Shell / Subshells
|
|
221
|
+
"echo",
|
|
222
|
+
"env",
|
|
223
|
+
"cal",
|
|
224
|
+
"printenv",
|
|
225
|
+
"wsl",
|
|
226
|
+
"bash",
|
|
227
|
+
"sh",
|
|
228
|
+
"zsh",
|
|
229
|
+
"fish",
|
|
230
|
+
"powershell",
|
|
231
|
+
"pwsh",
|
|
232
|
+
"cmd",
|
|
233
|
+
"ksh",
|
|
234
|
+
"csh",
|
|
235
|
+
"tcsh",
|
|
236
|
+
"ash",
|
|
237
|
+
"dash",
|
|
238
|
+
// Shell built-ins (critical additions)
|
|
239
|
+
"exit",
|
|
240
|
+
"logout",
|
|
241
|
+
"return",
|
|
242
|
+
"break",
|
|
243
|
+
"continue",
|
|
244
|
+
"alias",
|
|
245
|
+
"unalias",
|
|
246
|
+
"builtin",
|
|
247
|
+
"command",
|
|
248
|
+
"exec",
|
|
249
|
+
"eval",
|
|
250
|
+
"declare",
|
|
251
|
+
"local",
|
|
252
|
+
"readonly",
|
|
253
|
+
"enable",
|
|
254
|
+
"disable",
|
|
255
|
+
"ulimit",
|
|
256
|
+
"umask",
|
|
257
|
+
"trap",
|
|
258
|
+
"jobs",
|
|
259
|
+
"fg",
|
|
260
|
+
"bg",
|
|
261
|
+
"disown",
|
|
262
|
+
"suspend",
|
|
263
|
+
"times",
|
|
264
|
+
"pushd",
|
|
265
|
+
"popd",
|
|
266
|
+
"dirs",
|
|
267
|
+
"cd",
|
|
268
|
+
"pwd",
|
|
269
|
+
"fc",
|
|
270
|
+
"bind",
|
|
271
|
+
"complete",
|
|
272
|
+
"compgen",
|
|
273
|
+
"compopt",
|
|
274
|
+
"shopt",
|
|
275
|
+
"history",
|
|
276
|
+
"clear",
|
|
277
|
+
"reset",
|
|
278
|
+
"tput",
|
|
279
|
+
"stty",
|
|
280
|
+
// Session/User management
|
|
281
|
+
"login",
|
|
282
|
+
"newgrp",
|
|
283
|
+
"groups",
|
|
284
|
+
"id",
|
|
285
|
+
"users",
|
|
286
|
+
"finger",
|
|
287
|
+
"w",
|
|
288
|
+
"who",
|
|
289
|
+
"last",
|
|
290
|
+
"lastlog",
|
|
291
|
+
"useradd",
|
|
292
|
+
"userdel",
|
|
293
|
+
"usermod",
|
|
294
|
+
"passwd",
|
|
295
|
+
"chpasswd",
|
|
296
|
+
"groupadd",
|
|
297
|
+
"groupdel",
|
|
298
|
+
"groupmod",
|
|
299
|
+
"adduser",
|
|
300
|
+
"deluser",
|
|
301
|
+
// Archives
|
|
302
|
+
"tar",
|
|
303
|
+
"zip",
|
|
304
|
+
"unzip",
|
|
305
|
+
"gzip",
|
|
306
|
+
"gunzip",
|
|
307
|
+
"7z",
|
|
308
|
+
"rar",
|
|
309
|
+
"bzip2",
|
|
310
|
+
"bunzip2",
|
|
311
|
+
"xz",
|
|
312
|
+
"unxz",
|
|
313
|
+
"zstd",
|
|
314
|
+
// Search (non-ambiguous)
|
|
315
|
+
"grep",
|
|
316
|
+
"egrep",
|
|
317
|
+
"fgrep",
|
|
318
|
+
"locate",
|
|
319
|
+
"sed",
|
|
320
|
+
"awk",
|
|
321
|
+
"gawk",
|
|
322
|
+
"ack",
|
|
323
|
+
"ag",
|
|
324
|
+
"rg",
|
|
325
|
+
"fd",
|
|
326
|
+
"fzf",
|
|
327
|
+
// Text processing
|
|
328
|
+
"tr",
|
|
329
|
+
"wc",
|
|
330
|
+
"nl",
|
|
331
|
+
"uniq",
|
|
332
|
+
"rev",
|
|
333
|
+
"tac",
|
|
334
|
+
"hexdump",
|
|
335
|
+
"xxd",
|
|
336
|
+
"od",
|
|
337
|
+
"strings",
|
|
338
|
+
"expand",
|
|
339
|
+
"unexpand",
|
|
340
|
+
"column",
|
|
341
|
+
"colrm",
|
|
342
|
+
"csplit",
|
|
343
|
+
"pr",
|
|
344
|
+
"tsort",
|
|
345
|
+
"comm",
|
|
346
|
+
// Misc
|
|
347
|
+
"jq",
|
|
348
|
+
"yq",
|
|
349
|
+
"crontab",
|
|
350
|
+
"visudo",
|
|
351
|
+
"vipw",
|
|
352
|
+
"sudoedit",
|
|
353
|
+
"at",
|
|
354
|
+
"batch",
|
|
355
|
+
// Cloud / DevOps
|
|
356
|
+
"aws",
|
|
357
|
+
"az",
|
|
358
|
+
"gcloud",
|
|
359
|
+
"terraform",
|
|
360
|
+
"ansible",
|
|
361
|
+
"ansible-playbook",
|
|
362
|
+
"kubectl",
|
|
363
|
+
"helm",
|
|
364
|
+
"vagrant",
|
|
365
|
+
"pulumi",
|
|
366
|
+
"cdk",
|
|
367
|
+
"sam",
|
|
368
|
+
"serverless",
|
|
369
|
+
"flyctl",
|
|
370
|
+
"heroku",
|
|
371
|
+
"vercel",
|
|
372
|
+
"netlify",
|
|
373
|
+
// Database
|
|
374
|
+
"mysql",
|
|
375
|
+
"psql",
|
|
376
|
+
"mongo",
|
|
377
|
+
"mongod",
|
|
378
|
+
"mongosh",
|
|
379
|
+
"redis-cli",
|
|
380
|
+
"sqlite3",
|
|
381
|
+
"pg_dump",
|
|
382
|
+
"mysqldump",
|
|
383
|
+
// Web / Security
|
|
384
|
+
"openssl",
|
|
385
|
+
"certbot",
|
|
386
|
+
"nginx",
|
|
387
|
+
"apache2",
|
|
388
|
+
"httpd",
|
|
389
|
+
"gpg",
|
|
390
|
+
"ssh-keygen",
|
|
391
|
+
"ssh-agent",
|
|
392
|
+
"ssh-add",
|
|
393
|
+
// Language runtimes (non-ambiguous)
|
|
394
|
+
"node",
|
|
395
|
+
"deno",
|
|
396
|
+
"ts-node",
|
|
397
|
+
"tsx",
|
|
398
|
+
"esbuild",
|
|
399
|
+
"webpack",
|
|
400
|
+
"vite",
|
|
401
|
+
"rollup",
|
|
402
|
+
"parcel",
|
|
403
|
+
"jest",
|
|
404
|
+
"vitest",
|
|
405
|
+
"mocha",
|
|
406
|
+
"pytest",
|
|
407
|
+
"phpunit",
|
|
408
|
+
"rspec",
|
|
409
|
+
// Go
|
|
410
|
+
"go",
|
|
411
|
+
"gofmt",
|
|
412
|
+
"golint",
|
|
413
|
+
"gopls",
|
|
414
|
+
// Rust
|
|
415
|
+
"rustc",
|
|
416
|
+
"rustup",
|
|
417
|
+
"rustfmt",
|
|
418
|
+
"clippy",
|
|
419
|
+
// System info
|
|
420
|
+
"uname",
|
|
421
|
+
"hostname",
|
|
422
|
+
"uptime",
|
|
423
|
+
"arch",
|
|
424
|
+
"nproc",
|
|
425
|
+
"lscpu",
|
|
426
|
+
"lsblk",
|
|
427
|
+
"lsusb",
|
|
428
|
+
"lspci",
|
|
429
|
+
"dmidecode",
|
|
430
|
+
"dmesg",
|
|
431
|
+
"sysctl",
|
|
432
|
+
"modprobe",
|
|
433
|
+
"lsmod",
|
|
434
|
+
"insmod",
|
|
435
|
+
"rmmod",
|
|
436
|
+
// Services/Daemons
|
|
437
|
+
"systemctl",
|
|
438
|
+
"service",
|
|
439
|
+
"journalctl",
|
|
440
|
+
"loginctl",
|
|
441
|
+
"chkconfig",
|
|
442
|
+
"update-rc.d",
|
|
443
|
+
"launchctl",
|
|
444
|
+
// Disk/Storage
|
|
445
|
+
"mount",
|
|
446
|
+
"umount",
|
|
447
|
+
"fdisk",
|
|
448
|
+
"parted",
|
|
449
|
+
"mkfs",
|
|
450
|
+
"fsck",
|
|
451
|
+
"blkid",
|
|
452
|
+
"findmnt",
|
|
453
|
+
"quota",
|
|
454
|
+
"hdparm",
|
|
455
|
+
// Windows-specific commands
|
|
456
|
+
"dir",
|
|
457
|
+
"copy",
|
|
458
|
+
"move",
|
|
459
|
+
"del",
|
|
460
|
+
"ren",
|
|
461
|
+
"rename",
|
|
462
|
+
"attrib",
|
|
463
|
+
"cls",
|
|
464
|
+
"md",
|
|
465
|
+
"rd",
|
|
466
|
+
"rmdir",
|
|
467
|
+
"xcopy",
|
|
468
|
+
"robocopy",
|
|
469
|
+
"icacls",
|
|
470
|
+
"cacls",
|
|
471
|
+
"takeown",
|
|
472
|
+
"tasklist",
|
|
473
|
+
"taskkill",
|
|
474
|
+
"systeminfo",
|
|
475
|
+
"ipconfig",
|
|
476
|
+
"netsh",
|
|
477
|
+
"pathping",
|
|
478
|
+
"reg",
|
|
479
|
+
"regedit",
|
|
480
|
+
"schtasks",
|
|
481
|
+
"wmic",
|
|
482
|
+
"where",
|
|
483
|
+
"findstr",
|
|
484
|
+
"fc",
|
|
485
|
+
"comp",
|
|
486
|
+
"chkdsk",
|
|
487
|
+
"sfc",
|
|
488
|
+
"dism",
|
|
489
|
+
"bcdedit",
|
|
490
|
+
"diskpart",
|
|
491
|
+
"format",
|
|
492
|
+
"label",
|
|
493
|
+
"vol",
|
|
494
|
+
"net",
|
|
495
|
+
"netstat",
|
|
496
|
+
"nbtstat",
|
|
497
|
+
"klist",
|
|
498
|
+
"gpresult",
|
|
499
|
+
"gpupdate",
|
|
500
|
+
"shutdown",
|
|
501
|
+
"logoff",
|
|
502
|
+
// PowerShell aliases that look like commands
|
|
503
|
+
"gci",
|
|
504
|
+
"gc",
|
|
505
|
+
"sl",
|
|
506
|
+
"gi",
|
|
507
|
+
"gm",
|
|
508
|
+
"gwmi",
|
|
509
|
+
"iwr",
|
|
510
|
+
"irm",
|
|
511
|
+
// Date/Time
|
|
512
|
+
"timedatectl",
|
|
513
|
+
"hwclock",
|
|
514
|
+
"ntpdate",
|
|
515
|
+
"chronyc",
|
|
516
|
+
// Containers/Virtualization
|
|
517
|
+
"podman",
|
|
518
|
+
"crictl",
|
|
519
|
+
"ctr",
|
|
520
|
+
"nerdctl",
|
|
521
|
+
"lxc",
|
|
522
|
+
"lxd",
|
|
523
|
+
"virsh",
|
|
524
|
+
"vboxmanage",
|
|
525
|
+
"multipass",
|
|
526
|
+
"lima",
|
|
527
|
+
// Kubernetes ecosystem
|
|
528
|
+
"k9s",
|
|
529
|
+
"kubectx",
|
|
530
|
+
"kubens",
|
|
531
|
+
"kustomize",
|
|
532
|
+
"skaffold",
|
|
533
|
+
"minikube",
|
|
534
|
+
"kind",
|
|
535
|
+
"k3s",
|
|
536
|
+
"k3d",
|
|
537
|
+
// Misc utilities
|
|
538
|
+
"xdg-open",
|
|
539
|
+
"open",
|
|
540
|
+
"wslpath",
|
|
541
|
+
"cygpath",
|
|
542
|
+
"explorer",
|
|
543
|
+
"start",
|
|
544
|
+
"yes",
|
|
545
|
+
"seq",
|
|
546
|
+
"factor",
|
|
547
|
+
"bc",
|
|
548
|
+
"dc",
|
|
549
|
+
"expr",
|
|
550
|
+
"sleep",
|
|
551
|
+
"usleep",
|
|
552
|
+
"watch",
|
|
553
|
+
// Common CLI tools
|
|
554
|
+
"ffmpeg",
|
|
555
|
+
"ffprobe",
|
|
556
|
+
"convert",
|
|
557
|
+
"identify",
|
|
558
|
+
"magick",
|
|
559
|
+
"pandoc",
|
|
560
|
+
"latex",
|
|
561
|
+
"pdflatex",
|
|
562
|
+
"bibtex",
|
|
563
|
+
"youtube-dl",
|
|
564
|
+
"yt-dlp",
|
|
565
|
+
"aria2c",
|
|
566
|
+
"axel"
|
|
130
567
|
]);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
568
|
+
const SHELL_BUILTINS = /* @__PURE__ */ new Set([
|
|
569
|
+
"exit",
|
|
570
|
+
"logout",
|
|
571
|
+
"return",
|
|
572
|
+
"break",
|
|
573
|
+
"continue",
|
|
574
|
+
"jobs",
|
|
575
|
+
"fg",
|
|
576
|
+
"bg",
|
|
577
|
+
"wait",
|
|
578
|
+
"disown",
|
|
579
|
+
"suspend",
|
|
580
|
+
"pushd",
|
|
581
|
+
"popd",
|
|
582
|
+
"dirs",
|
|
583
|
+
"history",
|
|
584
|
+
"fc",
|
|
585
|
+
"pwd",
|
|
586
|
+
"hash",
|
|
587
|
+
"help",
|
|
588
|
+
"true",
|
|
589
|
+
"false",
|
|
590
|
+
"env",
|
|
591
|
+
"printenv",
|
|
592
|
+
"export",
|
|
593
|
+
"set",
|
|
594
|
+
"unset",
|
|
595
|
+
"alias",
|
|
596
|
+
"unalias",
|
|
597
|
+
"type",
|
|
598
|
+
"command",
|
|
599
|
+
"builtin",
|
|
600
|
+
"clear",
|
|
601
|
+
"reset",
|
|
602
|
+
"cls"
|
|
142
603
|
]);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
604
|
+
const AMBIGUOUS_COMMANDS = /* @__PURE__ */ new Set([
|
|
605
|
+
"which",
|
|
606
|
+
"make",
|
|
607
|
+
"find",
|
|
608
|
+
"head",
|
|
609
|
+
"tail",
|
|
610
|
+
"test",
|
|
611
|
+
"run",
|
|
612
|
+
"start",
|
|
613
|
+
"stop",
|
|
614
|
+
"top",
|
|
615
|
+
"man",
|
|
616
|
+
"date",
|
|
617
|
+
"time",
|
|
618
|
+
"source",
|
|
619
|
+
"tree",
|
|
620
|
+
"sort",
|
|
621
|
+
"diff",
|
|
622
|
+
"patch",
|
|
623
|
+
"split",
|
|
624
|
+
"join",
|
|
625
|
+
"cut",
|
|
626
|
+
"paste",
|
|
627
|
+
"fold",
|
|
628
|
+
"fmt",
|
|
629
|
+
"look",
|
|
630
|
+
"spell",
|
|
631
|
+
"read",
|
|
632
|
+
"print",
|
|
633
|
+
"say",
|
|
634
|
+
"write",
|
|
635
|
+
"mount",
|
|
636
|
+
"watch",
|
|
637
|
+
"locate",
|
|
638
|
+
"ping",
|
|
639
|
+
"host"
|
|
151
640
|
]);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
641
|
+
const AI_KEYWORDS = /* @__PURE__ */ new Set([
|
|
642
|
+
// Question words
|
|
643
|
+
"how",
|
|
644
|
+
"what",
|
|
645
|
+
"why",
|
|
646
|
+
"when",
|
|
647
|
+
"where",
|
|
648
|
+
"who",
|
|
649
|
+
"whose",
|
|
650
|
+
"whom",
|
|
651
|
+
// Action requests
|
|
652
|
+
"write",
|
|
653
|
+
"create",
|
|
654
|
+
"generate",
|
|
655
|
+
"implement",
|
|
656
|
+
"scaffold",
|
|
657
|
+
"design",
|
|
658
|
+
"explain",
|
|
659
|
+
"describe",
|
|
660
|
+
"clarify",
|
|
661
|
+
"analyze",
|
|
662
|
+
"review",
|
|
663
|
+
"audit",
|
|
664
|
+
"fix",
|
|
665
|
+
"debug",
|
|
666
|
+
"solve",
|
|
667
|
+
"correct",
|
|
668
|
+
"repair",
|
|
669
|
+
"optimize",
|
|
670
|
+
"improve",
|
|
671
|
+
"refactor",
|
|
672
|
+
"format",
|
|
673
|
+
"verify",
|
|
674
|
+
"validate",
|
|
675
|
+
"translate",
|
|
676
|
+
"convert",
|
|
677
|
+
"transform",
|
|
678
|
+
"summarize",
|
|
679
|
+
"document",
|
|
680
|
+
"comment",
|
|
681
|
+
"add",
|
|
682
|
+
"update",
|
|
683
|
+
"change",
|
|
684
|
+
"modify",
|
|
685
|
+
"remove",
|
|
686
|
+
"delete",
|
|
687
|
+
// Modal verbs indicating requests
|
|
688
|
+
"can",
|
|
689
|
+
"could",
|
|
690
|
+
"would",
|
|
691
|
+
"should",
|
|
692
|
+
"shall",
|
|
693
|
+
"might",
|
|
694
|
+
"must",
|
|
695
|
+
// Greetings and polite markers
|
|
696
|
+
"hey",
|
|
697
|
+
"hi",
|
|
698
|
+
"hello",
|
|
699
|
+
"help",
|
|
700
|
+
"please",
|
|
701
|
+
"thanks",
|
|
702
|
+
"thank",
|
|
703
|
+
// Contextual
|
|
704
|
+
"show",
|
|
705
|
+
"tell",
|
|
706
|
+
"give",
|
|
707
|
+
"list",
|
|
708
|
+
"provide",
|
|
709
|
+
"suggest",
|
|
710
|
+
"recommend"
|
|
171
711
|
]);
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
712
|
+
const NATURAL_LANGUAGE_MARKERS = /* @__PURE__ */ new Set([
|
|
713
|
+
// Articles
|
|
714
|
+
"a",
|
|
715
|
+
"an",
|
|
716
|
+
"the",
|
|
717
|
+
// Pronouns
|
|
718
|
+
"i",
|
|
719
|
+
"me",
|
|
720
|
+
"my",
|
|
721
|
+
"mine",
|
|
722
|
+
"you",
|
|
723
|
+
"your",
|
|
724
|
+
"yours",
|
|
725
|
+
"he",
|
|
726
|
+
"she",
|
|
727
|
+
"it",
|
|
728
|
+
"we",
|
|
729
|
+
"they",
|
|
730
|
+
"this",
|
|
731
|
+
"that",
|
|
732
|
+
"these",
|
|
733
|
+
"those",
|
|
734
|
+
// Prepositions commonly used in requests
|
|
735
|
+
"for",
|
|
736
|
+
"with",
|
|
737
|
+
"about",
|
|
738
|
+
"from",
|
|
739
|
+
"into",
|
|
740
|
+
"through",
|
|
741
|
+
"during",
|
|
742
|
+
"before",
|
|
743
|
+
"after",
|
|
744
|
+
// Conjunctions
|
|
745
|
+
"and",
|
|
746
|
+
"but",
|
|
747
|
+
"or",
|
|
748
|
+
"so",
|
|
749
|
+
"because",
|
|
750
|
+
"if",
|
|
751
|
+
"then",
|
|
752
|
+
"while",
|
|
753
|
+
// Common verbs in questions/requests
|
|
754
|
+
"is",
|
|
755
|
+
"are",
|
|
756
|
+
"was",
|
|
757
|
+
"were",
|
|
758
|
+
"be",
|
|
759
|
+
"been",
|
|
760
|
+
"being",
|
|
761
|
+
"do",
|
|
762
|
+
"does",
|
|
763
|
+
"did",
|
|
764
|
+
"doing",
|
|
765
|
+
"done",
|
|
766
|
+
"have",
|
|
767
|
+
"has",
|
|
768
|
+
"had",
|
|
769
|
+
"having",
|
|
770
|
+
"get",
|
|
771
|
+
"got",
|
|
772
|
+
"getting",
|
|
773
|
+
// Adverbs
|
|
774
|
+
"here",
|
|
775
|
+
"there",
|
|
776
|
+
"now",
|
|
777
|
+
"just",
|
|
778
|
+
"also",
|
|
779
|
+
"only",
|
|
780
|
+
"even",
|
|
781
|
+
"still",
|
|
782
|
+
"already"
|
|
190
783
|
]);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
784
|
+
const COMMAND_SUBCOMMANDS = /* @__PURE__ */ new Map([
|
|
785
|
+
["git", /* @__PURE__ */ new Set(["add", "commit", "push", "pull", "clone", "checkout", "branch", "merge", "rebase", "reset", "stash", "log", "diff", "status", "init", "remote", "fetch", "tag", "show", "rm", "mv", "bisect", "blame", "cherry-pick", "revert", "clean", "gc", "reflog", "worktree", "submodule", "config", "help", "version"])],
|
|
786
|
+
["npm", /* @__PURE__ */ new Set(["install", "i", "uninstall", "un", "update", "up", "run", "start", "test", "build", "init", "publish", "pack", "link", "unlink", "ls", "list", "outdated", "audit", "cache", "config", "help", "version", "ci", "exec", "create", "set-script", "pkg", "dedupe", "prune", "shrinkwrap", "adduser", "login", "logout", "whoami", "token", "owner", "access", "team", "deprecate", "unpublish", "dist-tag", "view", "search", "doctor", "explain", "find-dupes", "fund", "hook", "org", "ping", "prefix", "profile", "rebuild", "repo", "root", "star", "stars", "unstar", "bugs", "docs", "edit", "explore"])],
|
|
787
|
+
["yarn", /* @__PURE__ */ new Set(["add", "remove", "install", "run", "start", "test", "build", "init", "publish", "link", "unlink", "list", "outdated", "audit", "cache", "config", "help", "version", "upgrade", "upgrade-interactive", "why", "workspaces", "set", "create", "dlx", "pack", "dedupe", "info"])],
|
|
788
|
+
["pnpm", /* @__PURE__ */ new Set(["add", "remove", "install", "i", "run", "start", "test", "build", "init", "publish", "link", "unlink", "list", "ls", "outdated", "audit", "store", "config", "help", "version", "update", "up", "why", "dlx", "create", "exec", "fetch", "dedupe", "patch", "prune", "rebuild"])],
|
|
789
|
+
["docker", /* @__PURE__ */ new Set(["run", "exec", "build", "pull", "push", "images", "ps", "stop", "start", "restart", "rm", "rmi", "logs", "inspect", "network", "volume", "compose", "system", "container", "image", "login", "logout", "tag", "save", "load", "export", "import", "commit", "cp", "create", "diff", "events", "history", "info", "kill", "pause", "unpause", "port", "rename", "stats", "top", "update", "wait", "attach", "builder", "buildx", "config", "context", "manifest", "plugin", "search", "secret", "service", "stack", "swarm", "trust", "version"])],
|
|
790
|
+
["kubectl", /* @__PURE__ */ new Set(["get", "describe", "create", "apply", "delete", "edit", "logs", "exec", "port-forward", "proxy", "run", "expose", "scale", "rollout", "set", "explain", "cluster-info", "top", "cordon", "uncordon", "drain", "taint", "label", "annotate", "config", "cp", "attach", "auth", "autoscale", "certificate", "completion", "debug", "diff", "kustomize", "patch", "plugin", "replace", "version", "wait", "api-resources", "api-versions"])],
|
|
791
|
+
["go", /* @__PURE__ */ new Set(["build", "run", "test", "get", "install", "mod", "fmt", "vet", "generate", "clean", "env", "version", "list", "work", "doc", "fix", "tool", "bug"])],
|
|
792
|
+
["cargo", /* @__PURE__ */ new Set(["build", "run", "test", "new", "init", "add", "remove", "update", "search", "publish", "install", "uninstall", "check", "bench", "doc", "clean", "fetch", "fix", "fmt", "clippy", "tree", "vendor", "verify-project", "version", "yank", "help", "login", "logout", "owner", "package", "generate-lockfile", "locate-project", "metadata", "pkgid", "read-manifest", "report"])],
|
|
793
|
+
["pip", /* @__PURE__ */ new Set(["install", "uninstall", "download", "freeze", "list", "show", "search", "wheel", "hash", "check", "config", "cache", "index", "debug", "help", "completion"])],
|
|
794
|
+
["pip3", /* @__PURE__ */ new Set(["install", "uninstall", "download", "freeze", "list", "show", "search", "wheel", "hash", "check", "config", "cache", "index", "debug", "help", "completion"])],
|
|
795
|
+
["aws", /* @__PURE__ */ new Set(["s3", "ec2", "lambda", "iam", "rds", "dynamodb", "cloudformation", "ecs", "eks", "sns", "sqs", "cloudwatch", "route53", "apigateway", "cognito", "secretsmanager", "ssm", "sts", "configure", "help"])],
|
|
796
|
+
["az", /* @__PURE__ */ new Set(["login", "logout", "account", "group", "vm", "storage", "network", "webapp", "functionapp", "aks", "acr", "sql", "cosmosdb", "keyvault", "monitor", "resource", "role", "ad", "configure", "help", "version"])],
|
|
797
|
+
["gcloud", /* @__PURE__ */ new Set(["auth", "config", "compute", "container", "functions", "run", "app", "sql", "storage", "pubsub", "iam", "projects", "services", "builds", "deploy", "components", "help", "version", "init", "info"])],
|
|
798
|
+
["terraform", /* @__PURE__ */ new Set(["init", "plan", "apply", "destroy", "validate", "fmt", "show", "output", "refresh", "import", "state", "workspace", "providers", "graph", "taint", "untaint", "console", "force-unlock", "get", "login", "logout", "version", "help"])],
|
|
799
|
+
["make", /* @__PURE__ */ new Set(["all", "build", "clean", "install", "uninstall", "test", "check", "dist", "distclean", "help"])],
|
|
800
|
+
["find", /* @__PURE__ */ new Set([])],
|
|
801
|
+
// find uses expressions, not subcommands
|
|
802
|
+
["which", /* @__PURE__ */ new Set([])]
|
|
803
|
+
// which doesn't have subcommands
|
|
210
804
|
]);
|
|
211
|
-
/**
|
|
212
|
-
* Check if the input looks like a natural language sentence
|
|
213
|
-
*/
|
|
214
805
|
function looksLikeNaturalLanguage(words) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
if (NATURAL_LANGUAGE_MARKERS.has(word)) {
|
|
222
|
-
markerCount++;
|
|
223
|
-
}
|
|
806
|
+
if (words.length < 2) return false;
|
|
807
|
+
const lowerWords = words.map((w) => w.toLowerCase());
|
|
808
|
+
let markerCount = 0;
|
|
809
|
+
for (const word of lowerWords) {
|
|
810
|
+
if (NATURAL_LANGUAGE_MARKERS.has(word)) {
|
|
811
|
+
markerCount++;
|
|
224
812
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
// Pattern: long phrase with multiple natural language markers scattered
|
|
245
|
-
if (words.length >= 4 && markerCount >= 2) {
|
|
246
|
-
return true;
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
813
|
+
}
|
|
814
|
+
if (markerCount >= Math.ceil(words.length * 0.3)) {
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
if (lowerWords.length >= 2 && ["a", "an", "the", "me", "my", "some", "any"].includes(lowerWords[1])) {
|
|
818
|
+
return true;
|
|
819
|
+
}
|
|
820
|
+
if (lowerWords.length >= 3 && AMBIGUOUS_COMMANDS.has(lowerWords[0]) && NATURAL_LANGUAGE_MARKERS.has(lowerWords[1])) {
|
|
821
|
+
return true;
|
|
822
|
+
}
|
|
823
|
+
if (lowerWords.includes("i") && lowerWords.indexOf("i") > 0) {
|
|
824
|
+
return true;
|
|
825
|
+
}
|
|
826
|
+
if (words.length >= 4 && markerCount >= 2) {
|
|
827
|
+
return true;
|
|
828
|
+
}
|
|
829
|
+
return false;
|
|
249
830
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Check if input has strong command syntax indicators
|
|
252
|
-
*/
|
|
253
831
|
function hasCommandSyntax(input, words) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const hasCommandChain = /;\s*[a-zA-Z]/.test(input);
|
|
280
|
-
// Command substitution: $(cmd) or `cmd`
|
|
281
|
-
const hasCommandSubstitution = /\$\([^)]+\)|`[^`]+`/.test(input);
|
|
282
|
-
// Job control: %1, %2, etc.
|
|
283
|
-
const hasJobReference = /^(fg|bg|jobs|kill|disown)\s+%?\d+$/.test(trimmed);
|
|
284
|
-
// pushd/popd with path or +N/-N
|
|
285
|
-
const hasDirStackOp = /^(pushd|popd)\s+([+\-]\d+|[\/~.])/.test(trimmed);
|
|
286
|
-
// history with number: history 10, history -c, history -d 5
|
|
287
|
-
const hasHistoryOp = /^history\s+(-[a-z]|\d+)/.test(trimmed);
|
|
288
|
-
// alias definition: alias name='...' or alias name="..."
|
|
289
|
-
const hasAliasDefinition = /^alias\s+[a-zA-Z_][a-zA-Z0-9_]*=/.test(trimmed);
|
|
290
|
-
// export with assignment: export VAR=value
|
|
291
|
-
const hasExportAssign = /^export\s+[A-Z_][A-Z0-9_]*=/.test(trimmed);
|
|
292
|
-
// cd with path or special: cd -, cd ~, cd ..
|
|
293
|
-
const hasCdPath = /^cd\s+[\/~.\-]/.test(trimmed);
|
|
294
|
-
// Check for known command + subcommand pattern
|
|
295
|
-
if (words.length >= 2) {
|
|
296
|
-
const secondWord = words[1].toLowerCase();
|
|
297
|
-
const subcommands = COMMAND_SUBCOMMANDS.get(firstWord);
|
|
298
|
-
if (subcommands && subcommands.has(secondWord)) {
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
832
|
+
const trimmed = input.trim();
|
|
833
|
+
const firstWord = words[0]?.toLowerCase() || "";
|
|
834
|
+
const hasFlags = /\s-[a-zA-Z]|\s--[a-zA-Z]/.test(input) || words.length >= 2 && /^-[a-zA-Z]/.test(words[1]);
|
|
835
|
+
const hasOperators = /(\s\|\s)|(\s>\s)|(\s>>\s)|(\s<\s)|(\s&&\s)|(\s\|\|\s)|(;)/.test(input);
|
|
836
|
+
const hasVarAssign = /^[a-zA-Z_][a-zA-Z0-9_]*=[^ ]/.test(input) || /\s[a-zA-Z_][a-zA-Z0-9_]*=[^ ]/.test(input);
|
|
837
|
+
const hasQuotedWithFlag = /\s-[a-zA-Z]+\s+["']/.test(input) || /\s--[a-zA-Z-]+[=\s]+["']/.test(input);
|
|
838
|
+
const hasPathPattern = /^[.~]?\/|^\.\.\/|\s[.~]?\/|\s\.\.\//.test(input);
|
|
839
|
+
const hasWindowsPath = /^[a-zA-Z]:\\|\\s[a-zA-Z]:\\/.test(input);
|
|
840
|
+
const hasFileRedirect = /[<>]\s*[a-zA-Z0-9_./-]+/.test(input);
|
|
841
|
+
const hasEnvVar = /\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{[^}]+\}|%[a-zA-Z_][a-zA-Z0-9_]*%/.test(input);
|
|
842
|
+
const hasExitCode = /^(exit|return|break|continue)\s+\d+$/.test(trimmed);
|
|
843
|
+
const hasBackgroundJob = /\s*&\s*$/.test(trimmed);
|
|
844
|
+
const hasCommandChain = /;\s*[a-zA-Z]/.test(input);
|
|
845
|
+
const hasCommandSubstitution = /\$\([^)]+\)|`[^`]+`/.test(input);
|
|
846
|
+
const hasJobReference = /^(fg|bg|jobs|kill|disown)\s+%?\d+$/.test(trimmed);
|
|
847
|
+
const hasDirStackOp = /^(pushd|popd)\s+([+\-]\d+|[\/~.])/.test(trimmed);
|
|
848
|
+
const hasHistoryOp = /^history\s+(-[a-z]|\d+)/.test(trimmed);
|
|
849
|
+
const hasAliasDefinition = /^alias\s+[a-zA-Z_][a-zA-Z0-9_]*=/.test(trimmed);
|
|
850
|
+
const hasExportAssign = /^export\s+[A-Z_][A-Z0-9_]*=/.test(trimmed);
|
|
851
|
+
const hasCdPath = /^cd\s+[\/~.\-]/.test(trimmed);
|
|
852
|
+
if (words.length >= 2) {
|
|
853
|
+
const secondWord = words[1].toLowerCase();
|
|
854
|
+
const subcommands = COMMAND_SUBCOMMANDS.get(firstWord);
|
|
855
|
+
if (subcommands && subcommands.has(secondWord)) {
|
|
856
|
+
return true;
|
|
301
857
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
hasPathPattern || hasWindowsPath || hasFileRedirect || hasEnvVar ||
|
|
308
|
-
hasExitCode || hasBackgroundJob || hasCommandChain || hasCommandSubstitution ||
|
|
309
|
-
hasJobReference || hasDirStackOp || hasHistoryOp || hasAliasDefinition ||
|
|
310
|
-
hasExportAssign || hasCdPath;
|
|
858
|
+
}
|
|
859
|
+
if (words.length === 1 && SHELL_BUILTINS.has(firstWord)) {
|
|
860
|
+
return true;
|
|
861
|
+
}
|
|
862
|
+
return hasFlags || hasOperators || hasVarAssign || hasQuotedWithFlag || hasPathPattern || hasWindowsPath || hasFileRedirect || hasEnvVar || hasExitCode || hasBackgroundJob || hasCommandChain || hasCommandSubstitution || hasJobReference || hasDirStackOp || hasHistoryOp || hasAliasDefinition || hasExportAssign || hasCdPath;
|
|
311
863
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Disambiguate ambiguous commands based on context
|
|
314
|
-
*/
|
|
315
864
|
function disambiguateCommand(input, words) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
865
|
+
const firstWord = words[0].toLowerCase();
|
|
866
|
+
if (hasCommandSyntax(input, words)) {
|
|
867
|
+
return "command";
|
|
868
|
+
}
|
|
869
|
+
if (looksLikeNaturalLanguage(words)) {
|
|
870
|
+
return "ai";
|
|
871
|
+
}
|
|
872
|
+
if (firstWord === "make") {
|
|
873
|
+
const makeSubcommands = COMMAND_SUBCOMMANDS.get("make");
|
|
874
|
+
if (words.length >= 2 && makeSubcommands?.has(words[1].toLowerCase())) {
|
|
875
|
+
return "command";
|
|
324
876
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
// "make build", "make clean", "make all" - valid Makefile targets
|
|
328
|
-
const makeSubcommands = COMMAND_SUBCOMMANDS.get('make');
|
|
329
|
-
if (words.length >= 2 && makeSubcommands?.has(words[1].toLowerCase())) {
|
|
330
|
-
return 'command';
|
|
331
|
-
}
|
|
332
|
-
// "make something" where something is a single word could be a target
|
|
333
|
-
if (words.length === 2 && /^[a-z0-9_-]+$/i.test(words[1])) {
|
|
334
|
-
return 'command';
|
|
335
|
-
}
|
|
336
|
-
// Otherwise, likely natural language ("make it work", "make a file")
|
|
337
|
-
return 'ai';
|
|
877
|
+
if (words.length === 2 && /^[a-z0-9_-]+$/i.test(words[1])) {
|
|
878
|
+
return "command";
|
|
338
879
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
// "which libraries have I used" - natural language
|
|
346
|
-
if (words.length > 2) {
|
|
347
|
-
return 'ai';
|
|
348
|
-
}
|
|
880
|
+
return "ai";
|
|
881
|
+
}
|
|
882
|
+
if (firstWord === "which") {
|
|
883
|
+
if (words.length === 2 && /^[a-z0-9_.-]+$/i.test(words[1])) {
|
|
884
|
+
return "command";
|
|
349
885
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
// "find . -name" or "find /path" - command
|
|
353
|
-
if (words.length >= 2 && (words[1].startsWith('.') || words[1].startsWith('/') || words[1].startsWith('-'))) {
|
|
354
|
-
return 'command';
|
|
355
|
-
}
|
|
356
|
-
// "find all bugs" - natural language
|
|
357
|
-
if (words.length > 2) {
|
|
358
|
-
return 'ai';
|
|
359
|
-
}
|
|
886
|
+
if (words.length > 2) {
|
|
887
|
+
return "ai";
|
|
360
888
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return 'command';
|
|
366
|
-
}
|
|
367
|
-
// "export the data" - natural language
|
|
368
|
-
return 'ai';
|
|
889
|
+
}
|
|
890
|
+
if (firstWord === "find") {
|
|
891
|
+
if (words.length >= 2 && (words[1].startsWith(".") || words[1].startsWith("/") || words[1].startsWith("-"))) {
|
|
892
|
+
return "command";
|
|
369
893
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
// These are more often natural language unless they have specific patterns
|
|
373
|
-
// "run npm install" - could be shorthand for script runner
|
|
374
|
-
// "run this code" - natural language
|
|
375
|
-
// "start the server" - ambiguous but likely natural language
|
|
376
|
-
// "test the api" - natural language
|
|
377
|
-
if (words.length >= 2) {
|
|
378
|
-
// If followed by a known command, treat as command
|
|
379
|
-
if (DEFINITE_COMMANDS.has(words[1].toLowerCase())) {
|
|
380
|
-
return 'command';
|
|
381
|
-
}
|
|
382
|
-
// If followed by natural language markers, treat as AI
|
|
383
|
-
if (NATURAL_LANGUAGE_MARKERS.has(words[1].toLowerCase())) {
|
|
384
|
-
return 'ai';
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
// Default to AI for these ambiguous words
|
|
388
|
-
return 'ai';
|
|
894
|
+
if (words.length > 2) {
|
|
895
|
+
return "ai";
|
|
389
896
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (words.length
|
|
393
|
-
|
|
897
|
+
}
|
|
898
|
+
if (firstWord === "export") {
|
|
899
|
+
if (words.length >= 2 && /^[A-Z_][A-Z0-9_]*/.test(words[1])) {
|
|
900
|
+
return "command";
|
|
394
901
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
902
|
+
return "ai";
|
|
903
|
+
}
|
|
904
|
+
if (["run", "start", "stop", "test"].includes(firstWord)) {
|
|
905
|
+
if (words.length >= 2) {
|
|
906
|
+
if (DEFINITE_COMMANDS.has(words[1].toLowerCase())) {
|
|
907
|
+
return "command";
|
|
908
|
+
}
|
|
909
|
+
if (NATURAL_LANGUAGE_MARKERS.has(words[1].toLowerCase())) {
|
|
910
|
+
return "ai";
|
|
911
|
+
}
|
|
398
912
|
}
|
|
399
|
-
|
|
400
|
-
|
|
913
|
+
return "ai";
|
|
914
|
+
}
|
|
915
|
+
if (words.length === 1) {
|
|
916
|
+
return "command";
|
|
917
|
+
}
|
|
918
|
+
if (words.length === 2 && /^[a-z0-9_.-]+$/i.test(words[1]) && !NATURAL_LANGUAGE_MARKERS.has(words[1].toLowerCase())) {
|
|
919
|
+
return "command";
|
|
920
|
+
}
|
|
921
|
+
return "ai";
|
|
401
922
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
* 6. Ambiguous Command Disambiguation: Context-aware analysis
|
|
412
|
-
* 7. Natural Language Detection: Sentence structure analysis
|
|
413
|
-
* 8. Fallback: Multi-word without command syntax -> AI
|
|
414
|
-
*
|
|
415
|
-
* @param input The user input string
|
|
416
|
-
* @returns 'command' | 'ai'
|
|
417
|
-
*/
|
|
418
|
-
export function detectIntent(input) {
|
|
419
|
-
const trimmed = input.trim();
|
|
420
|
-
if (!trimmed) {
|
|
421
|
-
return 'ai'; // Default to AI for empty/whitespace
|
|
422
|
-
}
|
|
423
|
-
// Check 0 - Slash Commands (Highest Priority)
|
|
424
|
-
if (trimmed.startsWith('/')) {
|
|
425
|
-
// Extract command name (remove '/' and take first word)
|
|
426
|
-
const commandName = trimmed.slice(1).split(/\s+/)[0].toLowerCase();
|
|
427
|
-
if (SLASH_COMMANDS.has(commandName)) {
|
|
428
|
-
return 'ai';
|
|
429
|
-
}
|
|
430
|
-
// If starts with '/' but not a valid slash command, assume it's a path -> Command
|
|
431
|
-
return 'command';
|
|
432
|
-
}
|
|
433
|
-
// Check 1 - Explicit Prefixes
|
|
434
|
-
if (trimmed.startsWith('?'))
|
|
435
|
-
return 'ai';
|
|
436
|
-
if (trimmed.startsWith('.') || trimmed.startsWith('$') || trimmed.startsWith('~'))
|
|
437
|
-
return 'command';
|
|
438
|
-
// Parse words for analysis
|
|
439
|
-
const words = trimmed.split(/\s+/);
|
|
440
|
-
const firstWord = words[0].toLowerCase();
|
|
441
|
-
// Check 2 - Strong AI Indicators (check BEFORE command matching)
|
|
442
|
-
const isQuestion = trimmed.endsWith('?');
|
|
443
|
-
const startsWithAIKeyword = AI_KEYWORDS.has(firstWord);
|
|
444
|
-
if (startsWithAIKeyword) {
|
|
445
|
-
// If starts with AI keyword, it's almost always AI
|
|
446
|
-
// Exception: if it has strong command syntax, it might still be a command
|
|
447
|
-
if (!hasCommandSyntax(trimmed, words)) {
|
|
448
|
-
return 'ai';
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
if (isQuestion) {
|
|
452
|
-
// Questions are almost always AI
|
|
453
|
-
// Exception: rare case of command with ? (like "ls ?*.txt" - but this is uncommon)
|
|
454
|
-
if (!hasCommandSyntax(trimmed, words)) {
|
|
455
|
-
return 'ai';
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
// Check 3 - Strong Command Syntax (before command name matching)
|
|
459
|
-
if (hasCommandSyntax(trimmed, words)) {
|
|
460
|
-
return 'command';
|
|
461
|
-
}
|
|
462
|
-
// Check 4 - Definite Commands (non-ambiguous command names)
|
|
463
|
-
if (DEFINITE_COMMANDS.has(firstWord)) {
|
|
464
|
-
// Special handling for shell built-ins that might be followed by natural language
|
|
465
|
-
// e.g., "exit" is a command, but "exit the application" is AI
|
|
466
|
-
if (SHELL_BUILTINS.has(firstWord) && words.length > 1) {
|
|
467
|
-
// Check if followed by natural language markers
|
|
468
|
-
const secondWord = words[1].toLowerCase();
|
|
469
|
-
if (NATURAL_LANGUAGE_MARKERS.has(secondWord)) {
|
|
470
|
-
return 'ai';
|
|
471
|
-
}
|
|
472
|
-
// Check for "exit/clear/history the ..." pattern
|
|
473
|
-
if (['the', 'this', 'that', 'my', 'your', 'our', 'all'].includes(secondWord)) {
|
|
474
|
-
return 'ai';
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
return 'command';
|
|
478
|
-
}
|
|
479
|
-
// Check 4.5 - Custom Commands (user-defined terminal commands)
|
|
480
|
-
// Load custom commands synchronously for fast detection
|
|
481
|
-
const customCommandsManager = CustomCommandsManager.getInstance();
|
|
482
|
-
customCommandsManager.loadSync();
|
|
483
|
-
if (customCommandsManager.hasCommand(firstWord)) {
|
|
484
|
-
return 'command';
|
|
485
|
-
}
|
|
486
|
-
// Check 5 - Ambiguous Commands (need disambiguation)
|
|
487
|
-
if (AMBIGUOUS_COMMANDS.has(firstWord)) {
|
|
488
|
-
return disambiguateCommand(trimmed, words);
|
|
923
|
+
function detectIntent(input) {
|
|
924
|
+
const trimmed = input.trim();
|
|
925
|
+
if (!trimmed) {
|
|
926
|
+
return "ai";
|
|
927
|
+
}
|
|
928
|
+
if (trimmed.startsWith("/")) {
|
|
929
|
+
const commandName = trimmed.slice(1).split(/\s+/)[0].toLowerCase();
|
|
930
|
+
if (SLASH_COMMANDS.has(commandName)) {
|
|
931
|
+
return "ai";
|
|
489
932
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
933
|
+
return "command";
|
|
934
|
+
}
|
|
935
|
+
if (trimmed.startsWith("?")) return "ai";
|
|
936
|
+
if (trimmed.startsWith(".") || trimmed.startsWith("$") || trimmed.startsWith("~")) return "command";
|
|
937
|
+
const words = trimmed.split(/\s+/);
|
|
938
|
+
const firstWord = words[0].toLowerCase();
|
|
939
|
+
const isQuestion = trimmed.endsWith("?");
|
|
940
|
+
const startsWithAIKeyword = AI_KEYWORDS.has(firstWord);
|
|
941
|
+
if (startsWithAIKeyword) {
|
|
942
|
+
if (!hasCommandSyntax(trimmed, words)) {
|
|
943
|
+
return "ai";
|
|
494
944
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
945
|
+
}
|
|
946
|
+
if (isQuestion) {
|
|
947
|
+
if (!hasCommandSyntax(trimmed, words)) {
|
|
948
|
+
return "ai";
|
|
498
949
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
950
|
+
}
|
|
951
|
+
if (hasCommandSyntax(trimmed, words)) {
|
|
952
|
+
return "command";
|
|
953
|
+
}
|
|
954
|
+
if (DEFINITE_COMMANDS.has(firstWord)) {
|
|
955
|
+
if (SHELL_BUILTINS.has(firstWord) && words.length > 1) {
|
|
956
|
+
const secondWord = words[1].toLowerCase();
|
|
957
|
+
if (NATURAL_LANGUAGE_MARKERS.has(secondWord)) {
|
|
958
|
+
return "ai";
|
|
959
|
+
}
|
|
960
|
+
if (["the", "this", "that", "my", "your", "our", "all"].includes(secondWord)) {
|
|
961
|
+
return "ai";
|
|
962
|
+
}
|
|
506
963
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
964
|
+
return "command";
|
|
965
|
+
}
|
|
966
|
+
const customCommandsManager = CustomCommandsManager.getInstance();
|
|
967
|
+
customCommandsManager.loadSync();
|
|
968
|
+
if (customCommandsManager.hasCommand(firstWord)) {
|
|
969
|
+
return "command";
|
|
970
|
+
}
|
|
971
|
+
if (AMBIGUOUS_COMMANDS.has(firstWord)) {
|
|
972
|
+
return disambiguateCommand(trimmed, words);
|
|
973
|
+
}
|
|
974
|
+
if ((trimmed.includes("/") || trimmed.includes("\\")) && !trimmed.includes(" ")) {
|
|
975
|
+
return "command";
|
|
976
|
+
}
|
|
977
|
+
if (looksLikeNaturalLanguage(words)) {
|
|
978
|
+
return "ai";
|
|
979
|
+
}
|
|
980
|
+
if (words.length === 1) {
|
|
981
|
+
if (trimmed.includes(".")) return "command";
|
|
982
|
+
return "ai";
|
|
983
|
+
}
|
|
984
|
+
return "ai";
|
|
510
985
|
}
|
|
986
|
+
export {
|
|
987
|
+
detectIntent
|
|
988
|
+
};
|
|
511
989
|
//# sourceMappingURL=input-classifier.js.map
|