mistagent 0.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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/src/api/auth.d.ts +7 -0
- package/dist/src/api/auth.d.ts.map +1 -0
- package/dist/src/api/auth.js +16 -0
- package/dist/src/api/auth.js.map +1 -0
- package/dist/src/api/chat.d.ts +8 -0
- package/dist/src/api/chat.d.ts.map +1 -0
- package/dist/src/api/chat.js +14 -0
- package/dist/src/api/chat.js.map +1 -0
- package/dist/src/api/client.d.ts +22 -0
- package/dist/src/api/client.d.ts.map +1 -0
- package/dist/src/api/client.js +140 -0
- package/dist/src/api/client.js.map +1 -0
- package/dist/src/api/commands.d.ts +8 -0
- package/dist/src/api/commands.d.ts.map +1 -0
- package/dist/src/api/commands.js +13 -0
- package/dist/src/api/commands.js.map +1 -0
- package/dist/src/api/models.d.ts +9 -0
- package/dist/src/api/models.d.ts.map +1 -0
- package/dist/src/api/models.js +13 -0
- package/dist/src/api/models.js.map +1 -0
- package/dist/src/api/sessions.d.ts +25 -0
- package/dist/src/api/sessions.d.ts.map +1 -0
- package/dist/src/api/sessions.js +26 -0
- package/dist/src/api/sessions.js.map +1 -0
- package/dist/src/api/tools.d.ts +7 -0
- package/dist/src/api/tools.d.ts.map +1 -0
- package/dist/src/api/tools.js +8 -0
- package/dist/src/api/tools.js.map +1 -0
- package/dist/src/components/App.d.ts +22 -0
- package/dist/src/components/App.d.ts.map +1 -0
- package/dist/src/components/App.js +61 -0
- package/dist/src/components/App.js.map +1 -0
- package/dist/src/components/AppLayout.d.ts +8 -0
- package/dist/src/components/AppLayout.d.ts.map +1 -0
- package/dist/src/components/AppLayout.js +18 -0
- package/dist/src/components/AppLayout.js.map +1 -0
- package/dist/src/components/Composer.d.ts +8 -0
- package/dist/src/components/Composer.d.ts.map +1 -0
- package/dist/src/components/Composer.js +294 -0
- package/dist/src/components/Composer.js.map +1 -0
- package/dist/src/components/Footer.d.ts +10 -0
- package/dist/src/components/Footer.d.ts.map +1 -0
- package/dist/src/components/Footer.js +34 -0
- package/dist/src/components/Footer.js.map +1 -0
- package/dist/src/components/Header.d.ts +3 -0
- package/dist/src/components/Header.d.ts.map +1 -0
- package/dist/src/components/Header.js +99 -0
- package/dist/src/components/Header.js.map +1 -0
- package/dist/src/components/HistoryItemDisplay.d.ts +8 -0
- package/dist/src/components/HistoryItemDisplay.d.ts.map +1 -0
- package/dist/src/components/HistoryItemDisplay.js +32 -0
- package/dist/src/components/HistoryItemDisplay.js.map +1 -0
- package/dist/src/components/InputPrompt.d.ts +11 -0
- package/dist/src/components/InputPrompt.d.ts.map +1 -0
- package/dist/src/components/InputPrompt.js +12 -0
- package/dist/src/components/InputPrompt.js.map +1 -0
- package/dist/src/components/LoadingIndicator.d.ts +8 -0
- package/dist/src/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/src/components/LoadingIndicator.js +17 -0
- package/dist/src/components/LoadingIndicator.js.map +1 -0
- package/dist/src/components/LoginPrompt.d.ts +8 -0
- package/dist/src/components/LoginPrompt.d.ts.map +1 -0
- package/dist/src/components/LoginPrompt.js +76 -0
- package/dist/src/components/LoginPrompt.js.map +1 -0
- package/dist/src/components/MainContent.d.ts +3 -0
- package/dist/src/components/MainContent.d.ts.map +1 -0
- package/dist/src/components/MainContent.js +22 -0
- package/dist/src/components/MainContent.js.map +1 -0
- package/dist/src/components/ModelPicker.d.ts +3 -0
- package/dist/src/components/ModelPicker.d.ts.map +1 -0
- package/dist/src/components/ModelPicker.js +119 -0
- package/dist/src/components/ModelPicker.js.map +1 -0
- package/dist/src/components/MultiLineInput.d.ts +19 -0
- package/dist/src/components/MultiLineInput.d.ts.map +1 -0
- package/dist/src/components/MultiLineInput.js +108 -0
- package/dist/src/components/MultiLineInput.js.map +1 -0
- package/dist/src/components/SessionPicker.d.ts +3 -0
- package/dist/src/components/SessionPicker.d.ts.map +1 -0
- package/dist/src/components/SessionPicker.js +131 -0
- package/dist/src/components/SessionPicker.js.map +1 -0
- package/dist/src/components/SuggestionsDisplay.d.ts +16 -0
- package/dist/src/components/SuggestionsDisplay.d.ts.map +1 -0
- package/dist/src/components/SuggestionsDisplay.js +34 -0
- package/dist/src/components/SuggestionsDisplay.js.map +1 -0
- package/dist/src/components/messages/AssistantMessage.d.ts +8 -0
- package/dist/src/components/messages/AssistantMessage.d.ts.map +1 -0
- package/dist/src/components/messages/AssistantMessage.js +9 -0
- package/dist/src/components/messages/AssistantMessage.js.map +1 -0
- package/dist/src/components/messages/CommandResult.d.ts +8 -0
- package/dist/src/components/messages/CommandResult.d.ts.map +1 -0
- package/dist/src/components/messages/CommandResult.js +7 -0
- package/dist/src/components/messages/CommandResult.js.map +1 -0
- package/dist/src/components/messages/ErrorMessage.d.ts +7 -0
- package/dist/src/components/messages/ErrorMessage.d.ts.map +1 -0
- package/dist/src/components/messages/ErrorMessage.js +7 -0
- package/dist/src/components/messages/ErrorMessage.js.map +1 -0
- package/dist/src/components/messages/InfoMessage.d.ts +9 -0
- package/dist/src/components/messages/InfoMessage.d.ts.map +1 -0
- package/dist/src/components/messages/InfoMessage.js +8 -0
- package/dist/src/components/messages/InfoMessage.js.map +1 -0
- package/dist/src/components/messages/ModelMessage.d.ts +8 -0
- package/dist/src/components/messages/ModelMessage.d.ts.map +1 -0
- package/dist/src/components/messages/ModelMessage.js +7 -0
- package/dist/src/components/messages/ModelMessage.js.map +1 -0
- package/dist/src/components/messages/SessionMessage.d.ts +8 -0
- package/dist/src/components/messages/SessionMessage.d.ts.map +1 -0
- package/dist/src/components/messages/SessionMessage.js +12 -0
- package/dist/src/components/messages/SessionMessage.js.map +1 -0
- package/dist/src/components/messages/ToolCallMessage.d.ts +9 -0
- package/dist/src/components/messages/ToolCallMessage.d.ts.map +1 -0
- package/dist/src/components/messages/ToolCallMessage.js +14 -0
- package/dist/src/components/messages/ToolCallMessage.js.map +1 -0
- package/dist/src/components/messages/UserMessage.d.ts +7 -0
- package/dist/src/components/messages/UserMessage.d.ts.map +1 -0
- package/dist/src/components/messages/UserMessage.js +9 -0
- package/dist/src/components/messages/UserMessage.js.map +1 -0
- package/dist/src/components/shared/HorizontalLine.d.ts +11 -0
- package/dist/src/components/shared/HorizontalLine.d.ts.map +1 -0
- package/dist/src/components/shared/HorizontalLine.js +10 -0
- package/dist/src/components/shared/HorizontalLine.js.map +1 -0
- package/dist/src/components/shared/MarkdownRenderer.d.ts +7 -0
- package/dist/src/components/shared/MarkdownRenderer.d.ts.map +1 -0
- package/dist/src/components/shared/MarkdownRenderer.js +33 -0
- package/dist/src/components/shared/MarkdownRenderer.js.map +1 -0
- package/dist/src/components/shared/Spinner.d.ts +8 -0
- package/dist/src/components/shared/Spinner.d.ts.map +1 -0
- package/dist/src/components/shared/Spinner.js +7 -0
- package/dist/src/components/shared/Spinner.js.map +1 -0
- package/dist/src/components/shared/TextInput.d.ts +10 -0
- package/dist/src/components/shared/TextInput.d.ts.map +1 -0
- package/dist/src/components/shared/TextInput.js +110 -0
- package/dist/src/components/shared/TextInput.js.map +1 -0
- package/dist/src/contexts/AppContext.d.ts +21 -0
- package/dist/src/contexts/AppContext.d.ts.map +1 -0
- package/dist/src/contexts/AppContext.js +16 -0
- package/dist/src/contexts/AppContext.js.map +1 -0
- package/dist/src/contexts/ChatContext.d.ts +68 -0
- package/dist/src/contexts/ChatContext.d.ts.map +1 -0
- package/dist/src/contexts/ChatContext.js +158 -0
- package/dist/src/contexts/ChatContext.js.map +1 -0
- package/dist/src/contexts/KeypressContext.d.ts +47 -0
- package/dist/src/contexts/KeypressContext.d.ts.map +1 -0
- package/dist/src/contexts/KeypressContext.js +792 -0
- package/dist/src/contexts/KeypressContext.js.map +1 -0
- package/dist/src/contexts/ModelContext.d.ts +20 -0
- package/dist/src/contexts/ModelContext.d.ts.map +1 -0
- package/dist/src/contexts/ModelContext.js +42 -0
- package/dist/src/contexts/ModelContext.js.map +1 -0
- package/dist/src/contexts/PasteContext.d.ts +8 -0
- package/dist/src/contexts/PasteContext.d.ts.map +1 -0
- package/dist/src/contexts/PasteContext.js +12 -0
- package/dist/src/contexts/PasteContext.js.map +1 -0
- package/dist/src/contexts/SessionContext.d.ts +19 -0
- package/dist/src/contexts/SessionContext.d.ts.map +1 -0
- package/dist/src/contexts/SessionContext.js +56 -0
- package/dist/src/contexts/SessionContext.js.map +1 -0
- package/dist/src/contexts/UIContext.d.ts +15 -0
- package/dist/src/contexts/UIContext.d.ts.map +1 -0
- package/dist/src/contexts/UIContext.js +16 -0
- package/dist/src/contexts/UIContext.js.map +1 -0
- package/dist/src/hooks/useChat.d.ts +11 -0
- package/dist/src/hooks/useChat.d.ts.map +1 -0
- package/dist/src/hooks/useChat.js +146 -0
- package/dist/src/hooks/useChat.js.map +1 -0
- package/dist/src/hooks/useFileCompletion.d.ts +8 -0
- package/dist/src/hooks/useFileCompletion.d.ts.map +1 -0
- package/dist/src/hooks/useFileCompletion.js +75 -0
- package/dist/src/hooks/useFileCompletion.js.map +1 -0
- package/dist/src/hooks/useInputHistory.d.ts +6 -0
- package/dist/src/hooks/useInputHistory.d.ts.map +1 -0
- package/dist/src/hooks/useInputHistory.js +46 -0
- package/dist/src/hooks/useInputHistory.js.map +1 -0
- package/dist/src/hooks/useKeypress.d.ts +16 -0
- package/dist/src/hooks/useKeypress.d.ts.map +1 -0
- package/dist/src/hooks/useKeypress.js +23 -0
- package/dist/src/hooks/useKeypress.js.map +1 -0
- package/dist/src/hooks/useLoadingIndicator.d.ts +5 -0
- package/dist/src/hooks/useLoadingIndicator.d.ts.map +1 -0
- package/dist/src/hooks/useLoadingIndicator.js +31 -0
- package/dist/src/hooks/useLoadingIndicator.js.map +1 -0
- package/dist/src/hooks/useMultiLineInput.d.ts +37 -0
- package/dist/src/hooks/useMultiLineInput.d.ts.map +1 -0
- package/dist/src/hooks/useMultiLineInput.js +202 -0
- package/dist/src/hooks/useMultiLineInput.js.map +1 -0
- package/dist/src/hooks/usePasteBuffer.d.ts +10 -0
- package/dist/src/hooks/usePasteBuffer.d.ts.map +1 -0
- package/dist/src/hooks/usePasteBuffer.js +90 -0
- package/dist/src/hooks/usePasteBuffer.js.map +1 -0
- package/dist/src/hooks/useSlashCommand.d.ts +6 -0
- package/dist/src/hooks/useSlashCommand.d.ts.map +1 -0
- package/dist/src/hooks/useSlashCommand.js +198 -0
- package/dist/src/hooks/useSlashCommand.js.map +1 -0
- package/dist/src/hooks/useStdinInterceptor.d.ts +2 -0
- package/dist/src/hooks/useStdinInterceptor.d.ts.map +1 -0
- package/dist/src/hooks/useStdinInterceptor.js +85 -0
- package/dist/src/hooks/useStdinInterceptor.js.map +1 -0
- package/dist/src/hooks/useSymbolCompletion.d.ts +10 -0
- package/dist/src/hooks/useSymbolCompletion.d.ts.map +1 -0
- package/dist/src/hooks/useSymbolCompletion.js +65 -0
- package/dist/src/hooks/useSymbolCompletion.js.map +1 -0
- package/dist/src/hooks/useTextBuffer.d.ts +37 -0
- package/dist/src/hooks/useTextBuffer.d.ts.map +1 -0
- package/dist/src/hooks/useTextBuffer.js +627 -0
- package/dist/src/hooks/useTextBuffer.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +152 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/tools/code-analyzer/config/ignore-service.d.ts +2 -0
- package/dist/src/tools/code-analyzer/config/ignore-service.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/config/ignore-service.js +209 -0
- package/dist/src/tools/code-analyzer/config/ignore-service.js.map +1 -0
- package/dist/src/tools/code-analyzer/config/supported-languages.d.ts +13 -0
- package/dist/src/tools/code-analyzer/config/supported-languages.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/config/supported-languages.js +17 -0
- package/dist/src/tools/code-analyzer/config/supported-languages.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/graph/graph.d.ts +3 -0
- package/dist/src/tools/code-analyzer/core/graph/graph.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/graph/graph.js +67 -0
- package/dist/src/tools/code-analyzer/core/graph/graph.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/graph/types.d.ts +62 -0
- package/dist/src/tools/code-analyzer/core/graph/types.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/graph/types.js +2 -0
- package/dist/src/tools/code-analyzer/core/graph/types.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.d.ts +12 -0
- package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.js +35 -0
- package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/call-processor.d.ts +16 -0
- package/dist/src/tools/code-analyzer/core/ingestion/call-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/call-processor.js +328 -0
- package/dist/src/tools/code-analyzer/core/ingestion/call-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/community-processor.d.ts +40 -0
- package/dist/src/tools/code-analyzer/core/ingestion/community-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/community-processor.js +328 -0
- package/dist/src/tools/code-analyzer/core/ingestion/community-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.d.ts +40 -0
- package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.js +236 -0
- package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.d.ts +29 -0
- package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.js +81 -0
- package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.d.ts +39 -0
- package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.js +184 -0
- package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.d.ts +21 -0
- package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.js +198 -0
- package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/import-processor.d.ts +39 -0
- package/dist/src/tools/code-analyzer/core/ingestion/import-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/import-processor.js +791 -0
- package/dist/src/tools/code-analyzer/core/ingestion/import-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.d.ts +16 -0
- package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.js +296 -0
- package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/pipeline.d.ts +3 -0
- package/dist/src/tools/code-analyzer/core/ingestion/pipeline.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/pipeline.js +309 -0
- package/dist/src/tools/code-analyzer/core/ingestion/pipeline.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/process-processor.d.ts +52 -0
- package/dist/src/tools/code-analyzer/core/ingestion/process-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/process-processor.js +310 -0
- package/dist/src/tools/code-analyzer/core/ingestion/process-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.d.ts +3 -0
- package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.js +37 -0
- package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.d.ts +34 -0
- package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.js +39 -0
- package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.d.ts +13 -0
- package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.js +355 -0
- package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/utils.d.ts +11 -0
- package/dist/src/tools/code-analyzer/core/ingestion/utils.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/utils.js +48 -0
- package/dist/src/tools/code-analyzer/core/ingestion/utils.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.d.ts +59 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.js +538 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.d.ts +17 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.js +121 -0
- package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.js.map +1 -0
- package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.d.ts +5 -0
- package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.js +45 -0
- package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.js.map +1 -0
- package/dist/src/tools/code-analyzer/index.d.ts +17 -0
- package/dist/src/tools/code-analyzer/index.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/index.js +15 -0
- package/dist/src/tools/code-analyzer/index.js.map +1 -0
- package/dist/src/tools/code-analyzer/lib/utils.d.ts +2 -0
- package/dist/src/tools/code-analyzer/lib/utils.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/lib/utils.js +4 -0
- package/dist/src/tools/code-analyzer/lib/utils.js.map +1 -0
- package/dist/src/tools/code-analyzer/types/pipeline.d.ts +33 -0
- package/dist/src/tools/code-analyzer/types/pipeline.d.ts.map +1 -0
- package/dist/src/tools/code-analyzer/types/pipeline.js +19 -0
- package/dist/src/tools/code-analyzer/types/pipeline.js.map +1 -0
- package/dist/src/types/api.d.ts +124 -0
- package/dist/src/types/api.d.ts.map +1 -0
- package/dist/src/types/api.js +3 -0
- package/dist/src/types/api.js.map +1 -0
- package/dist/src/types/history.d.ts +49 -0
- package/dist/src/types/history.d.ts.map +1 -0
- package/dist/src/types/history.js +10 -0
- package/dist/src/types/history.js.map +1 -0
- package/dist/src/utils/colors.d.ts +40 -0
- package/dist/src/utils/colors.d.ts.map +1 -0
- package/dist/src/utils/colors.js +48 -0
- package/dist/src/utils/colors.js.map +1 -0
- package/dist/src/utils/config.d.ts +13 -0
- package/dist/src/utils/config.d.ts.map +1 -0
- package/dist/src/utils/config.js +74 -0
- package/dist/src/utils/config.js.map +1 -0
- package/dist/src/utils/constants.d.ts +8 -0
- package/dist/src/utils/constants.d.ts.map +1 -0
- package/dist/src/utils/constants.js +48 -0
- package/dist/src/utils/constants.js.map +1 -0
- package/dist/src/utils/fileRef.d.ts +26 -0
- package/dist/src/utils/fileRef.d.ts.map +1 -0
- package/dist/src/utils/fileRef.js +305 -0
- package/dist/src/utils/fileRef.js.map +1 -0
- package/dist/src/utils/formatters.d.ts +4 -0
- package/dist/src/utils/formatters.d.ts.map +1 -0
- package/dist/src/utils/formatters.js +18 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/pasteTransform.d.ts +37 -0
- package/dist/src/utils/pasteTransform.d.ts.map +1 -0
- package/dist/src/utils/pasteTransform.js +161 -0
- package/dist/src/utils/pasteTransform.js.map +1 -0
- package/dist/src/utils/pasteUtils.d.ts +7 -0
- package/dist/src/utils/pasteUtils.d.ts.map +1 -0
- package/dist/src/utils/pasteUtils.js +33 -0
- package/dist/src/utils/pasteUtils.js.map +1 -0
- package/dist/src/utils/textUtils.d.ts +25 -0
- package/dist/src/utils/textUtils.d.ts.map +1 -0
- package/dist/src/utils/textUtils.js +107 -0
- package/dist/src/utils/textUtils.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { SupportedLanguages } from '../../config/supported-languages.js';
|
|
2
|
+
/*
|
|
3
|
+
* Tree-sitter queries for extracting code definitions.
|
|
4
|
+
*
|
|
5
|
+
* Note: Different grammars (typescript vs tsx vs javascript) may have
|
|
6
|
+
* slightly different node types. These queries are designed to be
|
|
7
|
+
* compatible with the standard tree-sitter grammars.
|
|
8
|
+
*/
|
|
9
|
+
// TypeScript queries - works with tree-sitter-typescript
|
|
10
|
+
export const TYPESCRIPT_QUERIES = `
|
|
11
|
+
(class_declaration
|
|
12
|
+
name: (type_identifier) @name) @definition.class
|
|
13
|
+
|
|
14
|
+
(interface_declaration
|
|
15
|
+
name: (type_identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(function_declaration
|
|
18
|
+
name: (identifier) @name) @definition.function
|
|
19
|
+
|
|
20
|
+
(method_definition
|
|
21
|
+
name: (property_identifier) @name) @definition.method
|
|
22
|
+
|
|
23
|
+
(lexical_declaration
|
|
24
|
+
(variable_declarator
|
|
25
|
+
name: (identifier) @name
|
|
26
|
+
value: (arrow_function))) @definition.function
|
|
27
|
+
|
|
28
|
+
(lexical_declaration
|
|
29
|
+
(variable_declarator
|
|
30
|
+
name: (identifier) @name
|
|
31
|
+
value: (function_expression))) @definition.function
|
|
32
|
+
|
|
33
|
+
(export_statement
|
|
34
|
+
declaration: (lexical_declaration
|
|
35
|
+
(variable_declarator
|
|
36
|
+
name: (identifier) @name
|
|
37
|
+
value: (arrow_function)))) @definition.function
|
|
38
|
+
|
|
39
|
+
(export_statement
|
|
40
|
+
declaration: (lexical_declaration
|
|
41
|
+
(variable_declarator
|
|
42
|
+
name: (identifier) @name
|
|
43
|
+
value: (function_expression)))) @definition.function
|
|
44
|
+
|
|
45
|
+
(import_statement
|
|
46
|
+
source: (string) @import.source) @import
|
|
47
|
+
|
|
48
|
+
(call_expression
|
|
49
|
+
function: (identifier) @call.name) @call
|
|
50
|
+
|
|
51
|
+
(call_expression
|
|
52
|
+
function: (member_expression
|
|
53
|
+
property: (property_identifier) @call.name)) @call
|
|
54
|
+
|
|
55
|
+
; Heritage queries - class extends
|
|
56
|
+
(class_declaration
|
|
57
|
+
name: (type_identifier) @heritage.class
|
|
58
|
+
(class_heritage
|
|
59
|
+
(extends_clause
|
|
60
|
+
value: (identifier) @heritage.extends))) @heritage
|
|
61
|
+
|
|
62
|
+
; Heritage queries - class implements interface
|
|
63
|
+
(class_declaration
|
|
64
|
+
name: (type_identifier) @heritage.class
|
|
65
|
+
(class_heritage
|
|
66
|
+
(implements_clause
|
|
67
|
+
(type_identifier) @heritage.implements))) @heritage.impl
|
|
68
|
+
`;
|
|
69
|
+
// JavaScript queries - works with tree-sitter-javascript
|
|
70
|
+
export const JAVASCRIPT_QUERIES = `
|
|
71
|
+
(class_declaration
|
|
72
|
+
name: (identifier) @name) @definition.class
|
|
73
|
+
|
|
74
|
+
(function_declaration
|
|
75
|
+
name: (identifier) @name) @definition.function
|
|
76
|
+
|
|
77
|
+
(method_definition
|
|
78
|
+
name: (property_identifier) @name) @definition.method
|
|
79
|
+
|
|
80
|
+
(lexical_declaration
|
|
81
|
+
(variable_declarator
|
|
82
|
+
name: (identifier) @name
|
|
83
|
+
value: (arrow_function))) @definition.function
|
|
84
|
+
|
|
85
|
+
(lexical_declaration
|
|
86
|
+
(variable_declarator
|
|
87
|
+
name: (identifier) @name
|
|
88
|
+
value: (function_expression))) @definition.function
|
|
89
|
+
|
|
90
|
+
(export_statement
|
|
91
|
+
declaration: (lexical_declaration
|
|
92
|
+
(variable_declarator
|
|
93
|
+
name: (identifier) @name
|
|
94
|
+
value: (arrow_function)))) @definition.function
|
|
95
|
+
|
|
96
|
+
(export_statement
|
|
97
|
+
declaration: (lexical_declaration
|
|
98
|
+
(variable_declarator
|
|
99
|
+
name: (identifier) @name
|
|
100
|
+
value: (function_expression)))) @definition.function
|
|
101
|
+
|
|
102
|
+
(import_statement
|
|
103
|
+
source: (string) @import.source) @import
|
|
104
|
+
|
|
105
|
+
(call_expression
|
|
106
|
+
function: (identifier) @call.name) @call
|
|
107
|
+
|
|
108
|
+
(call_expression
|
|
109
|
+
function: (member_expression
|
|
110
|
+
property: (property_identifier) @call.name)) @call
|
|
111
|
+
|
|
112
|
+
; Heritage queries - class extends (JavaScript uses different AST than TypeScript)
|
|
113
|
+
; In tree-sitter-javascript, class_heritage directly contains the parent identifier
|
|
114
|
+
(class_declaration
|
|
115
|
+
name: (identifier) @heritage.class
|
|
116
|
+
(class_heritage
|
|
117
|
+
(identifier) @heritage.extends)) @heritage
|
|
118
|
+
`;
|
|
119
|
+
// Python queries - works with tree-sitter-python
|
|
120
|
+
export const PYTHON_QUERIES = `
|
|
121
|
+
(class_definition
|
|
122
|
+
name: (identifier) @name) @definition.class
|
|
123
|
+
|
|
124
|
+
(function_definition
|
|
125
|
+
name: (identifier) @name) @definition.function
|
|
126
|
+
|
|
127
|
+
(import_statement
|
|
128
|
+
name: (dotted_name) @import.source) @import
|
|
129
|
+
|
|
130
|
+
(import_from_statement
|
|
131
|
+
module_name: (dotted_name) @import.source) @import
|
|
132
|
+
|
|
133
|
+
(call
|
|
134
|
+
function: (identifier) @call.name) @call
|
|
135
|
+
|
|
136
|
+
(call
|
|
137
|
+
function: (attribute
|
|
138
|
+
attribute: (identifier) @call.name)) @call
|
|
139
|
+
|
|
140
|
+
; Heritage queries - Python class inheritance
|
|
141
|
+
(class_definition
|
|
142
|
+
name: (identifier) @heritage.class
|
|
143
|
+
superclasses: (argument_list
|
|
144
|
+
(identifier) @heritage.extends)) @heritage
|
|
145
|
+
`;
|
|
146
|
+
// Java queries - works with tree-sitter-java
|
|
147
|
+
export const JAVA_QUERIES = `
|
|
148
|
+
; Classes, Interfaces, Enums, Annotations
|
|
149
|
+
(class_declaration name: (identifier) @name) @definition.class
|
|
150
|
+
(interface_declaration name: (identifier) @name) @definition.interface
|
|
151
|
+
(enum_declaration name: (identifier) @name) @definition.enum
|
|
152
|
+
(annotation_type_declaration name: (identifier) @name) @definition.annotation
|
|
153
|
+
|
|
154
|
+
; Methods & Constructors
|
|
155
|
+
(method_declaration name: (identifier) @name) @definition.method
|
|
156
|
+
(constructor_declaration name: (identifier) @name) @definition.constructor
|
|
157
|
+
|
|
158
|
+
; Imports - capture any import declaration child as source
|
|
159
|
+
(import_declaration (_) @import.source) @import
|
|
160
|
+
|
|
161
|
+
; Calls
|
|
162
|
+
(method_invocation name: (identifier) @call.name) @call
|
|
163
|
+
(method_invocation object: (_) name: (identifier) @call.name) @call
|
|
164
|
+
|
|
165
|
+
; Heritage - extends class
|
|
166
|
+
(class_declaration name: (identifier) @heritage.class
|
|
167
|
+
(superclass (type_identifier) @heritage.extends)) @heritage
|
|
168
|
+
|
|
169
|
+
; Heritage - implements interfaces
|
|
170
|
+
(class_declaration name: (identifier) @heritage.class
|
|
171
|
+
(super_interfaces (type_list (type_identifier) @heritage.implements))) @heritage.impl
|
|
172
|
+
`;
|
|
173
|
+
// C queries - works with tree-sitter-c
|
|
174
|
+
export const C_QUERIES = `
|
|
175
|
+
; Functions
|
|
176
|
+
(function_definition declarator: (function_declarator declarator: (identifier) @name)) @definition.function
|
|
177
|
+
(declaration declarator: (function_declarator declarator: (identifier) @name)) @definition.function
|
|
178
|
+
|
|
179
|
+
; Structs, Unions, Enums, Typedefs
|
|
180
|
+
(struct_specifier name: (type_identifier) @name) @definition.struct
|
|
181
|
+
(union_specifier name: (type_identifier) @name) @definition.union
|
|
182
|
+
(enum_specifier name: (type_identifier) @name) @definition.enum
|
|
183
|
+
(type_definition declarator: (type_identifier) @name) @definition.typedef
|
|
184
|
+
|
|
185
|
+
; Macros
|
|
186
|
+
(preproc_function_def name: (identifier) @name) @definition.macro
|
|
187
|
+
(preproc_def name: (identifier) @name) @definition.macro
|
|
188
|
+
|
|
189
|
+
; Includes
|
|
190
|
+
(preproc_include path: (_) @import.source) @import
|
|
191
|
+
|
|
192
|
+
; Calls
|
|
193
|
+
(call_expression function: (identifier) @call.name) @call
|
|
194
|
+
(call_expression function: (field_expression field: (field_identifier) @call.name)) @call
|
|
195
|
+
`;
|
|
196
|
+
// Go queries - works with tree-sitter-go
|
|
197
|
+
export const GO_QUERIES = `
|
|
198
|
+
; Functions & Methods
|
|
199
|
+
(function_declaration name: (identifier) @name) @definition.function
|
|
200
|
+
(method_declaration name: (field_identifier) @name) @definition.method
|
|
201
|
+
|
|
202
|
+
; Types
|
|
203
|
+
(type_declaration (type_spec name: (type_identifier) @name type: (struct_type))) @definition.struct
|
|
204
|
+
(type_declaration (type_spec name: (type_identifier) @name type: (interface_type))) @definition.interface
|
|
205
|
+
(type_declaration (type_spec name: (type_identifier) @name)) @definition.type
|
|
206
|
+
|
|
207
|
+
; Imports
|
|
208
|
+
(import_declaration (import_spec path: (interpreted_string_literal) @import.source)) @import
|
|
209
|
+
(import_declaration (import_spec_list (import_spec path: (interpreted_string_literal) @import.source))) @import
|
|
210
|
+
|
|
211
|
+
; Calls
|
|
212
|
+
(call_expression function: (identifier) @call.name) @call
|
|
213
|
+
(call_expression function: (selector_expression field: (field_identifier) @call.name)) @call
|
|
214
|
+
`;
|
|
215
|
+
// C++ queries - works with tree-sitter-cpp
|
|
216
|
+
export const CPP_QUERIES = `
|
|
217
|
+
; Classes, Structs, Namespaces
|
|
218
|
+
(class_specifier name: (type_identifier) @name) @definition.class
|
|
219
|
+
(struct_specifier name: (type_identifier) @name) @definition.struct
|
|
220
|
+
(namespace_definition name: (namespace_identifier) @name) @definition.namespace
|
|
221
|
+
(enum_specifier name: (type_identifier) @name) @definition.enum
|
|
222
|
+
|
|
223
|
+
; Functions & Methods
|
|
224
|
+
(function_definition declarator: (function_declarator declarator: (identifier) @name)) @definition.function
|
|
225
|
+
(function_definition declarator: (function_declarator declarator: (qualified_identifier name: (identifier) @name))) @definition.method
|
|
226
|
+
|
|
227
|
+
; Templates
|
|
228
|
+
(template_declaration (class_specifier name: (type_identifier) @name)) @definition.template
|
|
229
|
+
(template_declaration (function_definition declarator: (function_declarator declarator: (identifier) @name))) @definition.template
|
|
230
|
+
|
|
231
|
+
; Includes
|
|
232
|
+
(preproc_include path: (_) @import.source) @import
|
|
233
|
+
|
|
234
|
+
; Calls
|
|
235
|
+
(call_expression function: (identifier) @call.name) @call
|
|
236
|
+
(call_expression function: (field_expression field: (field_identifier) @call.name)) @call
|
|
237
|
+
(call_expression function: (qualified_identifier name: (identifier) @call.name)) @call
|
|
238
|
+
(call_expression function: (template_function name: (identifier) @call.name)) @call
|
|
239
|
+
|
|
240
|
+
; Heritage
|
|
241
|
+
(class_specifier name: (type_identifier) @heritage.class
|
|
242
|
+
(base_class_clause (type_identifier) @heritage.extends)) @heritage
|
|
243
|
+
(class_specifier name: (type_identifier) @heritage.class
|
|
244
|
+
(base_class_clause (access_specifier) (type_identifier) @heritage.extends)) @heritage
|
|
245
|
+
`;
|
|
246
|
+
// C# queries - works with tree-sitter-c-sharp
|
|
247
|
+
export const CSHARP_QUERIES = `
|
|
248
|
+
; Types
|
|
249
|
+
(class_declaration name: (identifier) @name) @definition.class
|
|
250
|
+
(interface_declaration name: (identifier) @name) @definition.interface
|
|
251
|
+
(struct_declaration name: (identifier) @name) @definition.struct
|
|
252
|
+
(enum_declaration name: (identifier) @name) @definition.enum
|
|
253
|
+
(record_declaration name: (identifier) @name) @definition.record
|
|
254
|
+
(delegate_declaration name: (identifier) @name) @definition.delegate
|
|
255
|
+
|
|
256
|
+
; Namespaces
|
|
257
|
+
(namespace_declaration name: (identifier) @name) @definition.namespace
|
|
258
|
+
(namespace_declaration name: (qualified_name) @name) @definition.namespace
|
|
259
|
+
|
|
260
|
+
; Methods & Properties
|
|
261
|
+
(method_declaration name: (identifier) @name) @definition.method
|
|
262
|
+
(local_function_statement name: (identifier) @name) @definition.function
|
|
263
|
+
(constructor_declaration name: (identifier) @name) @definition.constructor
|
|
264
|
+
(property_declaration name: (identifier) @name) @definition.property
|
|
265
|
+
|
|
266
|
+
; Using
|
|
267
|
+
(using_directive (qualified_name) @import.source) @import
|
|
268
|
+
(using_directive (identifier) @import.source) @import
|
|
269
|
+
|
|
270
|
+
; Calls
|
|
271
|
+
(invocation_expression function: (identifier) @call.name) @call
|
|
272
|
+
(invocation_expression function: (member_access_expression name: (identifier) @call.name)) @call
|
|
273
|
+
|
|
274
|
+
; Heritage
|
|
275
|
+
(class_declaration name: (identifier) @heritage.class
|
|
276
|
+
(base_list (simple_base_type (identifier) @heritage.extends))) @heritage
|
|
277
|
+
(class_declaration name: (identifier) @heritage.class
|
|
278
|
+
(base_list (simple_base_type (generic_name (identifier) @heritage.extends)))) @heritage
|
|
279
|
+
`;
|
|
280
|
+
// Rust queries - works with tree-sitter-rust
|
|
281
|
+
export const RUST_QUERIES = `
|
|
282
|
+
; Functions & Items
|
|
283
|
+
(function_item name: (identifier) @name) @definition.function
|
|
284
|
+
(struct_item name: (type_identifier) @name) @definition.struct
|
|
285
|
+
(enum_item name: (type_identifier) @name) @definition.enum
|
|
286
|
+
(trait_item name: (type_identifier) @name) @definition.trait
|
|
287
|
+
(impl_item type: (type_identifier) @name) @definition.impl
|
|
288
|
+
(mod_item name: (identifier) @name) @definition.module
|
|
289
|
+
|
|
290
|
+
; Type aliases, const, static, macros
|
|
291
|
+
(type_item name: (type_identifier) @name) @definition.type
|
|
292
|
+
(const_item name: (identifier) @name) @definition.const
|
|
293
|
+
(static_item name: (identifier) @name) @definition.static
|
|
294
|
+
(macro_definition name: (identifier) @name) @definition.macro
|
|
295
|
+
|
|
296
|
+
; Use statements
|
|
297
|
+
(use_declaration argument: (_) @import.source) @import
|
|
298
|
+
|
|
299
|
+
; Calls
|
|
300
|
+
(call_expression function: (identifier) @call.name) @call
|
|
301
|
+
(call_expression function: (field_expression field: (field_identifier) @call.name)) @call
|
|
302
|
+
(call_expression function: (scoped_identifier name: (identifier) @call.name)) @call
|
|
303
|
+
(call_expression function: (generic_function function: (identifier) @call.name)) @call
|
|
304
|
+
|
|
305
|
+
; Heritage (trait implementation)
|
|
306
|
+
(impl_item trait: (type_identifier) @heritage.trait type: (type_identifier) @heritage.class) @heritage
|
|
307
|
+
(impl_item trait: (generic_type type: (type_identifier) @heritage.trait) type: (type_identifier) @heritage.class) @heritage
|
|
308
|
+
`;
|
|
309
|
+
// Solidity queries - works with tree-sitter-solidity
|
|
310
|
+
export const SOLIDITY_QUERIES = `
|
|
311
|
+
; Contracts, Libraries, Interfaces
|
|
312
|
+
(contract_declaration name: (identifier) @name) @definition.class
|
|
313
|
+
(library_declaration name: (identifier) @name) @definition.class
|
|
314
|
+
(interface_declaration name: (identifier) @name) @definition.interface
|
|
315
|
+
|
|
316
|
+
; Functions, Constructors, Modifiers
|
|
317
|
+
(function_definition name: (identifier) @name) @definition.function
|
|
318
|
+
(modifier_definition name: (identifier) @name) @definition.function
|
|
319
|
+
|
|
320
|
+
; Events, Errors
|
|
321
|
+
(event_definition name: (identifier) @name) @definition.function
|
|
322
|
+
(error_declaration name: (identifier) @name) @definition.function
|
|
323
|
+
|
|
324
|
+
; Structs, Enums
|
|
325
|
+
(struct_declaration name: (identifier) @name) @definition.struct
|
|
326
|
+
(enum_declaration name: (identifier) @name) @definition.enum
|
|
327
|
+
|
|
328
|
+
; Imports
|
|
329
|
+
(import_directive source: (string) @import.source) @import
|
|
330
|
+
|
|
331
|
+
; Calls (Solidity call_expression uses 'expression' child, not 'function' field)
|
|
332
|
+
(call_expression (expression (identifier) @call.name)) @call
|
|
333
|
+
(call_expression (expression (member_expression property: (identifier) @call.name))) @call
|
|
334
|
+
|
|
335
|
+
; Heritage - contract inheritance (contract X is Y, Z)
|
|
336
|
+
(contract_declaration
|
|
337
|
+
name: (identifier) @heritage.class
|
|
338
|
+
(inheritance_specifier ancestor: (user_defined_type (identifier) @heritage.extends))) @heritage
|
|
339
|
+
(interface_declaration
|
|
340
|
+
name: (identifier) @heritage.class
|
|
341
|
+
(inheritance_specifier ancestor: (user_defined_type (identifier) @heritage.extends))) @heritage
|
|
342
|
+
`;
|
|
343
|
+
export const LANGUAGE_QUERIES = {
|
|
344
|
+
[SupportedLanguages.TypeScript]: TYPESCRIPT_QUERIES,
|
|
345
|
+
[SupportedLanguages.JavaScript]: JAVASCRIPT_QUERIES,
|
|
346
|
+
[SupportedLanguages.Python]: PYTHON_QUERIES,
|
|
347
|
+
[SupportedLanguages.Java]: JAVA_QUERIES,
|
|
348
|
+
[SupportedLanguages.C]: C_QUERIES,
|
|
349
|
+
[SupportedLanguages.Go]: GO_QUERIES,
|
|
350
|
+
[SupportedLanguages.CPlusPlus]: CPP_QUERIES,
|
|
351
|
+
[SupportedLanguages.CSharp]: CSHARP_QUERIES,
|
|
352
|
+
[SupportedLanguages.Rust]: RUST_QUERIES,
|
|
353
|
+
[SupportedLanguages.Solidity]: SOLIDITY_QUERIES,
|
|
354
|
+
};
|
|
355
|
+
//# sourceMappingURL=tree-sitter-queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-sitter-queries.js","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/tree-sitter-queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;;;;GAMG;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DjC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDjC,CAAC;AAEF,iDAAiD;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB7B,CAAC;AAEF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB3B,CAAC;AAEF,uCAAuC;AACvC,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBxB,CAAC;AAEF,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;CAiBzB,CAAC;AAEF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B1B,CAAC;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC7B,CAAC;AAEF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B3B,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC/B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAClE,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,kBAAkB;IACnD,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,kBAAkB;IACnD,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,cAAc;IAC3C,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,YAAY;IACvC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,SAAS;IACjC,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,UAAU;IACnC,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,WAAW;IAC3C,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,cAAc;IAC3C,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,YAAY;IACvC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,gBAAgB;CAChD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SupportedLanguages } from '../../config/supported-languages.js';
|
|
2
|
+
/**
|
|
3
|
+
* Yield control to the event loop so spinners/progress can render.
|
|
4
|
+
* Call periodically in hot loops to prevent UI freezes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const yieldToEventLoop: () => Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Map file extension to SupportedLanguage enum
|
|
9
|
+
*/
|
|
10
|
+
export declare const getLanguageFromFilename: (filename: string) => SupportedLanguages | null;
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,OAAO,CAAC,IAAI,CAAkD,CAAC;AAEnG;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,KAAG,kBAAkB,GAAG,IAyB/E,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SupportedLanguages } from '../../config/supported-languages.js';
|
|
2
|
+
/**
|
|
3
|
+
* Yield control to the event loop so spinners/progress can render.
|
|
4
|
+
* Call periodically in hot loops to prevent UI freezes.
|
|
5
|
+
*/
|
|
6
|
+
export const yieldToEventLoop = () => new Promise(resolve => setImmediate(resolve));
|
|
7
|
+
/**
|
|
8
|
+
* Map file extension to SupportedLanguage enum
|
|
9
|
+
*/
|
|
10
|
+
export const getLanguageFromFilename = (filename) => {
|
|
11
|
+
// TypeScript (including TSX)
|
|
12
|
+
if (filename.endsWith('.tsx'))
|
|
13
|
+
return SupportedLanguages.TypeScript;
|
|
14
|
+
if (filename.endsWith('.ts'))
|
|
15
|
+
return SupportedLanguages.TypeScript;
|
|
16
|
+
// JavaScript (including JSX)
|
|
17
|
+
if (filename.endsWith('.jsx'))
|
|
18
|
+
return SupportedLanguages.JavaScript;
|
|
19
|
+
if (filename.endsWith('.js'))
|
|
20
|
+
return SupportedLanguages.JavaScript;
|
|
21
|
+
// Python
|
|
22
|
+
if (filename.endsWith('.py'))
|
|
23
|
+
return SupportedLanguages.Python;
|
|
24
|
+
// Java
|
|
25
|
+
if (filename.endsWith('.java'))
|
|
26
|
+
return SupportedLanguages.Java;
|
|
27
|
+
// C (source and headers)
|
|
28
|
+
if (filename.endsWith('.c') || filename.endsWith('.h'))
|
|
29
|
+
return SupportedLanguages.C;
|
|
30
|
+
// C++ (all common extensions)
|
|
31
|
+
if (filename.endsWith('.cpp') || filename.endsWith('.cc') || filename.endsWith('.cxx') ||
|
|
32
|
+
filename.endsWith('.hpp') || filename.endsWith('.hxx') || filename.endsWith('.hh'))
|
|
33
|
+
return SupportedLanguages.CPlusPlus;
|
|
34
|
+
// C#
|
|
35
|
+
if (filename.endsWith('.cs'))
|
|
36
|
+
return SupportedLanguages.CSharp;
|
|
37
|
+
// Go
|
|
38
|
+
if (filename.endsWith('.go'))
|
|
39
|
+
return SupportedLanguages.Go;
|
|
40
|
+
// Rust
|
|
41
|
+
if (filename.endsWith('.rs'))
|
|
42
|
+
return SupportedLanguages.Rust;
|
|
43
|
+
// Solidity
|
|
44
|
+
if (filename.endsWith('.sol'))
|
|
45
|
+
return SupportedLanguages.Solidity;
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAkB,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnG;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAA6B,EAAE;IACrF,6BAA6B;IAC7B,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACpE,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACnE,6BAA6B;IAC7B,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACpE,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACnE,SAAS;IACT,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,MAAM,CAAC;IAC/D,OAAO;IACP,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAC/D,yBAAyB;IACzB,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,kBAAkB,CAAC,CAAC,CAAC;IACpF,8BAA8B;IAC9B,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAClF,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,SAAS,CAAC;IAC5H,KAAK;IACL,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,MAAM,CAAC;IAC/D,KAAK;IACL,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,EAAE,CAAC;IAC3D,OAAO;IACP,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAC7D,WAAW;IACX,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,kBAAkB,CAAC,QAAQ,CAAC;IAClE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
interface ParsedNode {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
properties: {
|
|
5
|
+
name: string;
|
|
6
|
+
filePath: string;
|
|
7
|
+
startLine: number;
|
|
8
|
+
endLine: number;
|
|
9
|
+
language: string;
|
|
10
|
+
isExported: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface ParsedRelationship {
|
|
14
|
+
id: string;
|
|
15
|
+
sourceId: string;
|
|
16
|
+
targetId: string;
|
|
17
|
+
type: 'DEFINES';
|
|
18
|
+
confidence: number;
|
|
19
|
+
reason: string;
|
|
20
|
+
}
|
|
21
|
+
interface ParsedSymbol {
|
|
22
|
+
filePath: string;
|
|
23
|
+
name: string;
|
|
24
|
+
nodeId: string;
|
|
25
|
+
type: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ExtractedImport {
|
|
28
|
+
filePath: string;
|
|
29
|
+
rawImportPath: string;
|
|
30
|
+
language: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ExtractedCall {
|
|
33
|
+
filePath: string;
|
|
34
|
+
calledName: string;
|
|
35
|
+
/** generateId of enclosing function, or generateId('File', filePath) for top-level */
|
|
36
|
+
sourceId: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ExtractedHeritage {
|
|
39
|
+
filePath: string;
|
|
40
|
+
className: string;
|
|
41
|
+
parentName: string;
|
|
42
|
+
/** 'extends' | 'implements' | 'trait-impl' */
|
|
43
|
+
kind: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ParseWorkerResult {
|
|
46
|
+
nodes: ParsedNode[];
|
|
47
|
+
relationships: ParsedRelationship[];
|
|
48
|
+
symbols: ParsedSymbol[];
|
|
49
|
+
imports: ExtractedImport[];
|
|
50
|
+
calls: ExtractedCall[];
|
|
51
|
+
heritage: ExtractedHeritage[];
|
|
52
|
+
fileCount: number;
|
|
53
|
+
}
|
|
54
|
+
export interface ParseWorkerInput {
|
|
55
|
+
path: string;
|
|
56
|
+
content: string;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=parse-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-worker.d.ts","sourceRoot":"","sources":["../../../../../../../src/tools/code-analyzer/core/ingestion/workers/parse-worker.ts"],"names":[],"mappings":"AAqBA,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;CACH;AAED,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}
|