centaurus-cli 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/types.js +0 -1
- package/dist/ai/types.js.map +1 -1
- package/dist/cli-adapter.js +5047 -5158
- package/dist/cli-adapter.js.map +1 -1
- package/dist/commands/CommandParser.js +372 -315
- package/dist/commands/CommandParser.js.map +1 -1
- package/dist/config/build-config.js +11 -42
- package/dist/config/build-config.js.map +1 -1
- package/dist/config/defaultConfig.js +94 -82
- package/dist/config/defaultConfig.js.map +1 -1
- package/dist/config/manager.js +144 -160
- package/dist/config/manager.js.map +1 -1
- package/dist/config/mcp-config-manager.js +411 -364
- package/dist/config/mcp-config-manager.js.map +1 -1
- package/dist/config/models.js +118 -185
- package/dist/config/models.js.map +1 -1
- package/dist/config/slash-commands.js +186 -184
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/config/types.js +33 -26
- package/dist/config/types.js.map +1 -1
- package/dist/context/command-detector.js +63 -67
- package/dist/context/command-detector.js.map +1 -1
- package/dist/context/context-manager.js +533 -518
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/handlers/docker-handler.js +518 -576
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.js +1050 -1109
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/handlers/wsl-handler.js +558 -630
- package/dist/context/handlers/wsl-handler.js.map +1 -1
- package/dist/context/index.js +42 -6
- package/dist/context/index.js.map +1 -1
- package/dist/context/subshell-handler.js +0 -4
- package/dist/context/subshell-handler.js.map +1 -1
- package/dist/context/types.js +20 -31
- package/dist/context/types.js.map +1 -1
- package/dist/hooks/useConnectivity.js +13 -10
- package/dist/hooks/useConnectivity.js.map +1 -1
- package/dist/hooks/useTerminalDimensions.js +67 -79
- package/dist/hooks/useTerminalDimensions.js.map +1 -1
- package/dist/index.js +228 -251
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcp-command-handler.js +297 -260
- package/dist/mcp/mcp-command-handler.js.map +1 -1
- package/dist/mcp/mcp-server-manager.js +139 -155
- package/dist/mcp/mcp-server-manager.js.map +1 -1
- package/dist/mcp/mcp-tool-wrapper.js +74 -94
- package/dist/mcp/mcp-tool-wrapper.js.map +1 -1
- package/dist/services/ai-autocomplete-agent.js +169 -181
- package/dist/services/ai-autocomplete-agent.js.map +1 -1
- package/dist/services/ai-context-injector.js +180 -93
- package/dist/services/ai-context-injector.js.map +1 -1
- package/dist/services/ai-service-client.js +513 -456
- package/dist/services/ai-service-client.js.map +1 -1
- package/dist/services/api-client.js +443 -441
- package/dist/services/api-client.js.map +1 -1
- package/dist/services/auth-handler.js +162 -198
- package/dist/services/auth-handler.js.map +1 -1
- package/dist/services/background-task-manager.js +258 -282
- package/dist/services/background-task-manager.js.map +1 -1
- package/dist/services/checkpoint-manager.js +1526 -1512
- package/dist/services/checkpoint-manager.js.map +1 -1
- package/dist/services/clipboard-service.js +151 -200
- package/dist/services/clipboard-service.js.map +1 -1
- package/dist/services/connectivity-manager.js +63 -65
- package/dist/services/connectivity-manager.js.map +1 -1
- package/dist/services/conversation-manager.js +118 -121
- package/dist/services/conversation-manager.js.map +1 -1
- package/dist/services/environment-context-injector.js +160 -187
- package/dist/services/environment-context-injector.js.map +1 -1
- package/dist/services/fast-context-agent.js +203 -243
- package/dist/services/fast-context-agent.js.map +1 -1
- package/dist/services/input-detection-agent.js +190 -202
- package/dist/services/input-detection-agent.js.map +1 -1
- package/dist/services/input-requirement-detector.js +155 -189
- package/dist/services/input-requirement-detector.js.map +1 -1
- package/dist/services/local-chat-storage.js +342 -365
- package/dist/services/local-chat-storage.js.map +1 -1
- package/dist/services/monitored-shell-manager.js +225 -233
- package/dist/services/monitored-shell-manager.js.map +1 -1
- package/dist/services/ollama-service.js +293 -310
- package/dist/services/ollama-service.js.map +1 -1
- package/dist/services/rules-storage.js +142 -0
- package/dist/services/rules-storage.js.map +1 -0
- package/dist/services/session-quota-manager.js +219 -235
- package/dist/services/session-quota-manager.js.map +1 -1
- package/dist/services/shell-input-agent.js +299 -334
- package/dist/services/shell-input-agent.js.map +1 -1
- package/dist/services/sub-agent-manager.js +459 -501
- package/dist/services/sub-agent-manager.js.map +1 -1
- package/dist/services/warpify-detector.js +133 -183
- package/dist/services/warpify-detector.js.map +1 -1
- package/dist/services/workflow-storage.js +202 -217
- package/dist/services/workflow-storage.js.map +1 -1
- package/dist/test-ssh-handler.js +148 -193
- package/dist/test-ssh-handler.js.map +1 -1
- package/dist/tools/add-mcp.js +161 -0
- package/dist/tools/add-mcp.js.map +1 -0
- package/dist/tools/background-command.js +240 -273
- package/dist/tools/background-command.js.map +1 -1
- package/dist/tools/command.js +447 -440
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/create-image.js +172 -202
- package/dist/tools/create-image.js.map +1 -1
- package/dist/tools/enter-remote-session.js +169 -215
- package/dist/tools/enter-remote-session.js.map +1 -1
- package/dist/tools/fast-context.js +60 -67
- package/dist/tools/fast-context.js.map +1 -1
- package/dist/tools/file-ops.js +601 -572
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/find-files.js +262 -303
- package/dist/tools/find-files.js.map +1 -1
- package/dist/tools/get-diff.js +423 -406
- package/dist/tools/get-diff.js.map +1 -1
- package/dist/tools/grep-search.js +966 -948
- package/dist/tools/grep-search.js.map +1 -1
- package/dist/tools/inspect-symbol.js +308 -323
- package/dist/tools/inspect-symbol.js.map +1 -1
- package/dist/tools/plan-mode.js +459 -503
- package/dist/tools/plan-mode.js.map +1 -1
- package/dist/tools/read-binary-file.js +160 -190
- package/dist/tools/read-binary-file.js.map +1 -1
- package/dist/tools/registry.js +100 -84
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/reproduce_issue.js +170 -151
- package/dist/tools/reproduce_issue.js.map +1 -1
- package/dist/tools/sub-agent.js +223 -228
- package/dist/tools/sub-agent.js.map +1 -1
- package/dist/tools/task-complete.js +28 -27
- package/dist/tools/task-complete.js.map +1 -1
- package/dist/tools/types.js +0 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/validation.js +96 -118
- package/dist/tools/validation.js.map +1 -1
- package/dist/tools/web-search.js +194 -194
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/workflow-tool.js +77 -82
- package/dist/tools/workflow-tool.js.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/rule.js +1 -0
- package/dist/types/rule.js.map +1 -0
- package/dist/types/workflow.js +0 -7
- package/dist/types/workflow.js.map +1 -1
- package/dist/ui/components/AgentTimer.js +24 -25
- package/dist/ui/components/AgentTimer.js.map +1 -1
- package/dist/ui/components/App.js +3266 -3263
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/AuthScreen.js +22 -34
- package/dist/ui/components/AuthScreen.js.map +1 -1
- package/dist/ui/components/AuthWelcomeScreen.js +30 -24
- package/dist/ui/components/AuthWelcomeScreen.js.map +1 -1
- package/dist/ui/components/Breadcrumbs.js +53 -82
- package/dist/ui/components/Breadcrumbs.js.map +1 -1
- package/dist/ui/components/CircularSelectInput.js +59 -67
- package/dist/ui/components/CircularSelectInput.js.map +1 -1
- package/dist/ui/components/ClipboardFileAutocomplete.js +78 -39
- package/dist/ui/components/ClipboardFileAutocomplete.js.map +1 -1
- package/dist/ui/components/CodeBlock.js +24 -42
- package/dist/ui/components/CodeBlock.js.map +1 -1
- package/dist/ui/components/ConfigViewer.js +18 -25
- package/dist/ui/components/ConfigViewer.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +49 -71
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/ConnectionStatusMessage.js +32 -83
- package/dist/ui/components/ConnectionStatusMessage.js.map +1 -1
- package/dist/ui/components/ContextWindowIndicator.js +34 -49
- package/dist/ui/components/ContextWindowIndicator.js.map +1 -1
- package/dist/ui/components/DetailedPlanReviewScreen.js +104 -106
- package/dist/ui/components/DetailedPlanReviewScreen.js.map +1 -1
- package/dist/ui/components/DiffViewer.js +68 -121
- package/dist/ui/components/DiffViewer.js.map +1 -1
- package/dist/ui/components/ErrorBoundary.js +40 -48
- package/dist/ui/components/ErrorBoundary.js.map +1 -1
- package/dist/ui/components/FileCreationPreview.js +29 -60
- package/dist/ui/components/FileCreationPreview.js.map +1 -1
- package/dist/ui/components/FileOperation.js +34 -29
- package/dist/ui/components/FileOperation.js.map +1 -1
- package/dist/ui/components/FileTagAutocomplete.js +55 -25
- package/dist/ui/components/FileTagAutocomplete.js.map +1 -1
- package/dist/ui/components/FontRecommendation.js.map +1 -1
- package/dist/ui/components/GitDiffBreadcrumb.js +29 -0
- package/dist/ui/components/GitDiffBreadcrumb.js.map +1 -0
- package/dist/ui/components/InputBox.js +1620 -2150
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.js +234 -352
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/KeyboardHelp.js +34 -35
- package/dist/ui/components/KeyboardHelp.js.map +1 -1
- package/dist/ui/components/LoadingIndicator.js +22 -25
- package/dist/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/ui/components/MCPAddScreen.js +40 -51
- package/dist/ui/components/MCPAddScreen.js.map +1 -1
- package/dist/ui/components/MCPListScreen.js +40 -48
- package/dist/ui/components/MCPListScreen.js.map +1 -1
- package/dist/ui/components/MCPServerListScreen.js +49 -56
- package/dist/ui/components/MCPServerListScreen.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +69 -96
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/MessageBox.js +66 -48
- package/dist/ui/components/MessageBox.js.map +1 -1
- package/dist/ui/components/MessageDisplay.js +150 -142
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/MonitorModeAIPanel.js +46 -65
- package/dist/ui/components/MonitorModeAIPanel.js.map +1 -1
- package/dist/ui/components/MultiLineInput.js +243 -277
- package/dist/ui/components/MultiLineInput.js.map +1 -1
- package/dist/ui/components/PasswordPrompt.js +37 -18
- package/dist/ui/components/PasswordPrompt.js.map +1 -1
- package/dist/ui/components/PlanAcceptedMessage.js +27 -38
- package/dist/ui/components/PlanAcceptedMessage.js.map +1 -1
- package/dist/ui/components/PlanReviewScreen.js +46 -50
- package/dist/ui/components/PlanReviewScreen.js.map +1 -1
- package/dist/ui/components/RulesEditorScreen.js +81 -0
- package/dist/ui/components/RulesEditorScreen.js.map +1 -0
- package/dist/ui/components/SelectPrompt.js +19 -8
- package/dist/ui/components/SelectPrompt.js.map +1 -1
- package/dist/ui/components/ShimmerText.js +44 -0
- package/dist/ui/components/ShimmerText.js.map +1 -0
- package/dist/ui/components/SlashCommandAutocomplete.js +49 -22
- package/dist/ui/components/SlashCommandAutocomplete.js.map +1 -1
- package/dist/ui/components/StatusBar.js +56 -87
- package/dist/ui/components/StatusBar.js.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +116 -99
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/TaskCompletedMessage.js +28 -23
- package/dist/ui/components/TaskCompletedMessage.js.map +1 -1
- package/dist/ui/components/TaskProgressIndicator.js +44 -70
- package/dist/ui/components/TaskProgressIndicator.js.map +1 -1
- package/dist/ui/components/ThinkingDisplay.js +44 -41
- package/dist/ui/components/ThinkingDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +772 -1326
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/ToolExecutionStatus.js +53 -84
- package/dist/ui/components/ToolExecutionStatus.js.map +1 -1
- package/dist/ui/components/ToolResult.js +22 -15
- package/dist/ui/components/ToolResult.js.map +1 -1
- package/dist/ui/components/VersionUpdatePrompt.js +88 -120
- package/dist/ui/components/VersionUpdatePrompt.js.map +1 -1
- package/dist/ui/components/WelcomeBanner.js +176 -26
- package/dist/ui/components/WelcomeBanner.js.map +1 -1
- package/dist/ui/components/WorkflowCreatorScreen.js +94 -161
- package/dist/ui/components/WorkflowCreatorScreen.js.map +1 -1
- package/dist/utils/ansi-encoder.js +30 -61
- package/dist/utils/ansi-encoder.js.map +1 -1
- package/dist/utils/chat-formatter.js +327 -305
- package/dist/utils/chat-formatter.js.map +1 -1
- package/dist/utils/command-history.js +152 -174
- package/dist/utils/command-history.js.map +1 -1
- package/dist/utils/context-sanitizer.js +49 -112
- package/dist/utils/context-sanitizer.js.map +1 -1
- package/dist/utils/conversation-logger.js +292 -324
- package/dist/utils/conversation-logger.js.map +1 -1
- package/dist/utils/custom-commands-manager.js +126 -131
- package/dist/utils/custom-commands-manager.js.map +1 -1
- package/dist/utils/editor-utils.js +732 -837
- package/dist/utils/editor-utils.js.map +1 -1
- package/dist/utils/file.js +174 -213
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/git-stats.js +169 -0
- package/dist/utils/git-stats.js.map +1 -0
- package/dist/utils/input-classifier.js +960 -482
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/logger.js +48 -73
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/markdown-parser.js +277 -310
- package/dist/utils/markdown-parser.js.map +1 -1
- package/dist/utils/rule-reference-resolver.js +54 -0
- package/dist/utils/rule-reference-resolver.js.map +1 -0
- package/dist/utils/shell.js +144 -156
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/state.js +23 -22
- package/dist/utils/state.js.map +1 -1
- package/dist/utils/syntax-checker.js +279 -327
- package/dist/utils/syntax-checker.js.map +1 -1
- package/dist/utils/terminal-output.js +199 -302
- package/dist/utils/terminal-output.js.map +1 -1
- package/dist/utils/text-clipboard.js +47 -70
- package/dist/utils/text-clipboard.js.map +1 -1
- package/dist/utils/unicode-sanitizer.js +134 -197
- package/dist/utils/unicode-sanitizer.js.map +1 -1
- package/dist/utils/version-checker.js +46 -56
- package/dist/utils/version-checker.js.map +1 -1
- package/package.json +6 -4
- package/dist/ai/types.d.ts +0 -20
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/cli-adapter.d.ts +0 -514
- package/dist/cli-adapter.d.ts.map +0 -1
- package/dist/commands/CommandParser.d.ts +0 -27
- package/dist/commands/CommandParser.d.ts.map +0 -1
- package/dist/config/build-config.d.ts +0 -42
- package/dist/config/build-config.d.ts.map +0 -1
- package/dist/config/defaultConfig.d.ts +0 -79
- package/dist/config/defaultConfig.d.ts.map +0 -1
- package/dist/config/manager.d.ts +0 -62
- package/dist/config/manager.d.ts.map +0 -1
- package/dist/config/mcp-config-manager.d.ts +0 -79
- package/dist/config/mcp-config-manager.d.ts.map +0 -1
- package/dist/config/models.d.ts +0 -83
- package/dist/config/models.d.ts.map +0 -1
- package/dist/config/slash-commands.d.ts +0 -23
- package/dist/config/slash-commands.d.ts.map +0 -1
- package/dist/config/types.d.ts +0 -35
- package/dist/config/types.d.ts.map +0 -1
- package/dist/context/command-detector.d.ts +0 -50
- package/dist/context/command-detector.d.ts.map +0 -1
- package/dist/context/context-manager.d.ts +0 -157
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/handlers/docker-handler.d.ts +0 -130
- package/dist/context/handlers/docker-handler.d.ts.map +0 -1
- package/dist/context/handlers/ssh-handler.d.ts +0 -201
- package/dist/context/handlers/ssh-handler.d.ts.map +0 -1
- package/dist/context/handlers/wsl-handler.d.ts +0 -146
- package/dist/context/handlers/wsl-handler.d.ts.map +0 -1
- package/dist/context/index.d.ts +0 -8
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/subshell-handler.d.ts +0 -165
- package/dist/context/subshell-handler.d.ts.map +0 -1
- package/dist/context/types.d.ts +0 -70
- package/dist/context/types.d.ts.map +0 -1
- package/dist/hooks/useConnectivity.d.ts +0 -2
- package/dist/hooks/useConnectivity.d.ts.map +0 -1
- package/dist/hooks/useTerminalDimensions.d.ts +0 -41
- package/dist/hooks/useTerminalDimensions.d.ts.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/mcp/mcp-command-handler.d.ts +0 -47
- package/dist/mcp/mcp-command-handler.d.ts.map +0 -1
- package/dist/mcp/mcp-server-manager.d.ts +0 -30
- package/dist/mcp/mcp-server-manager.d.ts.map +0 -1
- package/dist/mcp/mcp-tool-wrapper.d.ts +0 -12
- package/dist/mcp/mcp-tool-wrapper.d.ts.map +0 -1
- package/dist/services/ai-autocomplete-agent.d.ts +0 -39
- package/dist/services/ai-autocomplete-agent.d.ts.map +0 -1
- package/dist/services/ai-context-injector.d.ts +0 -41
- package/dist/services/ai-context-injector.d.ts.map +0 -1
- package/dist/services/ai-service-client.d.ts +0 -128
- package/dist/services/ai-service-client.d.ts.map +0 -1
- package/dist/services/api-client.d.ts +0 -353
- package/dist/services/api-client.d.ts.map +0 -1
- package/dist/services/auth-handler.d.ts +0 -30
- package/dist/services/auth-handler.d.ts.map +0 -1
- package/dist/services/background-task-manager.d.ts +0 -114
- package/dist/services/background-task-manager.d.ts.map +0 -1
- package/dist/services/checkpoint-manager.d.ts +0 -204
- package/dist/services/checkpoint-manager.d.ts.map +0 -1
- package/dist/services/clipboard-service.d.ts +0 -37
- package/dist/services/clipboard-service.d.ts.map +0 -1
- package/dist/services/connectivity-manager.d.ts +0 -18
- package/dist/services/connectivity-manager.d.ts.map +0 -1
- package/dist/services/conversation-manager.d.ts +0 -73
- package/dist/services/conversation-manager.d.ts.map +0 -1
- package/dist/services/environment-context-injector.d.ts +0 -69
- package/dist/services/environment-context-injector.d.ts.map +0 -1
- package/dist/services/fast-context-agent.d.ts +0 -12
- package/dist/services/fast-context-agent.d.ts.map +0 -1
- package/dist/services/input-detection-agent.d.ts +0 -40
- package/dist/services/input-detection-agent.d.ts.map +0 -1
- package/dist/services/input-requirement-detector.d.ts +0 -28
- package/dist/services/input-requirement-detector.d.ts.map +0 -1
- package/dist/services/local-chat-storage.d.ts +0 -182
- package/dist/services/local-chat-storage.d.ts.map +0 -1
- package/dist/services/monitored-shell-manager.d.ts +0 -120
- package/dist/services/monitored-shell-manager.d.ts.map +0 -1
- package/dist/services/ollama-service.d.ts +0 -197
- package/dist/services/ollama-service.d.ts.map +0 -1
- package/dist/services/session-quota-manager.d.ts +0 -101
- package/dist/services/session-quota-manager.d.ts.map +0 -1
- package/dist/services/shell-input-agent.d.ts +0 -89
- package/dist/services/shell-input-agent.d.ts.map +0 -1
- package/dist/services/sub-agent-manager.d.ts +0 -140
- package/dist/services/sub-agent-manager.d.ts.map +0 -1
- package/dist/services/warpify-detector.d.ts +0 -43
- package/dist/services/warpify-detector.d.ts.map +0 -1
- package/dist/services/workflow-storage.d.ts +0 -72
- package/dist/services/workflow-storage.d.ts.map +0 -1
- package/dist/test-ssh-handler.d.ts +0 -8
- package/dist/test-ssh-handler.d.ts.map +0 -1
- package/dist/tools/background-command.d.ts +0 -11
- package/dist/tools/background-command.d.ts.map +0 -1
- package/dist/tools/command.d.ts +0 -3
- package/dist/tools/command.d.ts.map +0 -1
- package/dist/tools/create-image.d.ts +0 -10
- package/dist/tools/create-image.d.ts.map +0 -1
- package/dist/tools/enter-remote-session.d.ts +0 -48
- package/dist/tools/enter-remote-session.d.ts.map +0 -1
- package/dist/tools/fast-context.d.ts +0 -3
- package/dist/tools/fast-context.d.ts.map +0 -1
- package/dist/tools/file-ops.d.ts +0 -7
- package/dist/tools/file-ops.d.ts.map +0 -1
- package/dist/tools/find-files.d.ts +0 -49
- package/dist/tools/find-files.d.ts.map +0 -1
- package/dist/tools/get-diff.d.ts +0 -14
- package/dist/tools/get-diff.d.ts.map +0 -1
- package/dist/tools/grep-search.d.ts +0 -155
- package/dist/tools/grep-search.d.ts.map +0 -1
- package/dist/tools/inspect-symbol.d.ts +0 -32
- package/dist/tools/inspect-symbol.d.ts.map +0 -1
- package/dist/tools/plan-mode.d.ts +0 -140
- package/dist/tools/plan-mode.d.ts.map +0 -1
- package/dist/tools/read-binary-file.d.ts +0 -10
- package/dist/tools/read-binary-file.d.ts.map +0 -1
- package/dist/tools/registry.d.ts +0 -31
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/reproduce_issue.d.ts +0 -2
- package/dist/tools/reproduce_issue.d.ts.map +0 -1
- package/dist/tools/sub-agent.d.ts +0 -9
- package/dist/tools/sub-agent.d.ts.map +0 -1
- package/dist/tools/task-complete.d.ts +0 -3
- package/dist/tools/task-complete.d.ts.map +0 -1
- package/dist/tools/types.d.ts +0 -40
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/validation.d.ts +0 -47
- package/dist/tools/validation.d.ts.map +0 -1
- package/dist/tools/web-search.d.ts +0 -24
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/workflow-tool.d.ts +0 -11
- package/dist/tools/workflow-tool.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -123
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/workflow.d.ts +0 -110
- package/dist/types/workflow.d.ts.map +0 -1
- package/dist/ui/components/AgentTimer.d.ts +0 -7
- package/dist/ui/components/AgentTimer.d.ts.map +0 -1
- package/dist/ui/components/App.d.ts +0 -197
- package/dist/ui/components/App.d.ts.map +0 -1
- package/dist/ui/components/AuthScreen.d.ts +0 -8
- package/dist/ui/components/AuthScreen.d.ts.map +0 -1
- package/dist/ui/components/AuthWelcomeScreen.d.ts +0 -8
- package/dist/ui/components/AuthWelcomeScreen.d.ts.map +0 -1
- package/dist/ui/components/Breadcrumbs.d.ts +0 -13
- package/dist/ui/components/Breadcrumbs.d.ts.map +0 -1
- package/dist/ui/components/CircularSelectInput.d.ts +0 -24
- package/dist/ui/components/CircularSelectInput.d.ts.map +0 -1
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts +0 -10
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/CodeBlock.d.ts +0 -9
- package/dist/ui/components/CodeBlock.d.ts.map +0 -1
- package/dist/ui/components/ConfigViewer.d.ts +0 -11
- package/dist/ui/components/ConfigViewer.d.ts.map +0 -1
- package/dist/ui/components/ConfirmPrompt.d.ts +0 -13
- package/dist/ui/components/ConfirmPrompt.d.ts.map +0 -1
- package/dist/ui/components/ConnectionStatusMessage.d.ts +0 -17
- package/dist/ui/components/ConnectionStatusMessage.d.ts.map +0 -1
- package/dist/ui/components/ContextWindowIndicator.d.ts +0 -8
- package/dist/ui/components/ContextWindowIndicator.d.ts.map +0 -1
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts +0 -17
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts.map +0 -1
- package/dist/ui/components/DiffViewer.d.ts +0 -9
- package/dist/ui/components/DiffViewer.d.ts.map +0 -1
- package/dist/ui/components/ErrorBoundary.d.ts +0 -17
- package/dist/ui/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/ui/components/FileCreationPreview.d.ts +0 -8
- package/dist/ui/components/FileCreationPreview.d.ts.map +0 -1
- package/dist/ui/components/FileOperation.d.ts +0 -10
- package/dist/ui/components/FileOperation.d.ts.map +0 -1
- package/dist/ui/components/FileTagAutocomplete.d.ts +0 -11
- package/dist/ui/components/FileTagAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/FontRecommendation.d.ts +0 -1
- package/dist/ui/components/FontRecommendation.d.ts.map +0 -1
- package/dist/ui/components/InputBox.d.ts +0 -42
- package/dist/ui/components/InputBox.d.ts.map +0 -1
- package/dist/ui/components/InteractiveShell.d.ts +0 -30
- package/dist/ui/components/InteractiveShell.d.ts.map +0 -1
- package/dist/ui/components/KeyboardHelp.d.ts +0 -7
- package/dist/ui/components/KeyboardHelp.d.ts.map +0 -1
- package/dist/ui/components/LoadingIndicator.d.ts +0 -3
- package/dist/ui/components/LoadingIndicator.d.ts.map +0 -1
- package/dist/ui/components/MCPAddScreen.d.ts +0 -13
- package/dist/ui/components/MCPAddScreen.d.ts.map +0 -1
- package/dist/ui/components/MCPListScreen.d.ts +0 -17
- package/dist/ui/components/MCPListScreen.d.ts.map +0 -1
- package/dist/ui/components/MCPServerListScreen.d.ts +0 -16
- package/dist/ui/components/MCPServerListScreen.d.ts.map +0 -1
- package/dist/ui/components/MarkdownRenderer.d.ts +0 -8
- package/dist/ui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/ui/components/MessageBox.d.ts +0 -10
- package/dist/ui/components/MessageBox.d.ts.map +0 -1
- package/dist/ui/components/MessageDisplay.d.ts +0 -14
- package/dist/ui/components/MessageDisplay.d.ts.map +0 -1
- package/dist/ui/components/MonitorModeAIPanel.d.ts +0 -23
- package/dist/ui/components/MonitorModeAIPanel.d.ts.map +0 -1
- package/dist/ui/components/MultiLineInput.d.ts +0 -13
- package/dist/ui/components/MultiLineInput.d.ts.map +0 -1
- package/dist/ui/components/PasswordPrompt.d.ts +0 -9
- package/dist/ui/components/PasswordPrompt.d.ts.map +0 -1
- package/dist/ui/components/PlanAcceptedMessage.d.ts +0 -20
- package/dist/ui/components/PlanAcceptedMessage.d.ts.map +0 -1
- package/dist/ui/components/PlanReviewScreen.d.ts +0 -14
- package/dist/ui/components/PlanReviewScreen.d.ts.map +0 -1
- package/dist/ui/components/SelectPrompt.d.ts +0 -12
- package/dist/ui/components/SelectPrompt.d.ts.map +0 -1
- package/dist/ui/components/SlashCommandAutocomplete.d.ts +0 -13
- package/dist/ui/components/SlashCommandAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/StatusBar.d.ts +0 -14
- package/dist/ui/components/StatusBar.d.ts.map +0 -1
- package/dist/ui/components/StreamingMessageDisplay.d.ts +0 -15
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +0 -1
- package/dist/ui/components/TaskCompletedMessage.d.ts +0 -14
- package/dist/ui/components/TaskCompletedMessage.d.ts.map +0 -1
- package/dist/ui/components/TaskProgressIndicator.d.ts +0 -18
- package/dist/ui/components/TaskProgressIndicator.d.ts.map +0 -1
- package/dist/ui/components/ThinkingDisplay.d.ts +0 -15
- package/dist/ui/components/ThinkingDisplay.d.ts.map +0 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts +0 -8
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +0 -1
- package/dist/ui/components/ToolExecutionStatus.d.ts +0 -10
- package/dist/ui/components/ToolExecutionStatus.d.ts.map +0 -1
- package/dist/ui/components/ToolResult.d.ts +0 -10
- package/dist/ui/components/ToolResult.d.ts.map +0 -1
- package/dist/ui/components/VersionUpdatePrompt.d.ts +0 -9
- package/dist/ui/components/VersionUpdatePrompt.d.ts.map +0 -1
- package/dist/ui/components/WelcomeBanner.d.ts +0 -3
- package/dist/ui/components/WelcomeBanner.d.ts.map +0 -1
- package/dist/ui/components/WorkflowCreatorScreen.d.ts +0 -25
- package/dist/ui/components/WorkflowCreatorScreen.d.ts.map +0 -1
- package/dist/utils/ansi-encoder.d.ts +0 -7
- package/dist/utils/ansi-encoder.d.ts.map +0 -1
- package/dist/utils/chat-formatter.d.ts +0 -12
- package/dist/utils/chat-formatter.d.ts.map +0 -1
- package/dist/utils/command-history.d.ts +0 -24
- package/dist/utils/command-history.d.ts.map +0 -1
- package/dist/utils/context-sanitizer.d.ts +0 -50
- package/dist/utils/context-sanitizer.d.ts.map +0 -1
- package/dist/utils/conversation-logger.d.ts +0 -142
- package/dist/utils/conversation-logger.d.ts.map +0 -1
- package/dist/utils/custom-commands-manager.d.ts +0 -59
- package/dist/utils/custom-commands-manager.d.ts.map +0 -1
- package/dist/utils/editor-utils.d.ts +0 -101
- package/dist/utils/editor-utils.d.ts.map +0 -1
- package/dist/utils/file.d.ts +0 -61
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/input-classifier.d.ts +0 -25
- package/dist/utils/input-classifier.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -17
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/markdown-parser.d.ts +0 -60
- package/dist/utils/markdown-parser.d.ts.map +0 -1
- package/dist/utils/shell.d.ts +0 -47
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/state.d.ts +0 -13
- package/dist/utils/state.d.ts.map +0 -1
- package/dist/utils/syntax-checker.d.ts +0 -24
- package/dist/utils/syntax-checker.d.ts.map +0 -1
- package/dist/utils/terminal-output.d.ts +0 -25
- package/dist/utils/terminal-output.d.ts.map +0 -1
- package/dist/utils/text-clipboard.d.ts +0 -12
- package/dist/utils/text-clipboard.d.ts.map +0 -1
- package/dist/utils/unicode-sanitizer.d.ts +0 -44
- package/dist/utils/unicode-sanitizer.d.ts.map +0 -1
- package/dist/utils/version-checker.d.ts +0 -14
- package/dist/utils/version-checker.d.ts.map +0 -1
|
@@ -1,341 +1,326 @@
|
|
|
1
|
-
import * as fs from
|
|
2
|
-
import * as path from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
async execute(params, cwd) {
|
|
23
|
-
const { filePath } = params;
|
|
24
|
-
const fullPath = path.resolve(cwd, filePath);
|
|
25
|
-
// Check if file exists
|
|
26
|
-
try {
|
|
27
|
-
await fs.access(fullPath);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
throw new Error(`File not found: "${filePath}"\n` +
|
|
31
|
-
`Suggestion: Use find_files to locate the file first, or check the file path.`);
|
|
32
|
-
}
|
|
33
|
-
// Detect language from extension
|
|
34
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
35
|
-
const parser = this.languageParsers.find(p => p.extensions.includes(ext));
|
|
36
|
-
if (!parser) {
|
|
37
|
-
const supportedExts = this.languageParsers
|
|
38
|
-
.flatMap(p => p.extensions)
|
|
39
|
-
.join(', ');
|
|
40
|
-
throw new Error(`Unsupported file type: ${ext}\n` +
|
|
41
|
-
`Suggestion: inspect_symbol supports: ${supportedExts}`);
|
|
42
|
-
}
|
|
43
|
-
// Read file content
|
|
44
|
-
const content = await fs.readFile(fullPath, 'utf-8');
|
|
45
|
-
// Parse symbols
|
|
46
|
-
const allSymbols = parser.parse(content);
|
|
47
|
-
const truncated = allSymbols.length > this.MAX_SYMBOLS;
|
|
48
|
-
const symbols = allSymbols.slice(0, this.MAX_SYMBOLS);
|
|
49
|
-
return {
|
|
50
|
-
symbols,
|
|
51
|
-
filePath: this.normalizePath(filePath),
|
|
52
|
-
language: parser.name,
|
|
53
|
-
truncated,
|
|
54
|
-
};
|
|
1
|
+
import * as fs from "fs/promises";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
class InspectSymbolTool {
|
|
4
|
+
MAX_SYMBOLS = 100;
|
|
5
|
+
languageParsers = [
|
|
6
|
+
{
|
|
7
|
+
extensions: [".ts", ".tsx", ".js", ".jsx"],
|
|
8
|
+
name: "TypeScript/JavaScript",
|
|
9
|
+
parse: this.parseTypeScriptJavaScript.bind(this)
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
extensions: [".py"],
|
|
13
|
+
name: "Python",
|
|
14
|
+
parse: this.parsePython.bind(this)
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
extensions: [".java"],
|
|
18
|
+
name: "Java",
|
|
19
|
+
parse: this.parseJava.bind(this)
|
|
55
20
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (classMatch) {
|
|
68
|
-
currentClass = classMatch[3];
|
|
69
|
-
classDepth = this.getIndentLevel(line);
|
|
70
|
-
const signature = line.trim();
|
|
71
|
-
symbols.push({
|
|
72
|
-
name: classMatch[3],
|
|
73
|
-
type: 'class',
|
|
74
|
-
signature,
|
|
75
|
-
line: lineNumber,
|
|
76
|
-
});
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
// Reset class context when we exit the class
|
|
80
|
-
if (currentClass && line.trim() === '}' && this.getIndentLevel(line) === classDepth) {
|
|
81
|
-
currentClass = null;
|
|
82
|
-
}
|
|
83
|
-
// Interface declarations
|
|
84
|
-
const interfaceMatch = line.match(/^(export\s+)?interface\s+(\w+)/);
|
|
85
|
-
if (interfaceMatch) {
|
|
86
|
-
symbols.push({
|
|
87
|
-
name: interfaceMatch[2],
|
|
88
|
-
type: 'interface',
|
|
89
|
-
signature: line.trim(),
|
|
90
|
-
line: lineNumber,
|
|
91
|
-
});
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
// Type declarations
|
|
95
|
-
const typeMatch = line.match(/^(export\s+)?type\s+(\w+)/);
|
|
96
|
-
if (typeMatch) {
|
|
97
|
-
symbols.push({
|
|
98
|
-
name: typeMatch[2],
|
|
99
|
-
type: 'type',
|
|
100
|
-
signature: line.trim(),
|
|
101
|
-
line: lineNumber,
|
|
102
|
-
});
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
// Function declarations
|
|
106
|
-
const functionMatch = line.match(/^(export\s+)?(async\s+)?function\s+(\w+)\s*(\([^)]*\))/);
|
|
107
|
-
if (functionMatch) {
|
|
108
|
-
symbols.push({
|
|
109
|
-
name: functionMatch[3],
|
|
110
|
-
type: 'function',
|
|
111
|
-
signature: line.trim(),
|
|
112
|
-
line: lineNumber,
|
|
113
|
-
});
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
// Arrow function exports
|
|
117
|
-
const arrowMatch = line.match(/^export\s+const\s+(\w+)\s*=\s*(\([^)]*\))?\s*=>/);
|
|
118
|
-
if (arrowMatch) {
|
|
119
|
-
symbols.push({
|
|
120
|
-
name: arrowMatch[1],
|
|
121
|
-
type: 'export',
|
|
122
|
-
signature: line.trim(),
|
|
123
|
-
line: lineNumber,
|
|
124
|
-
});
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
// Const exports (non-arrow)
|
|
128
|
-
const constExportMatch = line.match(/^export\s+const\s+(\w+)/);
|
|
129
|
-
if (constExportMatch && !line.includes('=>')) {
|
|
130
|
-
symbols.push({
|
|
131
|
-
name: constExportMatch[1],
|
|
132
|
-
type: 'export',
|
|
133
|
-
signature: line.trim(),
|
|
134
|
-
line: lineNumber,
|
|
135
|
-
});
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
// Method declarations (inside classes)
|
|
139
|
-
if (currentClass) {
|
|
140
|
-
const methodMatch = line.match(/^\s+(public\s+|private\s+|protected\s+)?(static\s+)?(async\s+)?(\w+)\s*(\([^)]*\))/);
|
|
141
|
-
if (methodMatch && !line.includes('function') && methodMatch[4] !== 'if' && methodMatch[4] !== 'for' && methodMatch[4] !== 'while') {
|
|
142
|
-
symbols.push({
|
|
143
|
-
name: methodMatch[4],
|
|
144
|
-
type: 'method',
|
|
145
|
-
signature: line.trim(),
|
|
146
|
-
line: lineNumber,
|
|
147
|
-
parentClass: currentClass,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return symbols;
|
|
21
|
+
];
|
|
22
|
+
async execute(params, cwd) {
|
|
23
|
+
const { filePath } = params;
|
|
24
|
+
const fullPath = path.resolve(cwd, filePath);
|
|
25
|
+
try {
|
|
26
|
+
await fs.access(fullPath);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`File not found: "${filePath}"
|
|
30
|
+
Suggestion: Use find_files to locate the file first, or check the file path.`
|
|
31
|
+
);
|
|
153
32
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const classMatch = line.match(/^class\s+(\w+)(\([^)]*\))?:/);
|
|
163
|
-
if (classMatch) {
|
|
164
|
-
currentClass = classMatch[1];
|
|
165
|
-
symbols.push({
|
|
166
|
-
name: classMatch[1],
|
|
167
|
-
type: 'class',
|
|
168
|
-
signature: line.trim(),
|
|
169
|
-
line: lineNumber,
|
|
170
|
-
});
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
// Function definitions (top-level)
|
|
174
|
-
const functionMatch = line.match(/^def\s+(\w+)\s*(\([^)]*\))/);
|
|
175
|
-
if (functionMatch) {
|
|
176
|
-
currentClass = null; // Reset class context for top-level functions
|
|
177
|
-
symbols.push({
|
|
178
|
-
name: functionMatch[1],
|
|
179
|
-
type: 'function',
|
|
180
|
-
signature: line.trim(),
|
|
181
|
-
line: lineNumber,
|
|
182
|
-
});
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
// Method definitions (indented, inside classes)
|
|
186
|
-
const methodMatch = line.match(/^\s+def\s+(\w+)\s*(\([^)]*\))/);
|
|
187
|
-
if (methodMatch && currentClass) {
|
|
188
|
-
symbols.push({
|
|
189
|
-
name: methodMatch[1],
|
|
190
|
-
type: 'method',
|
|
191
|
-
signature: line.trim(),
|
|
192
|
-
line: lineNumber,
|
|
193
|
-
parentClass: currentClass,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return symbols;
|
|
33
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
34
|
+
const parser = this.languageParsers.find((p) => p.extensions.includes(ext));
|
|
35
|
+
if (!parser) {
|
|
36
|
+
const supportedExts = this.languageParsers.flatMap((p) => p.extensions).join(", ");
|
|
37
|
+
throw new Error(
|
|
38
|
+
`Unsupported file type: ${ext}
|
|
39
|
+
Suggestion: inspect_symbol supports: ${supportedExts}`
|
|
40
|
+
);
|
|
198
41
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
42
|
+
const content = await fs.readFile(fullPath, "utf-8");
|
|
43
|
+
const allSymbols = parser.parse(content);
|
|
44
|
+
const truncated = allSymbols.length > this.MAX_SYMBOLS;
|
|
45
|
+
const symbols = allSymbols.slice(0, this.MAX_SYMBOLS);
|
|
46
|
+
return {
|
|
47
|
+
symbols,
|
|
48
|
+
filePath: this.normalizePath(filePath),
|
|
49
|
+
language: parser.name,
|
|
50
|
+
truncated
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
parseTypeScriptJavaScript(content) {
|
|
54
|
+
const symbols = [];
|
|
55
|
+
const lines = content.split("\n");
|
|
56
|
+
let currentClass = null;
|
|
57
|
+
let classDepth = 0;
|
|
58
|
+
for (let i = 0; i < lines.length; i++) {
|
|
59
|
+
const line = lines[i];
|
|
60
|
+
const lineNumber = i + 1;
|
|
61
|
+
const classMatch = line.match(/^(export\s+)?(abstract\s+)?class\s+(\w+)(\s+extends\s+(\w+))?/);
|
|
62
|
+
if (classMatch) {
|
|
63
|
+
currentClass = classMatch[3];
|
|
64
|
+
classDepth = this.getIndentLevel(line);
|
|
65
|
+
const signature = line.trim();
|
|
66
|
+
symbols.push({
|
|
67
|
+
name: classMatch[3],
|
|
68
|
+
type: "class",
|
|
69
|
+
signature,
|
|
70
|
+
line: lineNumber
|
|
71
|
+
});
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (currentClass && line.trim() === "}" && this.getIndentLevel(line) === classDepth) {
|
|
75
|
+
currentClass = null;
|
|
76
|
+
}
|
|
77
|
+
const interfaceMatch = line.match(/^(export\s+)?interface\s+(\w+)/);
|
|
78
|
+
if (interfaceMatch) {
|
|
79
|
+
symbols.push({
|
|
80
|
+
name: interfaceMatch[2],
|
|
81
|
+
type: "interface",
|
|
82
|
+
signature: line.trim(),
|
|
83
|
+
line: lineNumber
|
|
84
|
+
});
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const typeMatch = line.match(/^(export\s+)?type\s+(\w+)/);
|
|
88
|
+
if (typeMatch) {
|
|
89
|
+
symbols.push({
|
|
90
|
+
name: typeMatch[2],
|
|
91
|
+
type: "type",
|
|
92
|
+
signature: line.trim(),
|
|
93
|
+
line: lineNumber
|
|
94
|
+
});
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const functionMatch = line.match(/^(export\s+)?(async\s+)?function\s+(\w+)\s*(\([^)]*\))/);
|
|
98
|
+
if (functionMatch) {
|
|
99
|
+
symbols.push({
|
|
100
|
+
name: functionMatch[3],
|
|
101
|
+
type: "function",
|
|
102
|
+
signature: line.trim(),
|
|
103
|
+
line: lineNumber
|
|
104
|
+
});
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const arrowMatch = line.match(/^export\s+const\s+(\w+)\s*=\s*(\([^)]*\))?\s*=>/);
|
|
108
|
+
if (arrowMatch) {
|
|
109
|
+
symbols.push({
|
|
110
|
+
name: arrowMatch[1],
|
|
111
|
+
type: "export",
|
|
112
|
+
signature: line.trim(),
|
|
113
|
+
line: lineNumber
|
|
114
|
+
});
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const constExportMatch = line.match(/^export\s+const\s+(\w+)/);
|
|
118
|
+
if (constExportMatch && !line.includes("=>")) {
|
|
119
|
+
symbols.push({
|
|
120
|
+
name: constExportMatch[1],
|
|
121
|
+
type: "export",
|
|
122
|
+
signature: line.trim(),
|
|
123
|
+
line: lineNumber
|
|
124
|
+
});
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (currentClass) {
|
|
128
|
+
const methodMatch = line.match(/^\s+(public\s+|private\s+|protected\s+)?(static\s+)?(async\s+)?(\w+)\s*(\([^)]*\))/);
|
|
129
|
+
if (methodMatch && !line.includes("function") && methodMatch[4] !== "if" && methodMatch[4] !== "for" && methodMatch[4] !== "while") {
|
|
130
|
+
symbols.push({
|
|
131
|
+
name: methodMatch[4],
|
|
132
|
+
type: "method",
|
|
133
|
+
signature: line.trim(),
|
|
134
|
+
line: lineNumber,
|
|
135
|
+
parentClass: currentClass
|
|
136
|
+
});
|
|
248
137
|
}
|
|
249
|
-
|
|
138
|
+
}
|
|
250
139
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
140
|
+
return symbols;
|
|
141
|
+
}
|
|
142
|
+
parsePython(content) {
|
|
143
|
+
const symbols = [];
|
|
144
|
+
const lines = content.split("\n");
|
|
145
|
+
let currentClass = null;
|
|
146
|
+
for (let i = 0; i < lines.length; i++) {
|
|
147
|
+
const line = lines[i];
|
|
148
|
+
const lineNumber = i + 1;
|
|
149
|
+
const classMatch = line.match(/^class\s+(\w+)(\([^)]*\))?:/);
|
|
150
|
+
if (classMatch) {
|
|
151
|
+
currentClass = classMatch[1];
|
|
152
|
+
symbols.push({
|
|
153
|
+
name: classMatch[1],
|
|
154
|
+
type: "class",
|
|
155
|
+
signature: line.trim(),
|
|
156
|
+
line: lineNumber
|
|
157
|
+
});
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const functionMatch = line.match(/^def\s+(\w+)\s*(\([^)]*\))/);
|
|
161
|
+
if (functionMatch) {
|
|
162
|
+
currentClass = null;
|
|
163
|
+
symbols.push({
|
|
164
|
+
name: functionMatch[1],
|
|
165
|
+
type: "function",
|
|
166
|
+
signature: line.trim(),
|
|
167
|
+
line: lineNumber
|
|
168
|
+
});
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const methodMatch = line.match(/^\s+def\s+(\w+)\s*(\([^)]*\))/);
|
|
172
|
+
if (methodMatch && currentClass) {
|
|
173
|
+
symbols.push({
|
|
174
|
+
name: methodMatch[1],
|
|
175
|
+
type: "method",
|
|
176
|
+
signature: line.trim(),
|
|
177
|
+
line: lineNumber,
|
|
178
|
+
parentClass: currentClass
|
|
179
|
+
});
|
|
180
|
+
}
|
|
254
181
|
}
|
|
255
|
-
|
|
256
|
-
|
|
182
|
+
return symbols;
|
|
183
|
+
}
|
|
184
|
+
parseJava(content) {
|
|
185
|
+
const symbols = [];
|
|
186
|
+
const lines = content.split("\n");
|
|
187
|
+
let currentClass = null;
|
|
188
|
+
let classDepth = 0;
|
|
189
|
+
for (let i = 0; i < lines.length; i++) {
|
|
190
|
+
const line = lines[i];
|
|
191
|
+
const lineNumber = i + 1;
|
|
192
|
+
const classMatch = line.match(/^\s*(public\s+|private\s+|protected\s+)?(abstract\s+|final\s+)?class\s+(\w+)(\s+extends\s+(\w+))?/);
|
|
193
|
+
if (classMatch) {
|
|
194
|
+
currentClass = classMatch[3];
|
|
195
|
+
classDepth = this.getIndentLevel(line);
|
|
196
|
+
symbols.push({
|
|
197
|
+
name: classMatch[3],
|
|
198
|
+
type: "class",
|
|
199
|
+
signature: line.trim(),
|
|
200
|
+
line: lineNumber
|
|
201
|
+
});
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const interfaceMatch = line.match(/^\s*(public\s+)?interface\s+(\w+)/);
|
|
205
|
+
if (interfaceMatch) {
|
|
206
|
+
symbols.push({
|
|
207
|
+
name: interfaceMatch[2],
|
|
208
|
+
type: "interface",
|
|
209
|
+
signature: line.trim(),
|
|
210
|
+
line: lineNumber
|
|
211
|
+
});
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (currentClass && line.trim() === "}" && this.getIndentLevel(line) === classDepth) {
|
|
215
|
+
currentClass = null;
|
|
216
|
+
}
|
|
217
|
+
if (currentClass) {
|
|
218
|
+
const methodMatch = line.match(/^\s+(public\s+|private\s+|protected\s+)?(static\s+)?(final\s+)?(\w+)\s+(\w+)\s*(\([^)]*\))/);
|
|
219
|
+
if (methodMatch && !line.includes("class") && !line.includes("interface")) {
|
|
220
|
+
symbols.push({
|
|
221
|
+
name: methodMatch[5],
|
|
222
|
+
type: "method",
|
|
223
|
+
signature: line.trim(),
|
|
224
|
+
line: lineNumber,
|
|
225
|
+
parentClass: currentClass
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
257
229
|
}
|
|
230
|
+
return symbols;
|
|
231
|
+
}
|
|
232
|
+
getIndentLevel(line) {
|
|
233
|
+
const match = line.match(/^(\s*)/);
|
|
234
|
+
return match ? match[1].length : 0;
|
|
235
|
+
}
|
|
236
|
+
normalizePath(filePath) {
|
|
237
|
+
return filePath.replace(/\\/g, "/");
|
|
238
|
+
}
|
|
258
239
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Format inspect symbol results for display
|
|
261
|
-
*/
|
|
262
240
|
function formatInspectSymbolResults(result) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
241
|
+
if (result.symbols.length === 0) {
|
|
242
|
+
return `No symbols found in ${result.filePath}`;
|
|
243
|
+
}
|
|
244
|
+
let output = `## Symbol Outline: ${result.filePath}
|
|
245
|
+
|
|
246
|
+
`;
|
|
247
|
+
output += `**Language:** ${result.language}
|
|
248
|
+
`;
|
|
249
|
+
output += `**Symbols Found:** ${result.symbols.length}${result.truncated ? ` (showing first ${result.symbols.length})` : ""}
|
|
250
|
+
|
|
251
|
+
`;
|
|
252
|
+
const byType = {};
|
|
253
|
+
for (const symbol of result.symbols) {
|
|
254
|
+
const type = symbol.type;
|
|
255
|
+
if (!byType[type]) {
|
|
256
|
+
byType[type] = [];
|
|
277
257
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
258
|
+
byType[type].push(symbol);
|
|
259
|
+
}
|
|
260
|
+
const order = ["class", "interface", "type", "function", "export", "method"];
|
|
261
|
+
for (const type of order) {
|
|
262
|
+
if (byType[type] && byType[type].length > 0) {
|
|
263
|
+
output += `### ${type.charAt(0).toUpperCase() + type.slice(1)}s
|
|
264
|
+
|
|
265
|
+
`;
|
|
266
|
+
for (const symbol of byType[type]) {
|
|
267
|
+
const parentInfo = symbol.parentClass ? ` (in ${symbol.parentClass})` : "";
|
|
268
|
+
output += `- **${symbol.name}**${parentInfo} - Line ${symbol.line}
|
|
269
|
+
`;
|
|
270
|
+
if (symbol.signature) {
|
|
271
|
+
output += ` \`${symbol.signature}\`
|
|
272
|
+
`;
|
|
291
273
|
}
|
|
274
|
+
}
|
|
275
|
+
output += "\n";
|
|
292
276
|
}
|
|
293
|
-
|
|
277
|
+
}
|
|
278
|
+
return output;
|
|
294
279
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
- To
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
SUPPORTS: TypeScript, JavaScript, Python, Java
|
|
310
|
-
|
|
280
|
+
const inspectSymbolTool = {
|
|
281
|
+
schema: {
|
|
282
|
+
name: "inspect_symbol",
|
|
283
|
+
description: `Get an outline of symbols (classes, functions, methods) in a file without reading the entire file.
|
|
284
|
+
|
|
285
|
+
WHEN TO USE:
|
|
286
|
+
- To understand file structure before reading details
|
|
287
|
+
- To find specific functions or classes
|
|
288
|
+
- To see what's exported from a module
|
|
289
|
+
- To quickly scan a large file
|
|
290
|
+
|
|
291
|
+
SUPPORTS: TypeScript, JavaScript, Python, Java
|
|
292
|
+
|
|
311
293
|
This is faster than reading the entire file when you only need to know what functions/classes exist.`,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
required: ['reason_text', 'filePath']
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
async execute(args, context) {
|
|
328
|
-
const tool = new InspectSymbolTool();
|
|
329
|
-
const params = {
|
|
330
|
-
filePath: args.filePath
|
|
331
|
-
};
|
|
332
|
-
try {
|
|
333
|
-
const result = await tool.execute(params, context.cwd);
|
|
334
|
-
return formatInspectSymbolResults(result);
|
|
335
|
-
}
|
|
336
|
-
catch (error) {
|
|
337
|
-
throw new Error(`Inspect symbol failed: ${error.message}`);
|
|
294
|
+
parameters: {
|
|
295
|
+
type: "object",
|
|
296
|
+
properties: {
|
|
297
|
+
reason_text: {
|
|
298
|
+
type: "string",
|
|
299
|
+
description: 'REQUIRED: Brief explanation of why you need the symbol outline. Example: "Checking what functions are exported from this utility module"'
|
|
300
|
+
},
|
|
301
|
+
filePath: {
|
|
302
|
+
type: "string",
|
|
303
|
+
description: "Path to the file to inspect (relative to current working directory)"
|
|
338
304
|
}
|
|
305
|
+
},
|
|
306
|
+
required: ["reason_text", "filePath"]
|
|
339
307
|
}
|
|
308
|
+
},
|
|
309
|
+
async execute(args, context) {
|
|
310
|
+
const tool = new InspectSymbolTool();
|
|
311
|
+
const params = {
|
|
312
|
+
filePath: args.filePath
|
|
313
|
+
};
|
|
314
|
+
try {
|
|
315
|
+
const result = await tool.execute(params, context.cwd);
|
|
316
|
+
return formatInspectSymbolResults(result);
|
|
317
|
+
} catch (error) {
|
|
318
|
+
throw new Error(`Inspect symbol failed: ${error.message}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
export {
|
|
323
|
+
InspectSymbolTool,
|
|
324
|
+
inspectSymbolTool
|
|
340
325
|
};
|
|
341
326
|
//# sourceMappingURL=inspect-symbol.js.map
|