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,121 @@
|
|
|
1
|
+
import { Worker } from 'node:worker_threads';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
/**
|
|
4
|
+
* Max files to send to a worker in a single postMessage.
|
|
5
|
+
* Keeps structured-clone memory bounded per sub-batch.
|
|
6
|
+
*/
|
|
7
|
+
const SUB_BATCH_SIZE = 1500;
|
|
8
|
+
/** Per sub-batch timeout. If a single sub-batch takes longer than this,
|
|
9
|
+
* likely a pathological file (e.g. minified 50MB JS). Fail fast. */
|
|
10
|
+
const SUB_BATCH_TIMEOUT_MS = 30_000;
|
|
11
|
+
/**
|
|
12
|
+
* Create a pool of worker threads.
|
|
13
|
+
*/
|
|
14
|
+
export const createWorkerPool = (workerUrl, poolSize) => {
|
|
15
|
+
const size = poolSize ?? Math.min(8, Math.max(1, os.cpus().length - 1));
|
|
16
|
+
const workers = [];
|
|
17
|
+
for (let i = 0; i < size; i++) {
|
|
18
|
+
workers.push(new Worker(workerUrl));
|
|
19
|
+
}
|
|
20
|
+
const dispatch = (items, onProgress) => {
|
|
21
|
+
if (items.length === 0)
|
|
22
|
+
return Promise.resolve([]);
|
|
23
|
+
const chunkSize = Math.ceil(items.length / size);
|
|
24
|
+
const chunks = [];
|
|
25
|
+
for (let i = 0; i < items.length; i += chunkSize) {
|
|
26
|
+
chunks.push(items.slice(i, i + chunkSize));
|
|
27
|
+
}
|
|
28
|
+
const workerProgress = new Array(chunks.length).fill(0);
|
|
29
|
+
const promises = chunks.map((chunk, i) => {
|
|
30
|
+
const worker = workers[i];
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
let settled = false;
|
|
33
|
+
let subBatchTimer = null;
|
|
34
|
+
const cleanup = () => {
|
|
35
|
+
if (subBatchTimer)
|
|
36
|
+
clearTimeout(subBatchTimer);
|
|
37
|
+
worker.removeListener('message', handler);
|
|
38
|
+
worker.removeListener('error', errorHandler);
|
|
39
|
+
worker.removeListener('exit', exitHandler);
|
|
40
|
+
};
|
|
41
|
+
const resetSubBatchTimer = () => {
|
|
42
|
+
if (subBatchTimer)
|
|
43
|
+
clearTimeout(subBatchTimer);
|
|
44
|
+
subBatchTimer = setTimeout(() => {
|
|
45
|
+
if (!settled) {
|
|
46
|
+
settled = true;
|
|
47
|
+
cleanup();
|
|
48
|
+
reject(new Error(`Worker ${i} sub-batch timed out after ${SUB_BATCH_TIMEOUT_MS / 1000}s (chunk: ${chunk.length} items).`));
|
|
49
|
+
}
|
|
50
|
+
}, SUB_BATCH_TIMEOUT_MS);
|
|
51
|
+
};
|
|
52
|
+
let subBatchIdx = 0;
|
|
53
|
+
const sendNextSubBatch = () => {
|
|
54
|
+
const start = subBatchIdx * SUB_BATCH_SIZE;
|
|
55
|
+
if (start >= chunk.length) {
|
|
56
|
+
worker.postMessage({ type: 'flush' });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const subBatch = chunk.slice(start, start + SUB_BATCH_SIZE);
|
|
60
|
+
subBatchIdx++;
|
|
61
|
+
resetSubBatchTimer();
|
|
62
|
+
worker.postMessage({ type: 'sub-batch', files: subBatch });
|
|
63
|
+
};
|
|
64
|
+
const handler = (msg) => {
|
|
65
|
+
if (settled)
|
|
66
|
+
return;
|
|
67
|
+
if (msg && msg.type === 'progress') {
|
|
68
|
+
workerProgress[i] = msg.filesProcessed;
|
|
69
|
+
if (onProgress) {
|
|
70
|
+
const total = workerProgress.reduce((a, b) => a + b, 0);
|
|
71
|
+
onProgress(total);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if (msg && msg.type === 'sub-batch-done') {
|
|
75
|
+
sendNextSubBatch();
|
|
76
|
+
}
|
|
77
|
+
else if (msg && msg.type === 'error') {
|
|
78
|
+
settled = true;
|
|
79
|
+
cleanup();
|
|
80
|
+
reject(new Error(`Worker ${i} error: ${msg.error}`));
|
|
81
|
+
}
|
|
82
|
+
else if (msg && msg.type === 'result') {
|
|
83
|
+
settled = true;
|
|
84
|
+
cleanup();
|
|
85
|
+
resolve(msg.data);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
settled = true;
|
|
89
|
+
cleanup();
|
|
90
|
+
resolve(msg);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const errorHandler = (err) => {
|
|
94
|
+
if (!settled) {
|
|
95
|
+
settled = true;
|
|
96
|
+
cleanup();
|
|
97
|
+
reject(err);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const exitHandler = (code) => {
|
|
101
|
+
if (!settled) {
|
|
102
|
+
settled = true;
|
|
103
|
+
cleanup();
|
|
104
|
+
reject(new Error(`Worker ${i} exited with code ${code}. Likely OOM or native addon failure.`));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
worker.on('message', handler);
|
|
108
|
+
worker.once('error', errorHandler);
|
|
109
|
+
worker.once('exit', exitHandler);
|
|
110
|
+
sendNextSubBatch();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
return Promise.all(promises);
|
|
114
|
+
};
|
|
115
|
+
const terminate = async () => {
|
|
116
|
+
await Promise.all(workers.map(w => w.terminate()));
|
|
117
|
+
workers.length = 0;
|
|
118
|
+
};
|
|
119
|
+
return { dispatch, terminate, size };
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=worker-pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-pool.js","sourceRoot":"","sources":["../../../../../../../src/tools/code-analyzer/core/ingestion/workers/worker-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AAiBzB;;;GAGG;AACH,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B;qEACqE;AACrE,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAc,EAAE,QAAiB,EAAc,EAAE;IAChF,MAAM,IAAI,GAAG,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxE,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,QAAQ,GAAG,CAAkB,KAAe,EAAE,UAA6C,EAAsB,EAAE;QACvH,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEnD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACjD,MAAM,MAAM,GAAe,EAAE,CAAC;QAC9B,KAAK,IAAI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CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,IAAmB,EAAE;QAC1C,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Parser from 'tree-sitter';
|
|
2
|
+
import { SupportedLanguages } from '../../config/supported-languages.js';
|
|
3
|
+
export declare const loadParser: () => Promise<Parser>;
|
|
4
|
+
export declare const loadLanguage: (language: SupportedLanguages, filePath?: string) => Promise<void>;
|
|
5
|
+
//# sourceMappingURL=parser-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-loader.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/tree-sitter/parser-loader.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAWjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAkBzE,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,MAAM,CAIjD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,UAAU,kBAAkB,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAWhG,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Parser from 'tree-sitter';
|
|
2
|
+
import JavaScript from 'tree-sitter-javascript';
|
|
3
|
+
import TypeScript from 'tree-sitter-typescript';
|
|
4
|
+
import Python from 'tree-sitter-python';
|
|
5
|
+
import Java from 'tree-sitter-java';
|
|
6
|
+
import C from 'tree-sitter-c';
|
|
7
|
+
import CPP from 'tree-sitter-cpp';
|
|
8
|
+
import CSharp from 'tree-sitter-c-sharp';
|
|
9
|
+
import Go from 'tree-sitter-go';
|
|
10
|
+
import Rust from 'tree-sitter-rust';
|
|
11
|
+
import Solidity from 'tree-sitter-solidity';
|
|
12
|
+
import { SupportedLanguages } from '../../config/supported-languages.js';
|
|
13
|
+
let parser = null;
|
|
14
|
+
const languageMap = {
|
|
15
|
+
[SupportedLanguages.JavaScript]: JavaScript,
|
|
16
|
+
[SupportedLanguages.TypeScript]: TypeScript.typescript,
|
|
17
|
+
[`${SupportedLanguages.TypeScript}:tsx`]: TypeScript.tsx,
|
|
18
|
+
[SupportedLanguages.Python]: Python,
|
|
19
|
+
[SupportedLanguages.Java]: Java,
|
|
20
|
+
[SupportedLanguages.C]: C,
|
|
21
|
+
[SupportedLanguages.CPlusPlus]: CPP,
|
|
22
|
+
[SupportedLanguages.CSharp]: CSharp,
|
|
23
|
+
[SupportedLanguages.Go]: Go,
|
|
24
|
+
[SupportedLanguages.Rust]: Rust,
|
|
25
|
+
[SupportedLanguages.Solidity]: Solidity,
|
|
26
|
+
};
|
|
27
|
+
export const loadParser = async () => {
|
|
28
|
+
if (parser)
|
|
29
|
+
return parser;
|
|
30
|
+
parser = new Parser();
|
|
31
|
+
return parser;
|
|
32
|
+
};
|
|
33
|
+
export const loadLanguage = async (language, filePath) => {
|
|
34
|
+
if (!parser)
|
|
35
|
+
await loadParser();
|
|
36
|
+
const key = language === SupportedLanguages.TypeScript && filePath?.endsWith('.tsx')
|
|
37
|
+
? `${language}:tsx`
|
|
38
|
+
: language;
|
|
39
|
+
const lang = languageMap[key];
|
|
40
|
+
if (!lang) {
|
|
41
|
+
throw new Error(`Unsupported language: ${language}`);
|
|
42
|
+
}
|
|
43
|
+
parser.setLanguage(lang);
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=parser-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-loader.js","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/tree-sitter/parser-loader.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,CAAC,MAAM,eAAe,CAAC;AAC9B,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC,MAAM,WAAW,GAAwB;IACvC,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,UAAU;IAC3C,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU;IACtD,CAAC,GAAG,kBAAkB,CAAC,UAAU,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACxD,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM;IACnC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI;IAC/B,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,GAAG;IACnC,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM;IACnC,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC3B,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI;IAC/B,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,QAAQ;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,IAAqB,EAAE;IACpD,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,QAA4B,EAAE,QAAiB,EAAiB,EAAE;IACnG,IAAI,CAAC,MAAM;QAAE,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,GAAG,GAAG,QAAQ,KAAK,kBAAkB,CAAC,UAAU,IAAI,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;QAClF,CAAC,CAAC,GAAG,QAAQ,MAAM;QACnB,CAAC,CAAC,QAAQ,CAAC;IAEb,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,MAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitNexus Pipeline — Programmatic API
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { runPipelineFromRepo } from 'gitnexus-pipeline';
|
|
6
|
+
* const result = await runPipelineFromRepo('/path/to/repo', console.log);
|
|
7
|
+
*/
|
|
8
|
+
export { runPipelineFromRepo } from './core/ingestion/pipeline.js';
|
|
9
|
+
export type { KnowledgeGraph, GraphNode, GraphRelationship, NodeLabel, RelationshipType } from './core/graph/types.js';
|
|
10
|
+
export { createKnowledgeGraph } from './core/graph/graph.js';
|
|
11
|
+
export type { PipelineProgress, PipelineResult, PipelinePhase } from './types/pipeline.js';
|
|
12
|
+
export { serializePipelineResult, deserializePipelineResult } from './types/pipeline.js';
|
|
13
|
+
export type { CommunityDetectionResult, CommunityNode, CommunityMembership } from './core/ingestion/community-processor.js';
|
|
14
|
+
export type { ProcessDetectionResult, ProcessNode, ProcessStep } from './core/ingestion/process-processor.js';
|
|
15
|
+
export { SupportedLanguages } from './config/supported-languages.js';
|
|
16
|
+
export { getLanguageFromFilename } from './core/ingestion/utils.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/code-analyzer/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG7D,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGzF,YAAY,EAAE,wBAAwB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC5H,YAAY,EAAE,sBAAsB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAG9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitNexus Pipeline — Programmatic API
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { runPipelineFromRepo } from 'gitnexus-pipeline';
|
|
6
|
+
* const result = await runPipelineFromRepo('/path/to/repo', console.log);
|
|
7
|
+
*/
|
|
8
|
+
// Core pipeline
|
|
9
|
+
export { runPipelineFromRepo } from './core/ingestion/pipeline.js';
|
|
10
|
+
export { createKnowledgeGraph } from './core/graph/graph.js';
|
|
11
|
+
export { serializePipelineResult, deserializePipelineResult } from './types/pipeline.js';
|
|
12
|
+
// Utilities
|
|
13
|
+
export { SupportedLanguages } from './config/supported-languages.js';
|
|
14
|
+
export { getLanguageFromFilename } from './core/ingestion/utils.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/code-analyzer/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gBAAgB;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAMzF,YAAY;AACZ,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/tools/code-analyzer/lib/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAExD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/tools/code-analyzer/lib/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAU,EAAE;IAChE,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,CAAA;AAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { GraphNode, GraphRelationship, KnowledgeGraph } from '../core/graph/types.js';
|
|
2
|
+
import { CommunityDetectionResult } from '../core/ingestion/community-processor.js';
|
|
3
|
+
import { ProcessDetectionResult } from '../core/ingestion/process-processor.js';
|
|
4
|
+
export type PipelinePhase = 'idle' | 'extracting' | 'structure' | 'parsing' | 'imports' | 'calls' | 'heritage' | 'communities' | 'processes' | 'enriching' | 'complete' | 'error';
|
|
5
|
+
export interface PipelineProgress {
|
|
6
|
+
phase: PipelinePhase;
|
|
7
|
+
percent: number;
|
|
8
|
+
message: string;
|
|
9
|
+
detail?: string;
|
|
10
|
+
stats?: {
|
|
11
|
+
filesProcessed: number;
|
|
12
|
+
totalFiles: number;
|
|
13
|
+
nodesCreated: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface PipelineResult {
|
|
17
|
+
graph: KnowledgeGraph;
|
|
18
|
+
/** Absolute path to the repo root — used for lazy file reads during KuzuDB loading */
|
|
19
|
+
repoPath: string;
|
|
20
|
+
/** Total files scanned (for stats) */
|
|
21
|
+
totalFileCount: number;
|
|
22
|
+
communityResult?: CommunityDetectionResult;
|
|
23
|
+
processResult?: ProcessDetectionResult;
|
|
24
|
+
}
|
|
25
|
+
export interface SerializablePipelineResult {
|
|
26
|
+
nodes: GraphNode[];
|
|
27
|
+
relationships: GraphRelationship[];
|
|
28
|
+
repoPath: string;
|
|
29
|
+
totalFileCount: number;
|
|
30
|
+
}
|
|
31
|
+
export declare const serializePipelineResult: (result: PipelineResult) => SerializablePipelineResult;
|
|
32
|
+
export declare const deserializePipelineResult: (serialized: SerializablePipelineResult, createGraph: () => KnowledgeGraph) => PipelineResult;
|
|
33
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../../src/tools/code-analyzer/types/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EA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|
|
2
|
+
export const serializePipelineResult = (result) => ({
|
|
3
|
+
nodes: [...result.graph.iterNodes()],
|
|
4
|
+
relationships: [...result.graph.iterRelationships()],
|
|
5
|
+
repoPath: result.repoPath,
|
|
6
|
+
totalFileCount: result.totalFileCount,
|
|
7
|
+
});
|
|
8
|
+
// Helper to reconstruct from serializable format (used in main thread)
|
|
9
|
+
export const deserializePipelineResult = (serialized, createGraph) => {
|
|
10
|
+
const graph = createGraph();
|
|
11
|
+
serialized.nodes.forEach(node => graph.addNode(node));
|
|
12
|
+
serialized.relationships.forEach(rel => graph.addRelationship(rel));
|
|
13
|
+
return {
|
|
14
|
+
graph,
|
|
15
|
+
repoPath: serialized.repoPath,
|
|
16
|
+
totalFileCount: serialized.totalFileCount,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../../../src/tools/code-analyzer/types/pipeline.ts"],"names":[],"mappings":"AAsCA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAsB,EAA8B,EAAE,CAAC,CAAC;IAC9F,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;IACpC,aAAa,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACpD,QAAQ,EAAE,MAAM,CAAC,QAAQ;IACzB,cAAc,EAAE,MAAM,CAAC,cAAc;CACtC,CAAC,CAAC;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,UAAsC,EACtC,WAAiC,EACjB,EAAE;IAClB,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;IAEpE,OAAO;QACL,KAAK;QACL,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,cAAc,EAAE,UAAU,CAAC,cAAc;KAC1C,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export interface LoginResponse {
|
|
2
|
+
success: boolean;
|
|
3
|
+
access_token: string;
|
|
4
|
+
token_type: string;
|
|
5
|
+
user: {
|
|
6
|
+
user_id: string;
|
|
7
|
+
username: string;
|
|
8
|
+
display_name: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface UserInfo {
|
|
12
|
+
success: boolean;
|
|
13
|
+
user_id: string;
|
|
14
|
+
username: string;
|
|
15
|
+
display_name: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthStatus {
|
|
18
|
+
auth_enabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface SessionInfo {
|
|
21
|
+
thread_id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
last_activity: string;
|
|
25
|
+
message_count: number;
|
|
26
|
+
}
|
|
27
|
+
export interface SessionStats {
|
|
28
|
+
total_messages: number;
|
|
29
|
+
user_messages: number;
|
|
30
|
+
assistant_messages: number;
|
|
31
|
+
tool_calls: number;
|
|
32
|
+
tokens_used: number;
|
|
33
|
+
start_time: string;
|
|
34
|
+
last_activity: string;
|
|
35
|
+
}
|
|
36
|
+
export interface HistoryMessage {
|
|
37
|
+
id: number;
|
|
38
|
+
type: 'user' | 'assistant';
|
|
39
|
+
content: string;
|
|
40
|
+
timestamp: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
export interface ModelInfo {
|
|
44
|
+
name: string;
|
|
45
|
+
provider: string;
|
|
46
|
+
display_name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
max_context_length: number;
|
|
49
|
+
max_completion_tokens: number;
|
|
50
|
+
supports_vision: boolean;
|
|
51
|
+
supports_tools: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface ModelCurrent {
|
|
54
|
+
provider: string;
|
|
55
|
+
model: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CommandDef {
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
usage: string;
|
|
61
|
+
aliases?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface CommandResponse {
|
|
64
|
+
success: boolean;
|
|
65
|
+
message: string;
|
|
66
|
+
data?: Record<string, unknown>;
|
|
67
|
+
should_exit?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface ToolInfo {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
category?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface SSESessionInfo {
|
|
75
|
+
thread_id: string;
|
|
76
|
+
}
|
|
77
|
+
export interface SSESessionTitle {
|
|
78
|
+
thread_id: string;
|
|
79
|
+
title: string;
|
|
80
|
+
}
|
|
81
|
+
export interface SSETextChunk {
|
|
82
|
+
type: 'text';
|
|
83
|
+
content: string;
|
|
84
|
+
node?: string;
|
|
85
|
+
thread_id: string;
|
|
86
|
+
}
|
|
87
|
+
export interface SSEDone {
|
|
88
|
+
thread_id: string;
|
|
89
|
+
}
|
|
90
|
+
export interface SSEToolCall {
|
|
91
|
+
content: {
|
|
92
|
+
name: string;
|
|
93
|
+
args?: Record<string, unknown>;
|
|
94
|
+
};
|
|
95
|
+
metadata?: Record<string, unknown>;
|
|
96
|
+
thread_id?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SSEToolResult {
|
|
99
|
+
content?: string;
|
|
100
|
+
tool_call_id?: string;
|
|
101
|
+
thread_id?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface SSEError {
|
|
104
|
+
content: string;
|
|
105
|
+
thread_id: string;
|
|
106
|
+
}
|
|
107
|
+
export interface HealthResponse {
|
|
108
|
+
status: string;
|
|
109
|
+
version: string;
|
|
110
|
+
services: {
|
|
111
|
+
llm: boolean;
|
|
112
|
+
mcp: boolean;
|
|
113
|
+
rag: boolean;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export interface ConfigResponse {
|
|
117
|
+
target_dir: string;
|
|
118
|
+
enable_planning: boolean;
|
|
119
|
+
enable_mcp: boolean;
|
|
120
|
+
enable_rag: boolean;
|
|
121
|
+
default_provider: string;
|
|
122
|
+
default_model: string;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,OAAO,CAAC;CACvB;AAGD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,E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B,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":"AAAA,qCAAqC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface HistoryItemBase {
|
|
2
|
+
id: number;
|
|
3
|
+
}
|
|
4
|
+
export type HistoryItemUser = HistoryItemBase & {
|
|
5
|
+
type: 'user';
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
export type HistoryItemAssistant = HistoryItemBase & {
|
|
9
|
+
type: 'assistant';
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
export type HistoryItemInfo = HistoryItemBase & {
|
|
13
|
+
type: 'info';
|
|
14
|
+
text: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
};
|
|
18
|
+
export type HistoryItemError = HistoryItemBase & {
|
|
19
|
+
type: 'error';
|
|
20
|
+
text: string;
|
|
21
|
+
};
|
|
22
|
+
export type HistoryItemToolCall = HistoryItemBase & {
|
|
23
|
+
type: 'tool_call';
|
|
24
|
+
name: string;
|
|
25
|
+
status: 'pending' | 'running' | 'success' | 'error';
|
|
26
|
+
result?: string;
|
|
27
|
+
};
|
|
28
|
+
export type HistoryItemModel = HistoryItemBase & {
|
|
29
|
+
type: 'model';
|
|
30
|
+
model: string;
|
|
31
|
+
provider: string;
|
|
32
|
+
};
|
|
33
|
+
export type HistoryItemSession = HistoryItemBase & {
|
|
34
|
+
type: 'session';
|
|
35
|
+
title: string;
|
|
36
|
+
action: 'created' | 'switched' | 'cleared';
|
|
37
|
+
};
|
|
38
|
+
export type HistoryItemCommand = HistoryItemBase & {
|
|
39
|
+
type: 'command';
|
|
40
|
+
command: string;
|
|
41
|
+
result: string;
|
|
42
|
+
};
|
|
43
|
+
export type HistoryItem = HistoryItemUser | HistoryItemAssistant | HistoryItemInfo | HistoryItemError | HistoryItemToolCall | HistoryItemModel | HistoryItemSession | HistoryItemCommand;
|
|
44
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
45
|
+
export type HistoryItemWithoutId = DistributiveOmit<HistoryItem, 'id'>;
|
|
46
|
+
export declare function nextHistoryId(): number;
|
|
47
|
+
export declare function resetHistoryId(): void;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/types/history.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG;IACnD,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG;IAC/C,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG;IAC/C,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,CAAC;AAGvB,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;AACrF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAIvE,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/types/history.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAmEjD,iCAAiC;AACjC,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const palette: {
|
|
2
|
+
brand1: string;
|
|
3
|
+
brand2: string;
|
|
4
|
+
brand3: string;
|
|
5
|
+
brand4: string;
|
|
6
|
+
brand5: string;
|
|
7
|
+
brand6: string;
|
|
8
|
+
primary: string;
|
|
9
|
+
accent: string;
|
|
10
|
+
success: string;
|
|
11
|
+
warning: string;
|
|
12
|
+
error: string;
|
|
13
|
+
info: string;
|
|
14
|
+
text: string;
|
|
15
|
+
textMuted: string;
|
|
16
|
+
textDim: string;
|
|
17
|
+
border: string;
|
|
18
|
+
borderAccent: string;
|
|
19
|
+
surface: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const colors: {
|
|
22
|
+
userPrefix: string;
|
|
23
|
+
assistantPrefix: string;
|
|
24
|
+
errorPrefix: string;
|
|
25
|
+
infoPrefix: string;
|
|
26
|
+
toolPrefix: string;
|
|
27
|
+
dim: import("chalk").ChalkInstance;
|
|
28
|
+
bold: import("chalk").ChalkInstance;
|
|
29
|
+
error: import("chalk").ChalkInstance;
|
|
30
|
+
warning: import("chalk").ChalkInstance;
|
|
31
|
+
success: import("chalk").ChalkInstance;
|
|
32
|
+
info: import("chalk").ChalkInstance;
|
|
33
|
+
accent: import("chalk").ChalkInstance;
|
|
34
|
+
muted: import("chalk").ChalkInstance;
|
|
35
|
+
statusRunning: string;
|
|
36
|
+
statusSuccess: string;
|
|
37
|
+
statusError: string;
|
|
38
|
+
statusPending: string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/utils/colors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CA0BnB,CAAC;AAGF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;CAoBlB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
// ── Brand Palette ──────────────────────────────────────────────
|
|
3
|
+
// Warm, muted tones inspired by Claude Code's light-terminal style
|
|
4
|
+
export const palette = {
|
|
5
|
+
// Brand — warm amber/orange tones
|
|
6
|
+
brand1: '#D97706', // Amber-600
|
|
7
|
+
brand2: '#B45309', // Amber-700
|
|
8
|
+
brand3: '#92400E', // Amber-800
|
|
9
|
+
brand4: '#78350F', // Amber-900
|
|
10
|
+
brand5: '#451A03', // Amber-950
|
|
11
|
+
brand6: '#451A03', // Amber-950
|
|
12
|
+
// Functional
|
|
13
|
+
primary: '#D97706', // Amber-600 (main accent)
|
|
14
|
+
accent: '#0284C7', // Sky-600 (secondary accent)
|
|
15
|
+
success: '#16A34A', // Green-600
|
|
16
|
+
warning: '#D97706', // Amber-600
|
|
17
|
+
error: '#DC2626', // Red-600
|
|
18
|
+
info: '#0284C7', // Sky-600
|
|
19
|
+
// Text hierarchy
|
|
20
|
+
text: '#1C1917', // Stone-900 (near black)
|
|
21
|
+
textMuted: '#57534E', // Stone-600
|
|
22
|
+
textDim: '#A8A29E', // Stone-400
|
|
23
|
+
// Borders — subtle gray, not colored
|
|
24
|
+
border: '#D6D3D1', // Stone-300
|
|
25
|
+
borderAccent: '#A8A29E', // Stone-400 (subtle, not flashy)
|
|
26
|
+
surface: '#F5F5F4', // Stone-100
|
|
27
|
+
};
|
|
28
|
+
// ── Backward-Compatible Export ─────────────────────────────────
|
|
29
|
+
export const colors = {
|
|
30
|
+
userPrefix: chalk.hex(palette.success).bold('❯ '),
|
|
31
|
+
assistantPrefix: chalk.hex(palette.primary).bold('✦ '),
|
|
32
|
+
errorPrefix: chalk.hex(palette.error).bold('✗ '),
|
|
33
|
+
infoPrefix: chalk.hex(palette.info).bold('ℹ '),
|
|
34
|
+
toolPrefix: chalk.hex(palette.warning)('⚙ '),
|
|
35
|
+
dim: chalk.dim,
|
|
36
|
+
bold: chalk.bold,
|
|
37
|
+
error: chalk.hex(palette.error),
|
|
38
|
+
warning: chalk.hex(palette.warning),
|
|
39
|
+
success: chalk.hex(palette.success),
|
|
40
|
+
info: chalk.hex(palette.info),
|
|
41
|
+
accent: chalk.hex(palette.accent),
|
|
42
|
+
muted: chalk.hex(palette.textMuted),
|
|
43
|
+
statusRunning: chalk.hex(palette.warning)('⟳'),
|
|
44
|
+
statusSuccess: chalk.hex(palette.success)('✓'),
|
|
45
|
+
statusError: chalk.hex(palette.error)('✗'),
|
|
46
|
+
statusPending: chalk.hex(palette.textDim)('○'),
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,kEAAkE;AAClE,mEAAmE;AACnE,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,kCAAkC;IAClC,MAAM,EAAE,SAAS,EAAE,YAAY;IAC/B,MAAM,EAAE,SAAS,EAAE,YAAY;IAC/B,MAAM,EAAE,SAAS,EAAE,YAAY;IAC/B,MAAM,EAAE,SAAS,EAAE,YAAY;IAC/B,MAAM,EAAE,SAAS,EAAE,YAAY;IAC/B,MAAM,EAAE,SAAS,EAAE,YAAY;IAE/B,aAAa;IACb,OAAO,EAAE,SAAS,EAAE,0BAA0B;IAC9C,MAAM,EAAE,SAAS,EAAG,6BAA6B;IACjD,OAAO,EAAE,SAAS,EAAE,YAAY;IAChC,OAAO,EAAE,SAAS,EAAE,YAAY;IAChC,KAAK,EAAE,SAAS,EAAI,UAAU;IAC9B,IAAI,EAAE,SAAS,EAAK,UAAU;IAE9B,iBAAiB;IACjB,IAAI,EAAE,SAAS,EAAO,yBAAyB;IAC/C,SAAS,EAAE,SAAS,EAAG,YAAY;IACnC,OAAO,EAAE,SAAS,EAAK,YAAY;IAEnC,qCAAqC;IACrC,MAAM,EAAE,SAAS,EAAO,YAAY;IACpC,YAAY,EAAE,SAAS,EAAE,iCAAiC;IAC1D,OAAO,EAAE,SAAS,EAAM,YAAY;CACrC,CA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C,CAAC,GAAG,CAAC;IAC1C,aAAa,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC;CAC/C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_SERVER_URL = "https://solidity.slowmist.ai";
|
|
2
|
+
export declare function getServerUrl(cliArg?: string): string;
|
|
3
|
+
export declare function saveToken(token: string): void;
|
|
4
|
+
export declare function loadToken(): string | null;
|
|
5
|
+
export declare function clearToken(): void;
|
|
6
|
+
export declare const CODE_ANALYZER_DIR = ".mistagent";
|
|
7
|
+
export declare const CODE_ANALYZER_GRAPH_FILE = "graph.json";
|
|
8
|
+
export declare const CALL_CHAIN_MIN_CONFIDENCE = 0.1;
|
|
9
|
+
export declare const CALL_CHAIN_MAX_DEPTH = 1;
|
|
10
|
+
export declare const CALL_CHAIN_MAX_ITEMS_PER_LEVEL = 10;
|
|
11
|
+
export declare const DEBUG_LOG_AITEXT = false;
|
|
12
|
+
export declare const DEBUG_AITEXT_FILE = "debug-aitext.txt";
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|