codeseeker 1.4.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/LICENSE +21 -0
- package/README.md +388 -0
- package/bin/codeseeker.js +171 -0
- package/dist/cli/analyzers/change-analyzer.d.ts +7 -0
- package/dist/cli/analyzers/change-analyzer.d.ts.map +1 -0
- package/dist/cli/analyzers/change-analyzer.js +22 -0
- package/dist/cli/analyzers/change-analyzer.js.map +1 -0
- package/dist/cli/analyzers/configuration-analyzer.d.ts +7 -0
- package/dist/cli/analyzers/configuration-analyzer.d.ts.map +1 -0
- package/dist/cli/analyzers/configuration-analyzer.js +67 -0
- package/dist/cli/analyzers/configuration-analyzer.js.map +1 -0
- package/dist/cli/analyzers/documentation-analyzer.d.ts +7 -0
- package/dist/cli/analyzers/documentation-analyzer.d.ts.map +1 -0
- package/dist/cli/analyzers/documentation-analyzer.js +59 -0
- package/dist/cli/analyzers/documentation-analyzer.js.map +1 -0
- package/dist/cli/analyzers/project-structure-analyzer.d.ts +7 -0
- package/dist/cli/analyzers/project-structure-analyzer.d.ts.map +1 -0
- package/dist/cli/analyzers/project-structure-analyzer.js +68 -0
- package/dist/cli/analyzers/project-structure-analyzer.js.map +1 -0
- package/dist/cli/codemind-workflow-orchestrator.d.ts +19 -0
- package/dist/cli/codemind-workflow-orchestrator.d.ts.map +1 -0
- package/dist/cli/codemind-workflow-orchestrator.js +26 -0
- package/dist/cli/codemind-workflow-orchestrator.js.map +1 -0
- package/dist/cli/codeseeker-cli.d.ts +156 -0
- package/dist/cli/codeseeker-cli.d.ts.map +1 -0
- package/dist/cli/codeseeker-cli.js +937 -0
- package/dist/cli/codeseeker-cli.js.map +1 -0
- package/dist/cli/codeseeker-workflow-orchestrator.d.ts +19 -0
- package/dist/cli/codeseeker-workflow-orchestrator.d.ts.map +1 -0
- package/dist/cli/codeseeker-workflow-orchestrator.js +26 -0
- package/dist/cli/codeseeker-workflow-orchestrator.js.map +1 -0
- package/dist/cli/commands/base-command-handler.d.ts +31 -0
- package/dist/cli/commands/base-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/base-command-handler.js +110 -0
- package/dist/cli/commands/base-command-handler.js.map +1 -0
- package/dist/cli/commands/command-context.d.ts +27 -0
- package/dist/cli/commands/command-context.d.ts.map +1 -0
- package/dist/cli/commands/command-context.js +8 -0
- package/dist/cli/commands/command-context.js.map +1 -0
- package/dist/cli/commands/command-router.d.ts +135 -0
- package/dist/cli/commands/command-router.d.ts.map +1 -0
- package/dist/cli/commands/command-router.js +497 -0
- package/dist/cli/commands/command-router.js.map +1 -0
- package/dist/cli/commands/handlers/analyze-command-handler.d.ts +99 -0
- package/dist/cli/commands/handlers/analyze-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/analyze-command-handler.js +704 -0
- package/dist/cli/commands/handlers/analyze-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/dedup-command-handler.d.ts +10 -0
- package/dist/cli/commands/handlers/dedup-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/dedup-command-handler.js +19 -0
- package/dist/cli/commands/handlers/dedup-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/docs-command-handler.d.ts +10 -0
- package/dist/cli/commands/handlers/docs-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/docs-command-handler.js +19 -0
- package/dist/cli/commands/handlers/docs-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/infrastructure-setup-handler.d.ts +21 -0
- package/dist/cli/commands/handlers/infrastructure-setup-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/infrastructure-setup-handler.js +71 -0
- package/dist/cli/commands/handlers/infrastructure-setup-handler.js.map +1 -0
- package/dist/cli/commands/handlers/install-command-handler.d.ts +80 -0
- package/dist/cli/commands/handlers/install-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/install-command-handler.js +466 -0
- package/dist/cli/commands/handlers/install-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/instructions-command-handler.d.ts +10 -0
- package/dist/cli/commands/handlers/instructions-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/instructions-command-handler.js +19 -0
- package/dist/cli/commands/handlers/instructions-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/project-command-handler.d.ts +42 -0
- package/dist/cli/commands/handlers/project-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/project-command-handler.js +257 -0
- package/dist/cli/commands/handlers/project-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/search-command-handler.d.ts +50 -0
- package/dist/cli/commands/handlers/search-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/search-command-handler.js +500 -0
- package/dist/cli/commands/handlers/search-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/setup-command-handler.d.ts +103 -0
- package/dist/cli/commands/handlers/setup-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/setup-command-handler.js +1135 -0
- package/dist/cli/commands/handlers/setup-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/solid-command-handler.d.ts +10 -0
- package/dist/cli/commands/handlers/solid-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/solid-command-handler.js +19 -0
- package/dist/cli/commands/handlers/solid-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/sync-command-handler.d.ts +10 -0
- package/dist/cli/commands/handlers/sync-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/sync-command-handler.js +19 -0
- package/dist/cli/commands/handlers/sync-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/synonyms-command-handler.d.ts +23 -0
- package/dist/cli/commands/handlers/synonyms-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/synonyms-command-handler.js +201 -0
- package/dist/cli/commands/handlers/synonyms-command-handler.js.map +1 -0
- package/dist/cli/commands/handlers/watcher-command-handler.d.ts +10 -0
- package/dist/cli/commands/handlers/watcher-command-handler.d.ts.map +1 -0
- package/dist/cli/commands/handlers/watcher-command-handler.js +19 -0
- package/dist/cli/commands/handlers/watcher-command-handler.js.map +1 -0
- package/dist/cli/commands/reconcile.d.ts +8 -0
- package/dist/cli/commands/reconcile.d.ts.map +1 -0
- package/dist/cli/commands/reconcile.js +220 -0
- package/dist/cli/commands/reconcile.js.map +1 -0
- package/dist/cli/commands/semantic-search.d.ts +8 -0
- package/dist/cli/commands/semantic-search.d.ts.map +1 -0
- package/dist/cli/commands/semantic-search.js +219 -0
- package/dist/cli/commands/semantic-search.js.map +1 -0
- package/dist/cli/commands/services/claude-intent-analyzer.d.ts +109 -0
- package/dist/cli/commands/services/claude-intent-analyzer.d.ts.map +1 -0
- package/dist/cli/commands/services/claude-intent-analyzer.js +405 -0
- package/dist/cli/commands/services/claude-intent-analyzer.js.map +1 -0
- package/dist/cli/commands/services/context-aware-clarification-service.d.ts +99 -0
- package/dist/cli/commands/services/context-aware-clarification-service.d.ts.map +1 -0
- package/dist/cli/commands/services/context-aware-clarification-service.js +414 -0
- package/dist/cli/commands/services/context-aware-clarification-service.js.map +1 -0
- package/dist/cli/commands/services/context-builder.d.ts +90 -0
- package/dist/cli/commands/services/context-builder.d.ts.map +1 -0
- package/dist/cli/commands/services/context-builder.js +330 -0
- package/dist/cli/commands/services/context-builder.js.map +1 -0
- package/dist/cli/commands/services/graph-analysis-service.d.ts +157 -0
- package/dist/cli/commands/services/graph-analysis-service.d.ts.map +1 -0
- package/dist/cli/commands/services/graph-analysis-service.js +722 -0
- package/dist/cli/commands/services/graph-analysis-service.js.map +1 -0
- package/dist/cli/commands/services/natural-language-processor.d.ts +41 -0
- package/dist/cli/commands/services/natural-language-processor.d.ts.map +1 -0
- package/dist/cli/commands/services/natural-language-processor.js +77 -0
- package/dist/cli/commands/services/natural-language-processor.js.map +1 -0
- package/dist/cli/commands/services/search-quality-metrics.d.ts +85 -0
- package/dist/cli/commands/services/search-quality-metrics.d.ts.map +1 -0
- package/dist/cli/commands/services/search-quality-metrics.js +214 -0
- package/dist/cli/commands/services/search-quality-metrics.js.map +1 -0
- package/dist/cli/commands/services/semantic-search-orchestrator.d.ts +85 -0
- package/dist/cli/commands/services/semantic-search-orchestrator.d.ts.map +1 -0
- package/dist/cli/commands/services/semantic-search-orchestrator.js +331 -0
- package/dist/cli/commands/services/semantic-search-orchestrator.js.map +1 -0
- package/dist/cli/commands/services/task-decomposition-service.d.ts +114 -0
- package/dist/cli/commands/services/task-decomposition-service.d.ts.map +1 -0
- package/dist/cli/commands/services/task-decomposition-service.js +364 -0
- package/dist/cli/commands/services/task-decomposition-service.js.map +1 -0
- package/dist/cli/commands/services/unified-query-analyzer.d.ts +75 -0
- package/dist/cli/commands/services/unified-query-analyzer.d.ts.map +1 -0
- package/dist/cli/commands/services/unified-query-analyzer.js +282 -0
- package/dist/cli/commands/services/unified-query-analyzer.js.map +1 -0
- package/dist/cli/commands/services/user-interaction-service.d.ts +326 -0
- package/dist/cli/commands/services/user-interaction-service.d.ts.map +1 -0
- package/dist/cli/commands/services/user-interaction-service.js +1987 -0
- package/dist/cli/commands/services/user-interaction-service.js.map +1 -0
- package/dist/cli/commands/services/workflow-orchestrator.d.ts +171 -0
- package/dist/cli/commands/services/workflow-orchestrator.d.ts.map +1 -0
- package/dist/cli/commands/services/workflow-orchestrator.js +660 -0
- package/dist/cli/commands/services/workflow-orchestrator.js.map +1 -0
- package/dist/cli/context-optimizer.d.ts +96 -0
- package/dist/cli/context-optimizer.d.ts.map +1 -0
- package/dist/cli/context-optimizer.js +582 -0
- package/dist/cli/context-optimizer.js.map +1 -0
- package/dist/cli/features/code-graph/graph-builder.d.ts +119 -0
- package/dist/cli/features/code-graph/graph-builder.d.ts.map +1 -0
- package/dist/cli/features/code-graph/graph-builder.js +532 -0
- package/dist/cli/features/code-graph/graph-builder.js.map +1 -0
- package/dist/cli/features/compilation/verifier.d.ts +69 -0
- package/dist/cli/features/compilation/verifier.d.ts.map +1 -0
- package/dist/cli/features/compilation/verifier.js +431 -0
- package/dist/cli/features/compilation/verifier.js.map +1 -0
- package/dist/cli/features/database/database-documentation-generator.d.ts +103 -0
- package/dist/cli/features/database/database-documentation-generator.d.ts.map +1 -0
- package/dist/cli/features/database/database-documentation-generator.js +386 -0
- package/dist/cli/features/database/database-documentation-generator.js.map +1 -0
- package/dist/cli/features/database/database-schema-tool.d.ts +160 -0
- package/dist/cli/features/database/database-schema-tool.d.ts.map +1 -0
- package/dist/cli/features/database/database-schema-tool.js +437 -0
- package/dist/cli/features/database/database-schema-tool.js.map +1 -0
- package/dist/cli/features/documentation/map-analyzer.d.ts +95 -0
- package/dist/cli/features/documentation/map-analyzer.d.ts.map +1 -0
- package/dist/cli/features/documentation/map-analyzer.js +320 -0
- package/dist/cli/features/documentation/map-analyzer.js.map +1 -0
- package/dist/cli/features/duplication/detector.d.ts +28 -0
- package/dist/cli/features/duplication/detector.d.ts.map +1 -0
- package/dist/cli/features/duplication/detector.js +228 -0
- package/dist/cli/features/duplication/detector.js.map +1 -0
- package/dist/cli/features/duplication/interfaces/index.d.ts +134 -0
- package/dist/cli/features/duplication/interfaces/index.d.ts.map +1 -0
- package/dist/cli/features/duplication/interfaces/index.js +31 -0
- package/dist/cli/features/duplication/interfaces/index.js.map +1 -0
- package/dist/cli/features/duplication/services/duplication-detection-service.d.ts +27 -0
- package/dist/cli/features/duplication/services/duplication-detection-service.d.ts.map +1 -0
- package/dist/cli/features/duplication/services/duplication-detection-service.js +316 -0
- package/dist/cli/features/duplication/services/duplication-detection-service.js.map +1 -0
- package/dist/cli/features/duplication/services/file-analysis-service.d.ts +24 -0
- package/dist/cli/features/duplication/services/file-analysis-service.d.ts.map +1 -0
- package/dist/cli/features/duplication/services/file-analysis-service.js +340 -0
- package/dist/cli/features/duplication/services/file-analysis-service.js.map +1 -0
- package/dist/cli/features/duplication/services/refactoring-advisor-service.d.ts +33 -0
- package/dist/cli/features/duplication/services/refactoring-advisor-service.d.ts.map +1 -0
- package/dist/cli/features/duplication/services/refactoring-advisor-service.js +378 -0
- package/dist/cli/features/duplication/services/refactoring-advisor-service.js.map +1 -0
- package/dist/cli/features/duplication/services/statistics-service.d.ts +24 -0
- package/dist/cli/features/duplication/services/statistics-service.d.ts.map +1 -0
- package/dist/cli/features/duplication/services/statistics-service.js +285 -0
- package/dist/cli/features/duplication/services/statistics-service.js.map +1 -0
- package/dist/cli/features/semantic-graph/semantic-graph-tool.d.ts +38 -0
- package/dist/cli/features/semantic-graph/semantic-graph-tool.d.ts.map +1 -0
- package/dist/cli/features/semantic-graph/semantic-graph-tool.js +340 -0
- package/dist/cli/features/semantic-graph/semantic-graph-tool.js.map +1 -0
- package/dist/cli/features/solid-principles/analyzer.d.ts +40 -0
- package/dist/cli/features/solid-principles/analyzer.d.ts.map +1 -0
- package/dist/cli/features/solid-principles/analyzer.js +163 -0
- package/dist/cli/features/solid-principles/analyzer.js.map +1 -0
- package/dist/cli/features/tree-navigation/navigator.d.ts +23 -0
- package/dist/cli/features/tree-navigation/navigator.d.ts.map +1 -0
- package/dist/cli/features/tree-navigation/navigator.js +94 -0
- package/dist/cli/features/tree-navigation/navigator.js.map +1 -0
- package/dist/cli/git/change-detector.d.ts +61 -0
- package/dist/cli/git/change-detector.d.ts.map +1 -0
- package/dist/cli/git/change-detector.js +380 -0
- package/dist/cli/git/change-detector.js.map +1 -0
- package/dist/cli/git/git-commit-utils.d.ts +12 -0
- package/dist/cli/git/git-commit-utils.d.ts.map +1 -0
- package/dist/cli/git/git-commit-utils.js +210 -0
- package/dist/cli/git/git-commit-utils.js.map +1 -0
- package/dist/cli/git/git-database-utils.d.ts +10 -0
- package/dist/cli/git/git-database-utils.d.ts.map +1 -0
- package/dist/cli/git/git-database-utils.js +105 -0
- package/dist/cli/git/git-database-utils.js.map +1 -0
- package/dist/cli/git/git-integration.d.ts +53 -0
- package/dist/cli/git/git-integration.d.ts.map +1 -0
- package/dist/cli/git/git-integration.js +152 -0
- package/dist/cli/git/git-integration.js.map +1 -0
- package/dist/cli/git/in-memory-git-store.d.ts +10 -0
- package/dist/cli/git/in-memory-git-store.d.ts.map +1 -0
- package/dist/cli/git/in-memory-git-store.js +35 -0
- package/dist/cli/git/in-memory-git-store.js.map +1 -0
- package/dist/cli/git/interfaces.d.ts +82 -0
- package/dist/cli/git/interfaces.d.ts.map +1 -0
- package/dist/cli/git/interfaces.js +7 -0
- package/dist/cli/git/interfaces.js.map +1 -0
- package/dist/cli/git/services/git-analysis-service.d.ts +21 -0
- package/dist/cli/git/services/git-analysis-service.d.ts.map +1 -0
- package/dist/cli/git/services/git-analysis-service.js +169 -0
- package/dist/cli/git/services/git-analysis-service.js.map +1 -0
- package/dist/cli/git/services/git-autocommit-service.d.ts +19 -0
- package/dist/cli/git/services/git-autocommit-service.d.ts.map +1 -0
- package/dist/cli/git/services/git-autocommit-service.js +205 -0
- package/dist/cli/git/services/git-autocommit-service.js.map +1 -0
- package/dist/cli/git/services/git-database-service.d.ts +23 -0
- package/dist/cli/git/services/git-database-service.d.ts.map +1 -0
- package/dist/cli/git/services/git-database-service.js +255 -0
- package/dist/cli/git/services/git-database-service.js.map +1 -0
- package/dist/cli/git/services/git-operations-service.d.ts +22 -0
- package/dist/cli/git/services/git-operations-service.d.ts.map +1 -0
- package/dist/cli/git/services/git-operations-service.js +237 -0
- package/dist/cli/git/services/git-operations-service.js.map +1 -0
- package/dist/cli/integration/context-builder.d.ts +8 -0
- package/dist/cli/integration/context-builder.d.ts.map +1 -0
- package/dist/cli/integration/context-builder.js +103 -0
- package/dist/cli/integration/context-builder.js.map +1 -0
- package/dist/cli/integration/knowledge-base-updater.d.ts +12 -0
- package/dist/cli/integration/knowledge-base-updater.d.ts.map +1 -0
- package/dist/cli/integration/knowledge-base-updater.js +156 -0
- package/dist/cli/integration/knowledge-base-updater.js.map +1 -0
- package/dist/cli/integration/result-improver.d.ts +7 -0
- package/dist/cli/integration/result-improver.d.ts.map +1 -0
- package/dist/cli/integration/result-improver.js +26 -0
- package/dist/cli/integration/result-improver.js.map +1 -0
- package/dist/cli/integration/result-integrator.d.ts +7 -0
- package/dist/cli/integration/result-integrator.d.ts.map +1 -0
- package/dist/cli/integration/result-integrator.js +31 -0
- package/dist/cli/integration/result-integrator.js.map +1 -0
- package/dist/cli/integration/task-decomposer.d.ts +10 -0
- package/dist/cli/integration/task-decomposer.d.ts.map +1 -0
- package/dist/cli/integration/task-decomposer.js +32 -0
- package/dist/cli/integration/task-decomposer.js.map +1 -0
- package/dist/cli/integration/task-executor.d.ts +12 -0
- package/dist/cli/integration/task-executor.d.ts.map +1 -0
- package/dist/cli/integration/task-executor.js +76 -0
- package/dist/cli/integration/task-executor.js.map +1 -0
- package/dist/cli/knowledge/analyzers/interfaces.d.ts +55 -0
- package/dist/cli/knowledge/analyzers/interfaces.d.ts.map +1 -0
- package/dist/cli/knowledge/analyzers/interfaces.js +8 -0
- package/dist/cli/knowledge/analyzers/interfaces.js.map +1 -0
- package/dist/cli/knowledge/analyzers/semantic-analyzer.d.ts +27 -0
- package/dist/cli/knowledge/analyzers/semantic-analyzer.d.ts.map +1 -0
- package/dist/cli/knowledge/analyzers/semantic-analyzer.js +227 -0
- package/dist/cli/knowledge/analyzers/semantic-analyzer.js.map +1 -0
- package/dist/cli/knowledge/analyzers/services/ast-analysis-service.d.ts +23 -0
- package/dist/cli/knowledge/analyzers/services/ast-analysis-service.d.ts.map +1 -0
- package/dist/cli/knowledge/analyzers/services/ast-analysis-service.js +137 -0
- package/dist/cli/knowledge/analyzers/services/ast-analysis-service.js.map +1 -0
- package/dist/cli/knowledge/analyzers/services/file-discovery-service.d.ts +15 -0
- package/dist/cli/knowledge/analyzers/services/file-discovery-service.d.ts.map +1 -0
- package/dist/cli/knowledge/analyzers/services/file-discovery-service.js +110 -0
- package/dist/cli/knowledge/analyzers/services/file-discovery-service.js.map +1 -0
- package/dist/cli/knowledge/analyzers/services/pattern-detection-service.d.ts +21 -0
- package/dist/cli/knowledge/analyzers/services/pattern-detection-service.d.ts.map +1 -0
- package/dist/cli/knowledge/analyzers/services/pattern-detection-service.js +190 -0
- package/dist/cli/knowledge/analyzers/services/pattern-detection-service.js.map +1 -0
- package/dist/cli/knowledge/graph/knowledge-graph.d.ts +109 -0
- package/dist/cli/knowledge/graph/knowledge-graph.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/knowledge-graph.js +281 -0
- package/dist/cli/knowledge/graph/knowledge-graph.js.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-mutation-manager.d.ts +69 -0
- package/dist/cli/knowledge/graph/managers/graph-mutation-manager.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-mutation-manager.js +445 -0
- package/dist/cli/knowledge/graph/managers/graph-mutation-manager.js.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-query-manager.d.ts +86 -0
- package/dist/cli/knowledge/graph/managers/graph-query-manager.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-query-manager.js +306 -0
- package/dist/cli/knowledge/graph/managers/graph-query-manager.js.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-state-manager.d.ts +70 -0
- package/dist/cli/knowledge/graph/managers/graph-state-manager.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-state-manager.js +249 -0
- package/dist/cli/knowledge/graph/managers/graph-state-manager.js.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-traversal-manager.d.ts +72 -0
- package/dist/cli/knowledge/graph/managers/graph-traversal-manager.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/managers/graph-traversal-manager.js +414 -0
- package/dist/cli/knowledge/graph/managers/graph-traversal-manager.js.map +1 -0
- package/dist/cli/knowledge/graph/services/architectural-insight-detector.d.ts +43 -0
- package/dist/cli/knowledge/graph/services/architectural-insight-detector.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/services/architectural-insight-detector.js +536 -0
- package/dist/cli/knowledge/graph/services/architectural-insight-detector.js.map +1 -0
- package/dist/cli/knowledge/graph/services/graph-analyzer.d.ts +24 -0
- package/dist/cli/knowledge/graph/services/graph-analyzer.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/services/graph-analyzer.js +262 -0
- package/dist/cli/knowledge/graph/services/graph-analyzer.js.map +1 -0
- package/dist/cli/knowledge/graph/services/graph-database-service.d.ts +61 -0
- package/dist/cli/knowledge/graph/services/graph-database-service.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/services/graph-database-service.js +593 -0
- package/dist/cli/knowledge/graph/services/graph-database-service.js.map +1 -0
- package/dist/cli/knowledge/graph/services/graph-utility-service.d.ts +41 -0
- package/dist/cli/knowledge/graph/services/graph-utility-service.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/services/graph-utility-service.js +208 -0
- package/dist/cli/knowledge/graph/services/graph-utility-service.js.map +1 -0
- package/dist/cli/knowledge/graph/types.d.ts +272 -0
- package/dist/cli/knowledge/graph/types.d.ts.map +1 -0
- package/dist/cli/knowledge/graph/types.js +127 -0
- package/dist/cli/knowledge/graph/types.js.map +1 -0
- package/dist/cli/knowledge/repository/knowledge-repository.d.ts +121 -0
- package/dist/cli/knowledge/repository/knowledge-repository.d.ts.map +1 -0
- package/dist/cli/knowledge/repository/knowledge-repository.js +642 -0
- package/dist/cli/knowledge/repository/knowledge-repository.js.map +1 -0
- package/dist/cli/managers/claude-code-forwarder.d.ts +68 -0
- package/dist/cli/managers/claude-code-forwarder.d.ts.map +1 -0
- package/dist/cli/managers/claude-code-forwarder.js +214 -0
- package/dist/cli/managers/claude-code-forwarder.js.map +1 -0
- package/dist/cli/managers/command-processor.d.ts +75 -0
- package/dist/cli/managers/command-processor.d.ts.map +1 -0
- package/dist/cli/managers/command-processor.js +117 -0
- package/dist/cli/managers/command-processor.js.map +1 -0
- package/dist/cli/managers/database-manager.d.ts +147 -0
- package/dist/cli/managers/database-manager.d.ts.map +1 -0
- package/dist/cli/managers/database-manager.js +218 -0
- package/dist/cli/managers/database-manager.js.map +1 -0
- package/dist/cli/managers/interrupt-manager.d.ts +75 -0
- package/dist/cli/managers/interrupt-manager.d.ts.map +1 -0
- package/dist/cli/managers/interrupt-manager.js +197 -0
- package/dist/cli/managers/interrupt-manager.js.map +1 -0
- package/dist/cli/managers/project-manager.d.ts +82 -0
- package/dist/cli/managers/project-manager.d.ts.map +1 -0
- package/dist/cli/managers/project-manager.js +257 -0
- package/dist/cli/managers/project-manager.js.map +1 -0
- package/dist/cli/managers/user-interface.d.ts +74 -0
- package/dist/cli/managers/user-interface.d.ts.map +1 -0
- package/dist/cli/managers/user-interface.js +529 -0
- package/dist/cli/managers/user-interface.js.map +1 -0
- package/dist/cli/managers/workflow-orchestration-adapter.d.ts +24 -0
- package/dist/cli/managers/workflow-orchestration-adapter.d.ts.map +1 -0
- package/dist/cli/managers/workflow-orchestration-adapter.js +136 -0
- package/dist/cli/managers/workflow-orchestration-adapter.js.map +1 -0
- package/dist/cli/orchestration/cli-orchestrator.d.ts +92 -0
- package/dist/cli/orchestration/cli-orchestrator.d.ts.map +1 -0
- package/dist/cli/orchestration/cli-orchestrator.js +195 -0
- package/dist/cli/orchestration/cli-orchestrator.js.map +1 -0
- package/dist/cli/quality/compilation-checker.d.ts +13 -0
- package/dist/cli/quality/compilation-checker.d.ts.map +1 -0
- package/dist/cli/quality/compilation-checker.js +78 -0
- package/dist/cli/quality/compilation-checker.js.map +1 -0
- package/dist/cli/quality/interfaces/index.d.ts +104 -0
- package/dist/cli/quality/interfaces/index.d.ts.map +1 -0
- package/dist/cli/quality/interfaces/index.js +7 -0
- package/dist/cli/quality/interfaces/index.js.map +1 -0
- package/dist/cli/quality/interfaces.d.ts +79 -0
- package/dist/cli/quality/interfaces.d.ts.map +1 -0
- package/dist/cli/quality/interfaces.js +7 -0
- package/dist/cli/quality/interfaces.js.map +1 -0
- package/dist/cli/quality/quality-orchestrator.d.ts +19 -0
- package/dist/cli/quality/quality-orchestrator.d.ts.map +1 -0
- package/dist/cli/quality/quality-orchestrator.js +109 -0
- package/dist/cli/quality/quality-orchestrator.js.map +1 -0
- package/dist/cli/quality/services/architecture-service.d.ts +17 -0
- package/dist/cli/quality/services/architecture-service.d.ts.map +1 -0
- package/dist/cli/quality/services/architecture-service.js +267 -0
- package/dist/cli/quality/services/architecture-service.js.map +1 -0
- package/dist/cli/quality/services/compilation-service.d.ts +16 -0
- package/dist/cli/quality/services/compilation-service.d.ts.map +1 -0
- package/dist/cli/quality/services/compilation-service.js +177 -0
- package/dist/cli/quality/services/compilation-service.js.map +1 -0
- package/dist/cli/quality/services/quality-score-calculator.d.ts +12 -0
- package/dist/cli/quality/services/quality-score-calculator.d.ts.map +1 -0
- package/dist/cli/quality/services/quality-score-calculator.js +120 -0
- package/dist/cli/quality/services/quality-score-calculator.js.map +1 -0
- package/dist/cli/quality/services/security-service.d.ts +15 -0
- package/dist/cli/quality/services/security-service.d.ts.map +1 -0
- package/dist/cli/quality/services/security-service.js +214 -0
- package/dist/cli/quality/services/security-service.js.map +1 -0
- package/dist/cli/quality/services/testing-service.d.ts +19 -0
- package/dist/cli/quality/services/testing-service.d.ts.map +1 -0
- package/dist/cli/quality/services/testing-service.js +251 -0
- package/dist/cli/quality/services/testing-service.js.map +1 -0
- package/dist/cli/quality/test-runner.d.ts +15 -0
- package/dist/cli/quality/test-runner.d.ts.map +1 -0
- package/dist/cli/quality/test-runner.js +148 -0
- package/dist/cli/quality/test-runner.js.map +1 -0
- package/dist/cli/quality-checker.d.ts +41 -0
- package/dist/cli/quality-checker.d.ts.map +1 -0
- package/dist/cli/quality-checker.js +216 -0
- package/dist/cli/quality-checker.js.map +1 -0
- package/dist/cli/scripts/start-tool-api.d.ts +7 -0
- package/dist/cli/scripts/start-tool-api.d.ts.map +1 -0
- package/dist/cli/scripts/start-tool-api.js +44 -0
- package/dist/cli/scripts/start-tool-api.js.map +1 -0
- package/dist/cli/services/analysis/coding-patterns-analyzer.d.ts +78 -0
- package/dist/cli/services/analysis/coding-patterns-analyzer.d.ts.map +1 -0
- package/dist/cli/services/analysis/coding-patterns-analyzer.js +588 -0
- package/dist/cli/services/analysis/coding-patterns-analyzer.js.map +1 -0
- package/dist/cli/services/analysis/coding-standards-generator.d.ts +66 -0
- package/dist/cli/services/analysis/coding-standards-generator.d.ts.map +1 -0
- package/dist/cli/services/analysis/coding-standards-generator.js +223 -0
- package/dist/cli/services/analysis/coding-standards-generator.js.map +1 -0
- package/dist/cli/services/analysis/deduplication/code-consolidation-handler.d.ts +70 -0
- package/dist/cli/services/analysis/deduplication/code-consolidation-handler.d.ts.map +1 -0
- package/dist/cli/services/analysis/deduplication/code-consolidation-handler.js +326 -0
- package/dist/cli/services/analysis/deduplication/code-consolidation-handler.js.map +1 -0
- package/dist/cli/services/analysis/deduplication/dedup-detector.d.ts +77 -0
- package/dist/cli/services/analysis/deduplication/dedup-detector.d.ts.map +1 -0
- package/dist/cli/services/analysis/deduplication/dedup-detector.js +302 -0
- package/dist/cli/services/analysis/deduplication/dedup-detector.js.map +1 -0
- package/dist/cli/services/analysis/deduplication/deduplication-service.d.ts +107 -0
- package/dist/cli/services/analysis/deduplication/deduplication-service.d.ts.map +1 -0
- package/dist/cli/services/analysis/deduplication/deduplication-service.js +380 -0
- package/dist/cli/services/analysis/deduplication/deduplication-service.js.map +1 -0
- package/dist/cli/services/analysis/deduplication/duplicate-code-detector.d.ts +100 -0
- package/dist/cli/services/analysis/deduplication/duplicate-code-detector.d.ts.map +1 -0
- package/dist/cli/services/analysis/deduplication/duplicate-code-detector.js +406 -0
- package/dist/cli/services/analysis/deduplication/duplicate-code-detector.js.map +1 -0
- package/dist/cli/services/analysis/deduplication/hash-change-detector.d.ts +57 -0
- package/dist/cli/services/analysis/deduplication/hash-change-detector.d.ts.map +1 -0
- package/dist/cli/services/analysis/deduplication/hash-change-detector.js +185 -0
- package/dist/cli/services/analysis/deduplication/hash-change-detector.js.map +1 -0
- package/dist/cli/services/analysis/solid/solid-analyzer-service.d.ts +87 -0
- package/dist/cli/services/analysis/solid/solid-analyzer-service.d.ts.map +1 -0
- package/dist/cli/services/analysis/solid/solid-analyzer-service.js +426 -0
- package/dist/cli/services/analysis/solid/solid-analyzer-service.js.map +1 -0
- package/dist/cli/services/analysis/user-intentions/assumption-detector.d.ts +76 -0
- package/dist/cli/services/analysis/user-intentions/assumption-detector.d.ts.map +1 -0
- package/dist/cli/services/analysis/user-intentions/assumption-detector.js +394 -0
- package/dist/cli/services/analysis/user-intentions/assumption-detector.js.map +1 -0
- package/dist/cli/services/analysis/user-intentions/intent-analyzer.d.ts +41 -0
- package/dist/cli/services/analysis/user-intentions/intent-analyzer.d.ts.map +1 -0
- package/dist/cli/services/analysis/user-intentions/intent-analyzer.js +257 -0
- package/dist/cli/services/analysis/user-intentions/intent-analyzer.js.map +1 -0
- package/dist/cli/services/analysis/user-intentions/intention-clarification-service.d.ts +73 -0
- package/dist/cli/services/analysis/user-intentions/intention-clarification-service.d.ts.map +1 -0
- package/dist/cli/services/analysis/user-intentions/intention-clarification-service.js +246 -0
- package/dist/cli/services/analysis/user-intentions/intention-clarification-service.js.map +1 -0
- package/dist/cli/services/analysis/user-intentions/llm-intention-detector.d.ts +64 -0
- package/dist/cli/services/analysis/user-intentions/llm-intention-detector.d.ts.map +1 -0
- package/dist/cli/services/analysis/user-intentions/llm-intention-detector.js +269 -0
- package/dist/cli/services/analysis/user-intentions/llm-intention-detector.js.map +1 -0
- package/dist/cli/services/analysis/user-intentions/user-clarification-service.d.ts +52 -0
- package/dist/cli/services/analysis/user-intentions/user-clarification-service.d.ts.map +1 -0
- package/dist/cli/services/analysis/user-intentions/user-clarification-service.js +239 -0
- package/dist/cli/services/analysis/user-intentions/user-clarification-service.js.map +1 -0
- package/dist/cli/services/claude/claude-code-executor.d.ts +37 -0
- package/dist/cli/services/claude/claude-code-executor.d.ts.map +1 -0
- package/dist/cli/services/claude/claude-code-executor.js +190 -0
- package/dist/cli/services/claude/claude-code-executor.js.map +1 -0
- package/dist/cli/services/data/code-parsing/file-parser.d.ts +27 -0
- package/dist/cli/services/data/code-parsing/file-parser.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/file-parser.js +336 -0
- package/dist/cli/services/data/code-parsing/file-parser.js.map +1 -0
- package/dist/cli/services/data/code-parsing/interfaces/index.d.ts +102 -0
- package/dist/cli/services/data/code-parsing/interfaces/index.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/interfaces/index.js +7 -0
- package/dist/cli/services/data/code-parsing/interfaces/index.js.map +1 -0
- package/dist/cli/services/data/code-parsing/interfaces.d.ts +77 -0
- package/dist/cli/services/data/code-parsing/interfaces.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/interfaces.js +7 -0
- package/dist/cli/services/data/code-parsing/interfaces.js.map +1 -0
- package/dist/cli/services/data/code-parsing/relationship-analyzer.d.ts +13 -0
- package/dist/cli/services/data/code-parsing/relationship-analyzer.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/relationship-analyzer.js +118 -0
- package/dist/cli/services/data/code-parsing/relationship-analyzer.js.map +1 -0
- package/dist/cli/services/data/code-parsing/services/file-parsing-service.d.ts +21 -0
- package/dist/cli/services/data/code-parsing/services/file-parsing-service.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/services/file-parsing-service.js +394 -0
- package/dist/cli/services/data/code-parsing/services/file-parsing-service.js.map +1 -0
- package/dist/cli/services/data/code-parsing/services/graph-population-service.d.ts +21 -0
- package/dist/cli/services/data/code-parsing/services/graph-population-service.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/services/graph-population-service.js +426 -0
- package/dist/cli/services/data/code-parsing/services/graph-population-service.js.map +1 -0
- package/dist/cli/services/data/code-parsing/services/project-structure-service.d.ts +33 -0
- package/dist/cli/services/data/code-parsing/services/project-structure-service.d.ts.map +1 -0
- package/dist/cli/services/data/code-parsing/services/project-structure-service.js +310 -0
- package/dist/cli/services/data/code-parsing/services/project-structure-service.js.map +1 -0
- package/dist/cli/services/data/code-relationship-parser.d.ts +58 -0
- package/dist/cli/services/data/code-relationship-parser.d.ts.map +1 -0
- package/dist/cli/services/data/code-relationship-parser.js +204 -0
- package/dist/cli/services/data/code-relationship-parser.js.map +1 -0
- package/dist/cli/services/data/content-processing/content-processor.d.ts +141 -0
- package/dist/cli/services/data/content-processing/content-processor.d.ts.map +1 -0
- package/dist/cli/services/data/content-processing/content-processor.js +661 -0
- package/dist/cli/services/data/content-processing/content-processor.js.map +1 -0
- package/dist/cli/services/data/database/postgresql-initializer.d.ts +67 -0
- package/dist/cli/services/data/database/postgresql-initializer.d.ts.map +1 -0
- package/dist/cli/services/data/database/postgresql-initializer.js +612 -0
- package/dist/cli/services/data/database/postgresql-initializer.js.map +1 -0
- package/dist/cli/services/data/documentation-service.d.ts +123 -0
- package/dist/cli/services/data/documentation-service.d.ts.map +1 -0
- package/dist/cli/services/data/documentation-service.js +531 -0
- package/dist/cli/services/data/documentation-service.js.map +1 -0
- package/dist/cli/services/data/embedding/embedding-service.d.ts +67 -0
- package/dist/cli/services/data/embedding/embedding-service.d.ts.map +1 -0
- package/dist/cli/services/data/embedding/embedding-service.js +258 -0
- package/dist/cli/services/data/embedding/embedding-service.js.map +1 -0
- package/dist/cli/services/data/embedding/interfaces.d.ts +104 -0
- package/dist/cli/services/data/embedding/interfaces.d.ts.map +1 -0
- package/dist/cli/services/data/embedding/interfaces.js +8 -0
- package/dist/cli/services/data/embedding/interfaces.js.map +1 -0
- package/dist/cli/services/data/embedding/providers/local-provider.d.ts +15 -0
- package/dist/cli/services/data/embedding/providers/local-provider.d.ts.map +1 -0
- package/dist/cli/services/data/embedding/providers/local-provider.js +99 -0
- package/dist/cli/services/data/embedding/providers/local-provider.js.map +1 -0
- package/dist/cli/services/data/embedding/providers/openai-provider.d.ts +16 -0
- package/dist/cli/services/data/embedding/providers/openai-provider.d.ts.map +1 -0
- package/dist/cli/services/data/embedding/providers/openai-provider.js +70 -0
- package/dist/cli/services/data/embedding/providers/openai-provider.js.map +1 -0
- package/dist/cli/services/data/embedding/providers/xenova-provider.d.ts +17 -0
- package/dist/cli/services/data/embedding/providers/xenova-provider.d.ts.map +1 -0
- package/dist/cli/services/data/embedding/providers/xenova-provider.js +95 -0
- package/dist/cli/services/data/embedding/providers/xenova-provider.js.map +1 -0
- package/dist/cli/services/data/embedding/services/file-processor.d.ts +20 -0
- package/dist/cli/services/data/embedding/services/file-processor.d.ts.map +1 -0
- package/dist/cli/services/data/embedding/services/file-processor.js +306 -0
- package/dist/cli/services/data/embedding/services/file-processor.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/builders/node-builder.d.ts +54 -0
- package/dist/cli/services/data/semantic-graph/builders/node-builder.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/builders/node-builder.js +209 -0
- package/dist/cli/services/data/semantic-graph/builders/node-builder.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/builders/relationship-builder.d.ts +61 -0
- package/dist/cli/services/data/semantic-graph/builders/relationship-builder.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/builders/relationship-builder.js +316 -0
- package/dist/cli/services/data/semantic-graph/builders/relationship-builder.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/claude-code-proxy.d.ts +43 -0
- package/dist/cli/services/data/semantic-graph/claude-code-proxy.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/claude-code-proxy.js +296 -0
- package/dist/cli/services/data/semantic-graph/claude-code-proxy.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.d.ts +63 -0
- package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.js +340 -0
- package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/interfaces/index.d.ts +134 -0
- package/dist/cli/services/data/semantic-graph/interfaces/index.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/interfaces/index.js +7 -0
- package/dist/cli/services/data/semantic-graph/interfaces/index.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/language-detector.d.ts +60 -0
- package/dist/cli/services/data/semantic-graph/language-detector.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/language-detector.js +345 -0
- package/dist/cli/services/data/semantic-graph/language-detector.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.d.ts +68 -0
- package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.js +298 -0
- package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.d.ts +19 -0
- package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.js +220 -0
- package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/generic-parser.d.ts +20 -0
- package/dist/cli/services/data/semantic-graph/parsers/generic-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/generic-parser.js +193 -0
- package/dist/cli/services/data/semantic-graph/parsers/generic-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/go-parser.d.ts +20 -0
- package/dist/cli/services/data/semantic-graph/parsers/go-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/go-parser.js +192 -0
- package/dist/cli/services/data/semantic-graph/parsers/go-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.d.ts +71 -0
- package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.js +35 -0
- package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/java-parser.d.ts +18 -0
- package/dist/cli/services/data/semantic-graph/parsers/java-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/java-parser.js +164 -0
- package/dist/cli/services/data/semantic-graph/parsers/java-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/python-parser.d.ts +15 -0
- package/dist/cli/services/data/semantic-graph/parsers/python-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/python-parser.js +172 -0
- package/dist/cli/services/data/semantic-graph/parsers/python-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.d.ts +26 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.js +312 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.d.ts +29 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.js +346 -0
- package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.d.ts +19 -0
- package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.js +258 -0
- package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/processors/index.d.ts +24 -0
- package/dist/cli/services/data/semantic-graph/processors/index.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/processors/index.js +153 -0
- package/dist/cli/services/data/semantic-graph/processors/index.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/semantic-graph.d.ts +75 -0
- package/dist/cli/services/data/semantic-graph/semantic-graph.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/semantic-graph.js +191 -0
- package/dist/cli/services/data/semantic-graph/semantic-graph.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/services/file-processing-service.d.ts +29 -0
- package/dist/cli/services/data/semantic-graph/services/file-processing-service.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/services/file-processing-service.js +175 -0
- package/dist/cli/services/data/semantic-graph/services/file-processing-service.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/services/graph-query-service.d.ts +34 -0
- package/dist/cli/services/data/semantic-graph/services/graph-query-service.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/services/graph-query-service.js +285 -0
- package/dist/cli/services/data/semantic-graph/services/graph-query-service.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/services/graph-storage-service.d.ts +35 -0
- package/dist/cli/services/data/semantic-graph/services/graph-storage-service.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/services/graph-storage-service.js +321 -0
- package/dist/cli/services/data/semantic-graph/services/graph-storage-service.js.map +1 -0
- package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.d.ts +85 -0
- package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.d.ts.map +1 -0
- package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.js +375 -0
- package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.js.map +1 -0
- package/dist/cli/services/integration/codemind-instruction-service.d.ts +76 -0
- package/dist/cli/services/integration/codemind-instruction-service.d.ts.map +1 -0
- package/dist/cli/services/integration/codemind-instruction-service.js +331 -0
- package/dist/cli/services/integration/codemind-instruction-service.js.map +1 -0
- package/dist/cli/services/integration/codeseeker-instruction-service.d.ts +82 -0
- package/dist/cli/services/integration/codeseeker-instruction-service.d.ts.map +1 -0
- package/dist/cli/services/integration/codeseeker-instruction-service.js +372 -0
- package/dist/cli/services/integration/codeseeker-instruction-service.js.map +1 -0
- package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.d.ts +135 -0
- package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.d.ts.map +1 -0
- package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.js +298 -0
- package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.js.map +1 -0
- package/dist/cli/services/llm/claude-llm-executor.d.ts +84 -0
- package/dist/cli/services/llm/claude-llm-executor.d.ts.map +1 -0
- package/dist/cli/services/llm/claude-llm-executor.js +448 -0
- package/dist/cli/services/llm/claude-llm-executor.js.map +1 -0
- package/dist/cli/services/llm/index.d.ts +41 -0
- package/dist/cli/services/llm/index.d.ts.map +1 -0
- package/dist/cli/services/llm/index.js +53 -0
- package/dist/cli/services/llm/index.js.map +1 -0
- package/dist/cli/services/llm/interfaces/index.d.ts +211 -0
- package/dist/cli/services/llm/interfaces/index.d.ts.map +1 -0
- package/dist/cli/services/llm/interfaces/index.js +15 -0
- package/dist/cli/services/llm/interfaces/index.js.map +1 -0
- package/dist/cli/services/llm/llm-executor-registry.d.ts +118 -0
- package/dist/cli/services/llm/llm-executor-registry.d.ts.map +1 -0
- package/dist/cli/services/llm/llm-executor-registry.js +226 -0
- package/dist/cli/services/llm/llm-executor-registry.js.map +1 -0
- package/dist/cli/services/llm/mock-llm-executor.d.ts +118 -0
- package/dist/cli/services/llm/mock-llm-executor.d.ts.map +1 -0
- package/dist/cli/services/llm/mock-llm-executor.js +324 -0
- package/dist/cli/services/llm/mock-llm-executor.js.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.d.ts +49 -0
- package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.js +172 -0
- package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.js.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/directory-scanner.d.ts +12 -0
- package/dist/cli/services/monitoring/file-scanning/directory-scanner.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/directory-scanner.js +126 -0
- package/dist/cli/services/monitoring/file-scanning/directory-scanner.js.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.d.ts +33 -0
- package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.js +7 -0
- package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.js.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/file-type-detector.d.ts +17 -0
- package/dist/cli/services/monitoring/file-scanning/file-type-detector.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/file-type-detector.js +109 -0
- package/dist/cli/services/monitoring/file-scanning/file-type-detector.js.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/index.d.ts +10 -0
- package/dist/cli/services/monitoring/file-scanning/index.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/index.js +34 -0
- package/dist/cli/services/monitoring/file-scanning/index.js.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/project-file-scanner.d.ts +31 -0
- package/dist/cli/services/monitoring/file-scanning/project-file-scanner.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-scanning/project-file-scanner.js +52 -0
- package/dist/cli/services/monitoring/file-scanning/project-file-scanner.js.map +1 -0
- package/dist/cli/services/monitoring/file-watcher-service.d.ts +82 -0
- package/dist/cli/services/monitoring/file-watcher-service.d.ts.map +1 -0
- package/dist/cli/services/monitoring/file-watcher-service.js +314 -0
- package/dist/cli/services/monitoring/file-watcher-service.js.map +1 -0
- package/dist/cli/services/monitoring/initialization/initialization-status-tracker.d.ts +72 -0
- package/dist/cli/services/monitoring/initialization/initialization-status-tracker.d.ts.map +1 -0
- package/dist/cli/services/monitoring/initialization/initialization-status-tracker.js +242 -0
- package/dist/cli/services/monitoring/initialization/initialization-status-tracker.js.map +1 -0
- package/dist/cli/services/platform-detector.d.ts +41 -0
- package/dist/cli/services/platform-detector.d.ts.map +1 -0
- package/dist/cli/services/platform-detector.js +302 -0
- package/dist/cli/services/platform-detector.js.map +1 -0
- package/dist/cli/services/project/language-manager.d.ts +16 -0
- package/dist/cli/services/project/language-manager.d.ts.map +1 -0
- package/dist/cli/services/project/language-manager.js +149 -0
- package/dist/cli/services/project/language-manager.js.map +1 -0
- package/dist/cli/services/project/language-support-service.d.ts +63 -0
- package/dist/cli/services/project/language-support-service.d.ts.map +1 -0
- package/dist/cli/services/project/language-support-service.js +357 -0
- package/dist/cli/services/project/language-support-service.js.map +1 -0
- package/dist/cli/services/project/project-detector.d.ts +10 -0
- package/dist/cli/services/project/project-detector.d.ts.map +1 -0
- package/dist/cli/services/project/project-detector.js +92 -0
- package/dist/cli/services/project/project-detector.js.map +1 -0
- package/dist/cli/services/project/project-registry.d.ts +16 -0
- package/dist/cli/services/project/project-registry.d.ts.map +1 -0
- package/dist/cli/services/project/project-registry.js +103 -0
- package/dist/cli/services/project/project-registry.js.map +1 -0
- package/dist/cli/services/project-identity-service.d.ts +87 -0
- package/dist/cli/services/project-identity-service.d.ts.map +1 -0
- package/dist/cli/services/project-identity-service.js +332 -0
- package/dist/cli/services/project-identity-service.js.map +1 -0
- package/dist/cli/services/search/content-chunker.d.ts +23 -0
- package/dist/cli/services/search/content-chunker.d.ts.map +1 -0
- package/dist/cli/services/search/content-chunker.js +265 -0
- package/dist/cli/services/search/content-chunker.js.map +1 -0
- package/dist/cli/services/search/embedding-generator-adapter.d.ts +17 -0
- package/dist/cli/services/search/embedding-generator-adapter.d.ts.map +1 -0
- package/dist/cli/services/search/embedding-generator-adapter.js +61 -0
- package/dist/cli/services/search/embedding-generator-adapter.js.map +1 -0
- package/dist/cli/services/search/search-index-storage.d.ts +22 -0
- package/dist/cli/services/search/search-index-storage.d.ts.map +1 -0
- package/dist/cli/services/search/search-index-storage.js +154 -0
- package/dist/cli/services/search/search-index-storage.js.map +1 -0
- package/dist/cli/services/search/search-query-processor.d.ts +16 -0
- package/dist/cli/services/search/search-query-processor.d.ts.map +1 -0
- package/dist/cli/services/search/search-query-processor.js +125 -0
- package/dist/cli/services/search/search-query-processor.js.map +1 -0
- package/dist/cli/services/search/semantic-search.d.ts +86 -0
- package/dist/cli/services/search/semantic-search.d.ts.map +1 -0
- package/dist/cli/services/search/semantic-search.js +300 -0
- package/dist/cli/services/search/semantic-search.js.map +1 -0
- package/dist/cli/services/setup/container-detector.d.ts +15 -0
- package/dist/cli/services/setup/container-detector.d.ts.map +1 -0
- package/dist/cli/services/setup/container-detector.js +175 -0
- package/dist/cli/services/setup/container-detector.js.map +1 -0
- package/dist/cli/services/setup/container-manager.d.ts +14 -0
- package/dist/cli/services/setup/container-manager.d.ts.map +1 -0
- package/dist/cli/services/setup/container-manager.js +147 -0
- package/dist/cli/services/setup/container-manager.js.map +1 -0
- package/dist/cli/services/setup/database-initializer.d.ts +24 -0
- package/dist/cli/services/setup/database-initializer.d.ts.map +1 -0
- package/dist/cli/services/setup/database-initializer.js +291 -0
- package/dist/cli/services/setup/database-initializer.js.map +1 -0
- package/dist/cli/services/setup/interfaces/setup-interfaces.d.ts +72 -0
- package/dist/cli/services/setup/interfaces/setup-interfaces.d.ts.map +1 -0
- package/dist/cli/services/setup/interfaces/setup-interfaces.js +7 -0
- package/dist/cli/services/setup/interfaces/setup-interfaces.js.map +1 -0
- package/dist/cli/services/setup/prerequisite-checker.d.ts +10 -0
- package/dist/cli/services/setup/prerequisite-checker.d.ts.map +1 -0
- package/dist/cli/services/setup/prerequisite-checker.js +119 -0
- package/dist/cli/services/setup/prerequisite-checker.js.map +1 -0
- package/dist/cli/services/setup/setup-orchestrator.d.ts +27 -0
- package/dist/cli/services/setup/setup-orchestrator.d.ts.map +1 -0
- package/dist/cli/services/setup/setup-orchestrator.js +230 -0
- package/dist/cli/services/setup/setup-orchestrator.js.map +1 -0
- package/dist/cli/services/setup/setup-reporter.d.ts +14 -0
- package/dist/cli/services/setup/setup-reporter.d.ts.map +1 -0
- package/dist/cli/services/setup/setup-reporter.js +143 -0
- package/dist/cli/services/setup/setup-reporter.js.map +1 -0
- package/dist/cli/services/setup/setup-service-factory.d.ts +19 -0
- package/dist/cli/services/setup/setup-service-factory.d.ts.map +1 -0
- package/dist/cli/services/setup/setup-service-factory.js +43 -0
- package/dist/cli/services/setup/setup-service-factory.js.map +1 -0
- package/dist/cli/services/setup/unified-database-initializer.d.ts +61 -0
- package/dist/cli/services/setup/unified-database-initializer.d.ts.map +1 -0
- package/dist/cli/services/setup/unified-database-initializer.js +264 -0
- package/dist/cli/services/setup/unified-database-initializer.js.map +1 -0
- package/dist/cli/task-splitter.d.ts +59 -0
- package/dist/cli/task-splitter.d.ts.map +1 -0
- package/dist/cli/task-splitter.js +556 -0
- package/dist/cli/task-splitter.js.map +1 -0
- package/dist/cli/tools/context-optimizer-tool.d.ts +25 -0
- package/dist/cli/tools/context-optimizer-tool.d.ts.map +1 -0
- package/dist/cli/tools/context-optimizer-tool.js +169 -0
- package/dist/cli/tools/context-optimizer-tool.js.map +1 -0
- package/dist/cli/ui/theme.d.ts +148 -0
- package/dist/cli/ui/theme.d.ts.map +1 -0
- package/dist/cli/ui/theme.js +302 -0
- package/dist/cli/ui/theme.js.map +1 -0
- package/dist/cli/ui/welcome-display.d.ts +20 -0
- package/dist/cli/ui/welcome-display.d.ts.map +1 -0
- package/dist/cli/ui/welcome-display.js +50 -0
- package/dist/cli/ui/welcome-display.js.map +1 -0
- package/dist/cli/workflow/interfaces/index.d.ts +191 -0
- package/dist/cli/workflow/interfaces/index.d.ts.map +1 -0
- package/dist/cli/workflow/interfaces/index.js +7 -0
- package/dist/cli/workflow/interfaces/index.js.map +1 -0
- package/dist/cli/workflow/services/context-gathering-service.d.ts +23 -0
- package/dist/cli/workflow/services/context-gathering-service.d.ts.map +1 -0
- package/dist/cli/workflow/services/context-gathering-service.js +145 -0
- package/dist/cli/workflow/services/context-gathering-service.js.map +1 -0
- package/dist/cli/workflow/services/database-sync-service.d.ts +63 -0
- package/dist/cli/workflow/services/database-sync-service.d.ts.map +1 -0
- package/dist/cli/workflow/services/database-sync-service.js +250 -0
- package/dist/cli/workflow/services/database-sync-service.js.map +1 -0
- package/dist/cli/workflow/services/git-workflow-service.d.ts +29 -0
- package/dist/cli/workflow/services/git-workflow-service.d.ts.map +1 -0
- package/dist/cli/workflow/services/git-workflow-service.js +226 -0
- package/dist/cli/workflow/services/git-workflow-service.js.map +1 -0
- package/dist/cli/workflow/services/intent-analysis-service.d.ts +20 -0
- package/dist/cli/workflow/services/intent-analysis-service.d.ts.map +1 -0
- package/dist/cli/workflow/services/intent-analysis-service.js +137 -0
- package/dist/cli/workflow/services/intent-analysis-service.js.map +1 -0
- package/dist/cli/workflow/services/quality-assurance-service.d.ts +41 -0
- package/dist/cli/workflow/services/quality-assurance-service.d.ts.map +1 -0
- package/dist/cli/workflow/services/quality-assurance-service.js +341 -0
- package/dist/cli/workflow/services/quality-assurance-service.js.map +1 -0
- package/dist/cli/workflow/services/task-orchestration-service.d.ts +31 -0
- package/dist/cli/workflow/services/task-orchestration-service.d.ts.map +1 -0
- package/dist/cli/workflow/services/task-orchestration-service.js +254 -0
- package/dist/cli/workflow/services/task-orchestration-service.js.map +1 -0
- package/dist/cli/workflow/workflow-orchestrator.d.ts +47 -0
- package/dist/cli/workflow/workflow-orchestrator.d.ts.map +1 -0
- package/dist/cli/workflow/workflow-orchestrator.js +248 -0
- package/dist/cli/workflow/workflow-orchestrator.js.map +1 -0
- package/dist/config/database-config.d.ts +40 -0
- package/dist/config/database-config.d.ts.map +1 -0
- package/dist/config/database-config.js +192 -0
- package/dist/config/database-config.js.map +1 -0
- package/dist/core/factories/command-service-factory.d.ts +26 -0
- package/dist/core/factories/command-service-factory.d.ts.map +1 -0
- package/dist/core/factories/command-service-factory.js +72 -0
- package/dist/core/factories/command-service-factory.js.map +1 -0
- package/dist/core/factories/error-factory.d.ts +19 -0
- package/dist/core/factories/error-factory.d.ts.map +1 -0
- package/dist/core/factories/error-factory.js +100 -0
- package/dist/core/factories/error-factory.js.map +1 -0
- package/dist/core/factories/error-handling-factory.d.ts +33 -0
- package/dist/core/factories/error-handling-factory.d.ts.map +1 -0
- package/dist/core/factories/error-handling-factory.js +59 -0
- package/dist/core/factories/error-handling-factory.js.map +1 -0
- package/dist/core/factories/project-service-factory.d.ts +38 -0
- package/dist/core/factories/project-service-factory.d.ts.map +1 -0
- package/dist/core/factories/project-service-factory.js +66 -0
- package/dist/core/factories/project-service-factory.js.map +1 -0
- package/dist/core/factories/search-service-factory.d.ts +42 -0
- package/dist/core/factories/search-service-factory.d.ts.map +1 -0
- package/dist/core/factories/search-service-factory.js +76 -0
- package/dist/core/factories/search-service-factory.js.map +1 -0
- package/dist/core/interfaces/command-interfaces.d.ts +82 -0
- package/dist/core/interfaces/command-interfaces.d.ts.map +1 -0
- package/dist/core/interfaces/command-interfaces.js +7 -0
- package/dist/core/interfaces/command-interfaces.js.map +1 -0
- package/dist/core/interfaces/error-interfaces.d.ts +95 -0
- package/dist/core/interfaces/error-interfaces.d.ts.map +1 -0
- package/dist/core/interfaces/error-interfaces.js +8 -0
- package/dist/core/interfaces/error-interfaces.js.map +1 -0
- package/dist/core/interfaces/orchestrator-interfaces.d.ts +62 -0
- package/dist/core/interfaces/orchestrator-interfaces.d.ts.map +1 -0
- package/dist/core/interfaces/orchestrator-interfaces.js +8 -0
- package/dist/core/interfaces/orchestrator-interfaces.js.map +1 -0
- package/dist/core/interfaces/project-interfaces.d.ts +57 -0
- package/dist/core/interfaces/project-interfaces.d.ts.map +1 -0
- package/dist/core/interfaces/project-interfaces.js +7 -0
- package/dist/core/interfaces/project-interfaces.js.map +1 -0
- package/dist/core/interfaces/search-interfaces.d.ts +76 -0
- package/dist/core/interfaces/search-interfaces.d.ts.map +1 -0
- package/dist/core/interfaces/search-interfaces.js +6 -0
- package/dist/core/interfaces/search-interfaces.js.map +1 -0
- package/dist/core/interfaces.d.ts +109 -0
- package/dist/core/interfaces.d.ts.map +1 -0
- package/dist/core/interfaces.js +6 -0
- package/dist/core/interfaces.js.map +1 -0
- package/dist/core/services/error-handler.d.ts +33 -0
- package/dist/core/services/error-handler.d.ts.map +1 -0
- package/dist/core/services/error-handler.js +187 -0
- package/dist/core/services/error-handler.js.map +1 -0
- package/dist/core/types.d.ts +197 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +89 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils/error-utils.d.ts +36 -0
- package/dist/core/utils/error-utils.d.ts.map +1 -0
- package/dist/core/utils/error-utils.js +173 -0
- package/dist/core/utils/error-utils.js.map +1 -0
- package/dist/database/adapters/base.d.ts +88 -0
- package/dist/database/adapters/base.d.ts.map +1 -0
- package/dist/database/adapters/base.js +27 -0
- package/dist/database/adapters/base.js.map +1 -0
- package/dist/database/adapters/interfaces.d.ts +64 -0
- package/dist/database/adapters/interfaces.d.ts.map +1 -0
- package/dist/database/adapters/interfaces.js +7 -0
- package/dist/database/adapters/interfaces.js.map +1 -0
- package/dist/database/adapters/postgresql.d.ts +54 -0
- package/dist/database/adapters/postgresql.d.ts.map +1 -0
- package/dist/database/adapters/postgresql.js +838 -0
- package/dist/database/adapters/postgresql.js.map +1 -0
- package/dist/database/adapters/services/connection-manager.d.ts +22 -0
- package/dist/database/adapters/services/connection-manager.d.ts.map +1 -0
- package/dist/database/adapters/services/connection-manager.js +107 -0
- package/dist/database/adapters/services/connection-manager.js.map +1 -0
- package/dist/database/adapters/services/project-service.d.ts +22 -0
- package/dist/database/adapters/services/project-service.d.ts.map +1 -0
- package/dist/database/adapters/services/project-service.js +193 -0
- package/dist/database/adapters/services/project-service.js.map +1 -0
- package/dist/database/database.d.ts +71 -0
- package/dist/database/database.d.ts.map +1 -0
- package/dist/database/database.js +312 -0
- package/dist/database/database.js.map +1 -0
- package/dist/database/factory.d.ts +10 -0
- package/dist/database/factory.d.ts.map +1 -0
- package/dist/database/factory.js +38 -0
- package/dist/database/factory.js.map +1 -0
- package/dist/database/migrations/002_phase2_features.d.ts +24 -0
- package/dist/database/migrations/002_phase2_features.d.ts.map +1 -0
- package/dist/database/migrations/002_phase2_features.js +224 -0
- package/dist/database/migrations/002_phase2_features.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/claude/claude-cli-integration.d.ts +85 -0
- package/dist/integrations/claude/claude-cli-integration.d.ts.map +1 -0
- package/dist/integrations/claude/claude-cli-integration.js +278 -0
- package/dist/integrations/claude/claude-cli-integration.js.map +1 -0
- package/dist/integrations/claude/conversation-manager.d.ts +81 -0
- package/dist/integrations/claude/conversation-manager.d.ts.map +1 -0
- package/dist/integrations/claude/conversation-manager.js +378 -0
- package/dist/integrations/claude/conversation-manager.js.map +1 -0
- package/dist/integrations/claude/interceptor.d.ts +75 -0
- package/dist/integrations/claude/interceptor.d.ts.map +1 -0
- package/dist/integrations/claude/interceptor.js +173 -0
- package/dist/integrations/claude/interceptor.js.map +1 -0
- package/dist/integrations/claude/interfaces/index.d.ts +128 -0
- package/dist/integrations/claude/interfaces/index.d.ts.map +1 -0
- package/dist/integrations/claude/interfaces/index.js +7 -0
- package/dist/integrations/claude/interfaces/index.js.map +1 -0
- package/dist/integrations/claude/outcome-analyzer.d.ts +90 -0
- package/dist/integrations/claude/outcome-analyzer.d.ts.map +1 -0
- package/dist/integrations/claude/outcome-analyzer.js +394 -0
- package/dist/integrations/claude/outcome-analyzer.js.map +1 -0
- package/dist/integrations/claude/services/claude-execution-service.d.ts +26 -0
- package/dist/integrations/claude/services/claude-execution-service.d.ts.map +1 -0
- package/dist/integrations/claude/services/claude-execution-service.js +136 -0
- package/dist/integrations/claude/services/claude-execution-service.js.map +1 -0
- package/dist/integrations/claude/services/claude-response-parser.d.ts +30 -0
- package/dist/integrations/claude/services/claude-response-parser.d.ts.map +1 -0
- package/dist/integrations/claude/services/claude-response-parser.js +235 -0
- package/dist/integrations/claude/services/claude-response-parser.js.map +1 -0
- package/dist/integrations/claude/services/project-analysis-service.d.ts +22 -0
- package/dist/integrations/claude/services/project-analysis-service.d.ts.map +1 -0
- package/dist/integrations/claude/services/project-analysis-service.js +298 -0
- package/dist/integrations/claude/services/project-analysis-service.js.map +1 -0
- package/dist/integrations/claude/services/project-context-builder.d.ts +34 -0
- package/dist/integrations/claude/services/project-context-builder.d.ts.map +1 -0
- package/dist/integrations/claude/services/project-context-builder.js +304 -0
- package/dist/integrations/claude/services/project-context-builder.js.map +1 -0
- package/dist/integrations/claude/services/prompt-processing-service.d.ts +24 -0
- package/dist/integrations/claude/services/prompt-processing-service.d.ts.map +1 -0
- package/dist/integrations/claude/services/prompt-processing-service.js +266 -0
- package/dist/integrations/claude/services/prompt-processing-service.js.map +1 -0
- package/dist/integrations/claude/services/request-processing-service.d.ts +34 -0
- package/dist/integrations/claude/services/request-processing-service.d.ts.map +1 -0
- package/dist/integrations/claude/services/request-processing-service.js +254 -0
- package/dist/integrations/claude/services/request-processing-service.js.map +1 -0
- package/dist/integrations/claude/services/session-management-service.d.ts +49 -0
- package/dist/integrations/claude/services/session-management-service.d.ts.map +1 -0
- package/dist/integrations/claude/services/session-management-service.js +214 -0
- package/dist/integrations/claude/services/session-management-service.js.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +13 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/indexing-service.d.ts +137 -0
- package/dist/mcp/indexing-service.d.ts.map +1 -0
- package/dist/mcp/indexing-service.js +961 -0
- package/dist/mcp/indexing-service.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts +100 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -0
- package/dist/mcp/mcp-server.js +1827 -0
- package/dist/mcp/mcp-server.js.map +1 -0
- package/dist/orchestrator/claude-tool-orchestrator.d.ts +128 -0
- package/dist/orchestrator/claude-tool-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/claude-tool-orchestrator.js +490 -0
- package/dist/orchestrator/claude-tool-orchestrator.js.map +1 -0
- package/dist/orchestrator/intelligent-task-orchestrator.d.ts +131 -0
- package/dist/orchestrator/intelligent-task-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/intelligent-task-orchestrator.js +493 -0
- package/dist/orchestrator/intelligent-task-orchestrator.js.map +1 -0
- package/dist/orchestrator/interfaces.d.ts +59 -0
- package/dist/orchestrator/interfaces.d.ts.map +1 -0
- package/dist/orchestrator/interfaces.js +7 -0
- package/dist/orchestrator/interfaces.js.map +1 -0
- package/dist/orchestrator/messaging/redis-messaging.d.ts +84 -0
- package/dist/orchestrator/messaging/redis-messaging.d.ts.map +1 -0
- package/dist/orchestrator/messaging/redis-messaging.js +384 -0
- package/dist/orchestrator/messaging/redis-messaging.js.map +1 -0
- package/dist/orchestrator/messaging/redis-queue.d.ts +89 -0
- package/dist/orchestrator/messaging/redis-queue.d.ts.map +1 -0
- package/dist/orchestrator/messaging/redis-queue.js +243 -0
- package/dist/orchestrator/messaging/redis-queue.js.map +1 -0
- package/dist/orchestrator/semantic-orchestrator.d.ts +43 -0
- package/dist/orchestrator/semantic-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/semantic-orchestrator.js +285 -0
- package/dist/orchestrator/semantic-orchestrator.js.map +1 -0
- package/dist/orchestrator/sequential-workflow-orchestrator.d.ts +128 -0
- package/dist/orchestrator/sequential-workflow-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/sequential-workflow-orchestrator.js +406 -0
- package/dist/orchestrator/sequential-workflow-orchestrator.js.map +1 -0
- package/dist/orchestrator/services/code-duplications-service.d.ts +14 -0
- package/dist/orchestrator/services/code-duplications-service.d.ts.map +1 -0
- package/dist/orchestrator/services/code-duplications-service.js +116 -0
- package/dist/orchestrator/services/code-duplications-service.js.map +1 -0
- package/dist/orchestrator/services/database-connection-service.d.ts +14 -0
- package/dist/orchestrator/services/database-connection-service.d.ts.map +1 -0
- package/dist/orchestrator/services/database-connection-service.js +46 -0
- package/dist/orchestrator/services/database-connection-service.js.map +1 -0
- package/dist/orchestrator/services/semantic-search-service.d.ts +15 -0
- package/dist/orchestrator/services/semantic-search-service.d.ts.map +1 -0
- package/dist/orchestrator/services/semantic-search-service.js +154 -0
- package/dist/orchestrator/services/semantic-search-service.js.map +1 -0
- package/dist/orchestrator/services/tool-data-service.d.ts +14 -0
- package/dist/orchestrator/services/tool-data-service.d.ts.map +1 -0
- package/dist/orchestrator/services/tool-data-service.js +76 -0
- package/dist/orchestrator/services/tool-data-service.js.map +1 -0
- package/dist/orchestrator/tool-database-api.d.ts +47 -0
- package/dist/orchestrator/tool-database-api.d.ts.map +1 -0
- package/dist/orchestrator/tool-database-api.js +200 -0
- package/dist/orchestrator/tool-database-api.js.map +1 -0
- package/dist/orchestrator/types.d.ts +98 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +6 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/workflow-definitions.d.ts +9 -0
- package/dist/orchestrator/workflow-definitions.d.ts.map +1 -0
- package/dist/orchestrator/workflow-definitions.js +169 -0
- package/dist/orchestrator/workflow-definitions.js.map +1 -0
- package/dist/orchestrator/workflow-visualizer.d.ts +54 -0
- package/dist/orchestrator/workflow-visualizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow-visualizer.js +355 -0
- package/dist/orchestrator/workflow-visualizer.js.map +1 -0
- package/dist/services/managers/quality-manager.d.ts +108 -0
- package/dist/services/managers/quality-manager.d.ts.map +1 -0
- package/dist/services/managers/quality-manager.js +763 -0
- package/dist/services/managers/quality-manager.js.map +1 -0
- package/dist/services/managers/sync-manager.d.ts +106 -0
- package/dist/services/managers/sync-manager.d.ts.map +1 -0
- package/dist/services/managers/sync-manager.js +573 -0
- package/dist/services/managers/sync-manager.js.map +1 -0
- package/dist/shared/analysis-repository-consolidated.d.ts +155 -0
- package/dist/shared/analysis-repository-consolidated.d.ts.map +1 -0
- package/dist/shared/analysis-repository-consolidated.js +587 -0
- package/dist/shared/analysis-repository-consolidated.js.map +1 -0
- package/dist/shared/analysis-repository.d.ts +48 -0
- package/dist/shared/analysis-repository.d.ts.map +1 -0
- package/dist/shared/analysis-repository.js +183 -0
- package/dist/shared/analysis-repository.js.map +1 -0
- package/dist/shared/analytics-export-pipeline.d.ts +32 -0
- package/dist/shared/analytics-export-pipeline.d.ts.map +1 -0
- package/dist/shared/analytics-export-pipeline.js +307 -0
- package/dist/shared/analytics-export-pipeline.js.map +1 -0
- package/dist/shared/ast/analyzer.d.ts +59 -0
- package/dist/shared/ast/analyzer.d.ts.map +1 -0
- package/dist/shared/ast/analyzer.js +202 -0
- package/dist/shared/ast/analyzer.js.map +1 -0
- package/dist/shared/change-assessment-system.d.ts +111 -0
- package/dist/shared/change-assessment-system.d.ts.map +1 -0
- package/dist/shared/change-assessment-system.js +465 -0
- package/dist/shared/change-assessment-system.js.map +1 -0
- package/dist/shared/codebase-analyzer.d.ts +41 -0
- package/dist/shared/codebase-analyzer.d.ts.map +1 -0
- package/dist/shared/codebase-analyzer.js +60 -0
- package/dist/shared/codebase-analyzer.js.map +1 -0
- package/dist/shared/codemind-memory-system.d.ts +75 -0
- package/dist/shared/codemind-memory-system.d.ts.map +1 -0
- package/dist/shared/codemind-memory-system.js +222 -0
- package/dist/shared/codemind-memory-system.js.map +1 -0
- package/dist/shared/codeseeker-memory-system.d.ts +75 -0
- package/dist/shared/codeseeker-memory-system.d.ts.map +1 -0
- package/dist/shared/codeseeker-memory-system.js +222 -0
- package/dist/shared/codeseeker-memory-system.js.map +1 -0
- package/dist/shared/comprehensive-impact-analyzer.d.ts +94 -0
- package/dist/shared/comprehensive-impact-analyzer.d.ts.map +1 -0
- package/dist/shared/comprehensive-impact-analyzer.js +534 -0
- package/dist/shared/comprehensive-impact-analyzer.js.map +1 -0
- package/dist/shared/context-provider.d.ts +110 -0
- package/dist/shared/context-provider.d.ts.map +1 -0
- package/dist/shared/context-provider.js +392 -0
- package/dist/shared/context-provider.js.map +1 -0
- package/dist/shared/database-responsibility-guide.d.ts +183 -0
- package/dist/shared/database-responsibility-guide.d.ts.map +1 -0
- package/dist/shared/database-responsibility-guide.js +201 -0
- package/dist/shared/database-responsibility-guide.js.map +1 -0
- package/dist/shared/documentation-rag-service.d.ts +149 -0
- package/dist/shared/documentation-rag-service.d.ts.map +1 -0
- package/dist/shared/documentation-rag-service.js +586 -0
- package/dist/shared/documentation-rag-service.js.map +1 -0
- package/dist/shared/file-hash-tracker.d.ts +145 -0
- package/dist/shared/file-hash-tracker.d.ts.map +1 -0
- package/dist/shared/file-hash-tracker.js +387 -0
- package/dist/shared/file-hash-tracker.js.map +1 -0
- package/dist/shared/file-synchronization-system.d.ts +143 -0
- package/dist/shared/file-synchronization-system.d.ts.map +1 -0
- package/dist/shared/file-synchronization-system.js +642 -0
- package/dist/shared/file-synchronization-system.js.map +1 -0
- package/dist/shared/four-layer-memory-architecture.d.ts +372 -0
- package/dist/shared/four-layer-memory-architecture.d.ts.map +1 -0
- package/dist/shared/four-layer-memory-architecture.js +353 -0
- package/dist/shared/four-layer-memory-architecture.js.map +1 -0
- package/dist/shared/hybrid-file-discovery.d.ts +86 -0
- package/dist/shared/hybrid-file-discovery.d.ts.map +1 -0
- package/dist/shared/hybrid-file-discovery.js +270 -0
- package/dist/shared/hybrid-file-discovery.js.map +1 -0
- package/dist/shared/intelligent-cycle/interfaces.d.ts +73 -0
- package/dist/shared/intelligent-cycle/interfaces.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle/interfaces.js +7 -0
- package/dist/shared/intelligent-cycle/interfaces.js.map +1 -0
- package/dist/shared/intelligent-cycle/services/code-extraction-service.d.ts +29 -0
- package/dist/shared/intelligent-cycle/services/code-extraction-service.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle/services/code-extraction-service.js +191 -0
- package/dist/shared/intelligent-cycle/services/code-extraction-service.js.map +1 -0
- package/dist/shared/intelligent-cycle/services/intent-analysis-service.d.ts +17 -0
- package/dist/shared/intelligent-cycle/services/intent-analysis-service.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle/services/intent-analysis-service.js +151 -0
- package/dist/shared/intelligent-cycle/services/intent-analysis-service.js.map +1 -0
- package/dist/shared/intelligent-cycle/services/security-scanning-service.d.ts +16 -0
- package/dist/shared/intelligent-cycle/services/security-scanning-service.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle/services/security-scanning-service.js +171 -0
- package/dist/shared/intelligent-cycle/services/security-scanning-service.js.map +1 -0
- package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.d.ts +15 -0
- package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.js +116 -0
- package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.js.map +1 -0
- package/dist/shared/intelligent-cycle/services/similarity-matching-service.d.ts +13 -0
- package/dist/shared/intelligent-cycle/services/similarity-matching-service.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle/services/similarity-matching-service.js +64 -0
- package/dist/shared/intelligent-cycle/services/similarity-matching-service.js.map +1 -0
- package/dist/shared/intelligent-cycle-features.d.ts +41 -0
- package/dist/shared/intelligent-cycle-features.d.ts.map +1 -0
- package/dist/shared/intelligent-cycle-features.js +102 -0
- package/dist/shared/intelligent-cycle-features.js.map +1 -0
- package/dist/shared/intelligent-tool-selector.d.ts +90 -0
- package/dist/shared/intelligent-tool-selector.d.ts.map +1 -0
- package/dist/shared/intelligent-tool-selector.js +357 -0
- package/dist/shared/intelligent-tool-selector.js.map +1 -0
- package/dist/shared/logger.d.ts +2 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +9 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/managers/cache-manager.d.ts +147 -0
- package/dist/shared/managers/cache-manager.d.ts.map +1 -0
- package/dist/shared/managers/cache-manager.js +408 -0
- package/dist/shared/managers/cache-manager.js.map +1 -0
- package/dist/shared/managers/database-update-manager.d.ts +142 -0
- package/dist/shared/managers/database-update-manager.d.ts.map +1 -0
- package/dist/shared/managers/database-update-manager.js +747 -0
- package/dist/shared/managers/database-update-manager.js.map +1 -0
- package/dist/shared/managers/git-branch-manager.d.ts +104 -0
- package/dist/shared/managers/git-branch-manager.d.ts.map +1 -0
- package/dist/shared/managers/git-branch-manager.js +435 -0
- package/dist/shared/managers/git-branch-manager.js.map +1 -0
- package/dist/shared/memory-architecture-integration.d.ts +124 -0
- package/dist/shared/memory-architecture-integration.d.ts.map +1 -0
- package/dist/shared/memory-architecture-integration.js +247 -0
- package/dist/shared/memory-architecture-integration.js.map +1 -0
- package/dist/shared/memory-orchestrator-integration.d.ts +86 -0
- package/dist/shared/memory-orchestrator-integration.d.ts.map +1 -0
- package/dist/shared/memory-orchestrator-integration.js +325 -0
- package/dist/shared/memory-orchestrator-integration.js.map +1 -0
- package/dist/shared/memory-system/interfaces/index.d.ts +255 -0
- package/dist/shared/memory-system/interfaces/index.d.ts.map +1 -0
- package/dist/shared/memory-system/interfaces/index.js +7 -0
- package/dist/shared/memory-system/interfaces/index.js.map +1 -0
- package/dist/shared/memory-system/memory-system.d.ts +69 -0
- package/dist/shared/memory-system/memory-system.d.ts.map +1 -0
- package/dist/shared/memory-system/memory-system.js +219 -0
- package/dist/shared/memory-system/memory-system.js.map +1 -0
- package/dist/shared/memory-system/services/memory-analytics-service.d.ts +26 -0
- package/dist/shared/memory-system/services/memory-analytics-service.d.ts.map +1 -0
- package/dist/shared/memory-system/services/memory-analytics-service.js +101 -0
- package/dist/shared/memory-system/services/memory-analytics-service.js.map +1 -0
- package/dist/shared/memory-system/services/memory-optimization-service.d.ts +21 -0
- package/dist/shared/memory-system/services/memory-optimization-service.d.ts.map +1 -0
- package/dist/shared/memory-system/services/memory-optimization-service.js +282 -0
- package/dist/shared/memory-system/services/memory-optimization-service.js.map +1 -0
- package/dist/shared/memory-system/services/memory-retrieval-service.d.ts +30 -0
- package/dist/shared/memory-system/services/memory-retrieval-service.d.ts.map +1 -0
- package/dist/shared/memory-system/services/memory-retrieval-service.js +430 -0
- package/dist/shared/memory-system/services/memory-retrieval-service.js.map +1 -0
- package/dist/shared/memory-system/services/memory-storage-service.d.ts +47 -0
- package/dist/shared/memory-system/services/memory-storage-service.d.ts.map +1 -0
- package/dist/shared/memory-system/services/memory-storage-service.js +450 -0
- package/dist/shared/memory-system/services/memory-storage-service.js.map +1 -0
- package/dist/shared/multi-level-cache.d.ts +106 -0
- package/dist/shared/multi-level-cache.d.ts.map +1 -0
- package/dist/shared/multi-level-cache.js +423 -0
- package/dist/shared/multi-level-cache.js.map +1 -0
- package/dist/shared/offline-first-cache.d.ts +69 -0
- package/dist/shared/offline-first-cache.d.ts.map +1 -0
- package/dist/shared/offline-first-cache.js +312 -0
- package/dist/shared/offline-first-cache.js.map +1 -0
- package/dist/shared/performance-monitor.d.ts +69 -0
- package/dist/shared/performance-monitor.d.ts.map +1 -0
- package/dist/shared/performance-monitor.js +226 -0
- package/dist/shared/performance-monitor.js.map +1 -0
- package/dist/shared/platform-utils.d.ts +105 -0
- package/dist/shared/platform-utils.d.ts.map +1 -0
- package/dist/shared/platform-utils.js +299 -0
- package/dist/shared/platform-utils.js.map +1 -0
- package/dist/shared/post-execution-integration.d.ts +99 -0
- package/dist/shared/post-execution-integration.d.ts.map +1 -0
- package/dist/shared/post-execution-integration.js +504 -0
- package/dist/shared/post-execution-integration.js.map +1 -0
- package/dist/shared/postgresql-analytics-database.d.ts +54 -0
- package/dist/shared/postgresql-analytics-database.d.ts.map +1 -0
- package/dist/shared/postgresql-analytics-database.js +333 -0
- package/dist/shared/postgresql-analytics-database.js.map +1 -0
- package/dist/shared/project-intelligence.d.ts +45 -0
- package/dist/shared/project-intelligence.d.ts.map +1 -0
- package/dist/shared/project-intelligence.js +176 -0
- package/dist/shared/project-intelligence.js.map +1 -0
- package/dist/shared/prompt-chunking-system.d.ts +39 -0
- package/dist/shared/prompt-chunking-system.d.ts.map +1 -0
- package/dist/shared/prompt-chunking-system.js +233 -0
- package/dist/shared/prompt-chunking-system.js.map +1 -0
- package/dist/shared/reconciliation-system.d.ts +105 -0
- package/dist/shared/reconciliation-system.d.ts.map +1 -0
- package/dist/shared/reconciliation-system.js +430 -0
- package/dist/shared/reconciliation-system.js.map +1 -0
- package/dist/shared/redis-cache-adapter.d.ts +73 -0
- package/dist/shared/redis-cache-adapter.d.ts.map +1 -0
- package/dist/shared/redis-cache-adapter.js +294 -0
- package/dist/shared/redis-cache-adapter.js.map +1 -0
- package/dist/shared/redis-file-change-sync.d.ts +126 -0
- package/dist/shared/redis-file-change-sync.d.ts.map +1 -0
- package/dist/shared/redis-file-change-sync.js +779 -0
- package/dist/shared/redis-file-change-sync.js.map +1 -0
- package/dist/shared/semantic-enhancement-engine.d.ts +70 -0
- package/dist/shared/semantic-enhancement-engine.d.ts.map +1 -0
- package/dist/shared/semantic-enhancement-engine.js +127 -0
- package/dist/shared/semantic-enhancement-engine.js.map +1 -0
- package/dist/shared/task-specific-file-orchestrator.d.ts +107 -0
- package/dist/shared/task-specific-file-orchestrator.d.ts.map +1 -0
- package/dist/shared/task-specific-file-orchestrator.js +492 -0
- package/dist/shared/task-specific-file-orchestrator.js.map +1 -0
- package/dist/shared/tool-adapter.d.ts +27 -0
- package/dist/shared/tool-adapter.d.ts.map +1 -0
- package/dist/shared/tool-adapter.js +147 -0
- package/dist/shared/tool-adapter.js.map +1 -0
- package/dist/shared/tool-config-repository.d.ts +41 -0
- package/dist/shared/tool-config-repository.d.ts.map +1 -0
- package/dist/shared/tool-config-repository.js +178 -0
- package/dist/shared/tool-config-repository.js.map +1 -0
- package/dist/shared/tool-interface.d.ts +220 -0
- package/dist/shared/tool-interface.d.ts.map +1 -0
- package/dist/shared/tool-interface.js +357 -0
- package/dist/shared/tool-interface.js.map +1 -0
- package/dist/shared/tool-registry-initializer.d.ts +32 -0
- package/dist/shared/tool-registry-initializer.d.ts.map +1 -0
- package/dist/shared/tool-registry-initializer.js +173 -0
- package/dist/shared/tool-registry-initializer.js.map +1 -0
- package/dist/shared/types.d.ts +48 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +6 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/shared/validation-cycle/interfaces/index.d.ts +102 -0
- package/dist/shared/validation-cycle/interfaces/index.d.ts.map +1 -0
- package/dist/shared/validation-cycle/interfaces/index.js +7 -0
- package/dist/shared/validation-cycle/interfaces/index.js.map +1 -0
- package/dist/shared/validation-cycle/services/core-safety-service.d.ts +21 -0
- package/dist/shared/validation-cycle/services/core-safety-service.d.ts.map +1 -0
- package/dist/shared/validation-cycle/services/core-safety-service.js +339 -0
- package/dist/shared/validation-cycle/services/core-safety-service.js.map +1 -0
- package/dist/shared/validation-cycle/services/quality-validation-service.d.ts +24 -0
- package/dist/shared/validation-cycle/services/quality-validation-service.d.ts.map +1 -0
- package/dist/shared/validation-cycle/services/quality-validation-service.js +368 -0
- package/dist/shared/validation-cycle/services/quality-validation-service.js.map +1 -0
- package/dist/shared/validation-cycle/services/validation-aggregator-service.d.ts +28 -0
- package/dist/shared/validation-cycle/services/validation-aggregator-service.d.ts.map +1 -0
- package/dist/shared/validation-cycle/services/validation-aggregator-service.js +214 -0
- package/dist/shared/validation-cycle/services/validation-aggregator-service.js.map +1 -0
- package/dist/shared/validation-cycle/services/validation-report-service.d.ts +29 -0
- package/dist/shared/validation-cycle/services/validation-report-service.d.ts.map +1 -0
- package/dist/shared/validation-cycle/services/validation-report-service.js +304 -0
- package/dist/shared/validation-cycle/services/validation-report-service.js.map +1 -0
- package/dist/shared/validation-cycle/validation-cycle.d.ts +64 -0
- package/dist/shared/validation-cycle/validation-cycle.d.ts.map +1 -0
- package/dist/shared/validation-cycle/validation-cycle.js +226 -0
- package/dist/shared/validation-cycle/validation-cycle.js.map +1 -0
- package/dist/shared/validation-cycle.d.ts +12 -0
- package/dist/shared/validation-cycle.d.ts.map +1 -0
- package/dist/shared/validation-cycle.js +20 -0
- package/dist/shared/validation-cycle.js.map +1 -0
- package/dist/storage/embedded/graphology-graph-store.d.ts +39 -0
- package/dist/storage/embedded/graphology-graph-store.d.ts.map +1 -0
- package/dist/storage/embedded/graphology-graph-store.js +357 -0
- package/dist/storage/embedded/graphology-graph-store.js.map +1 -0
- package/dist/storage/embedded/index.d.ts +40 -0
- package/dist/storage/embedded/index.d.ts.map +1 -0
- package/dist/storage/embedded/index.js +154 -0
- package/dist/storage/embedded/index.js.map +1 -0
- package/dist/storage/embedded/lru-cache-store.d.ts +44 -0
- package/dist/storage/embedded/lru-cache-store.d.ts.map +1 -0
- package/dist/storage/embedded/lru-cache-store.js +232 -0
- package/dist/storage/embedded/lru-cache-store.js.map +1 -0
- package/dist/storage/embedded/minisearch-text-store.d.ts +62 -0
- package/dist/storage/embedded/minisearch-text-store.d.ts.map +1 -0
- package/dist/storage/embedded/minisearch-text-store.js +521 -0
- package/dist/storage/embedded/minisearch-text-store.js.map +1 -0
- package/dist/storage/embedded/sqlite-project-store.d.ts +29 -0
- package/dist/storage/embedded/sqlite-project-store.d.ts.map +1 -0
- package/dist/storage/embedded/sqlite-project-store.js +193 -0
- package/dist/storage/embedded/sqlite-project-store.js.map +1 -0
- package/dist/storage/embedded/sqlite-vector-store.d.ts +48 -0
- package/dist/storage/embedded/sqlite-vector-store.d.ts.map +1 -0
- package/dist/storage/embedded/sqlite-vector-store.js +462 -0
- package/dist/storage/embedded/sqlite-vector-store.js.map +1 -0
- package/dist/storage/index.d.ts +64 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +84 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/interfaces.d.ts +259 -0
- package/dist/storage/interfaces.d.ts.map +1 -0
- package/dist/storage/interfaces.js +12 -0
- package/dist/storage/interfaces.js.map +1 -0
- package/dist/storage/server/elasticsearch-text-store.d.ts +82 -0
- package/dist/storage/server/elasticsearch-text-store.d.ts.map +1 -0
- package/dist/storage/server/elasticsearch-text-store.js +177 -0
- package/dist/storage/server/elasticsearch-text-store.js.map +1 -0
- package/dist/storage/server/index.d.ts +42 -0
- package/dist/storage/server/index.d.ts.map +1 -0
- package/dist/storage/server/index.js +109 -0
- package/dist/storage/server/index.js.map +1 -0
- package/dist/storage/server/neo4j-graph-store.d.ts +49 -0
- package/dist/storage/server/neo4j-graph-store.d.ts.map +1 -0
- package/dist/storage/server/neo4j-graph-store.js +357 -0
- package/dist/storage/server/neo4j-graph-store.js.map +1 -0
- package/dist/storage/server/postgres-project-store.d.ts +30 -0
- package/dist/storage/server/postgres-project-store.d.ts.map +1 -0
- package/dist/storage/server/postgres-project-store.js +146 -0
- package/dist/storage/server/postgres-project-store.js.map +1 -0
- package/dist/storage/server/postgres-vector-store.d.ts +51 -0
- package/dist/storage/server/postgres-vector-store.d.ts.map +1 -0
- package/dist/storage/server/postgres-vector-store.js +306 -0
- package/dist/storage/server/postgres-vector-store.js.map +1 -0
- package/dist/storage/server/redis-cache-store.d.ts +61 -0
- package/dist/storage/server/redis-cache-store.d.ts.map +1 -0
- package/dist/storage/server/redis-cache-store.js +209 -0
- package/dist/storage/server/redis-cache-store.js.map +1 -0
- package/dist/storage/storage-manager.d.ts +121 -0
- package/dist/storage/storage-manager.d.ts.map +1 -0
- package/dist/storage/storage-manager.js +444 -0
- package/dist/storage/storage-manager.js.map +1 -0
- package/dist/storage/storage-provider.d.ts +62 -0
- package/dist/storage/storage-provider.d.ts.map +1 -0
- package/dist/storage/storage-provider.js +257 -0
- package/dist/storage/storage-provider.js.map +1 -0
- package/dist/utils/cache.d.ts +66 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +254 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/cli-logger.d.ts +75 -0
- package/dist/utils/cli-logger.d.ts.map +1 -0
- package/dist/utils/cli-logger.js +217 -0
- package/dist/utils/cli-logger.js.map +1 -0
- package/dist/utils/colored-logger.d.ts +40 -0
- package/dist/utils/colored-logger.d.ts.map +1 -0
- package/dist/utils/colored-logger.js +233 -0
- package/dist/utils/colored-logger.js.map +1 -0
- package/dist/utils/config.d.ts +61 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +230 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/file-system.d.ts +30 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +207 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/hash.d.ts +79 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +172 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/logger.d.ts +39 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +106 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +150 -0
|
@@ -0,0 +1,1827 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CodeSeeker MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Exposes CodeSeeker's semantic search and code analysis capabilities
|
|
6
|
+
* as an MCP (Model Context Protocol) server for use with Claude Desktop
|
|
7
|
+
* and Claude Code.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* codeseeker serve --mcp
|
|
11
|
+
*
|
|
12
|
+
* Then add to claude_desktop_config.json:
|
|
13
|
+
* {
|
|
14
|
+
* "mcpServers": {
|
|
15
|
+
* "codeseeker": {
|
|
16
|
+
* "command": "codeseeker",
|
|
17
|
+
* "args": ["serve", "--mcp"]
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
29
|
+
}) : (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
o[k2] = m[k];
|
|
32
|
+
}));
|
|
33
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
34
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
35
|
+
}) : function(o, v) {
|
|
36
|
+
o["default"] = v;
|
|
37
|
+
});
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
55
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
+
exports.CodeSeekerMcpServer = void 0;
|
|
57
|
+
exports.startMcpServer = startMcpServer;
|
|
58
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
59
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
60
|
+
const zod_1 = require("zod");
|
|
61
|
+
const path = __importStar(require("path"));
|
|
62
|
+
const fs = __importStar(require("fs"));
|
|
63
|
+
const crypto = __importStar(require("crypto"));
|
|
64
|
+
const storage_1 = require("../storage");
|
|
65
|
+
const semantic_search_orchestrator_1 = require("../cli/commands/services/semantic-search-orchestrator");
|
|
66
|
+
const indexing_service_1 = require("./indexing-service");
|
|
67
|
+
const coding_standards_generator_1 = require("../cli/services/analysis/coding-standards-generator");
|
|
68
|
+
const language_support_service_1 = require("../cli/services/project/language-support-service");
|
|
69
|
+
// Version from package.json
|
|
70
|
+
const VERSION = '2.0.0';
|
|
71
|
+
/**
|
|
72
|
+
* MCP Server for CodeSeeker
|
|
73
|
+
*/
|
|
74
|
+
class CodeSeekerMcpServer {
|
|
75
|
+
server;
|
|
76
|
+
searchOrchestrator;
|
|
77
|
+
indexingService;
|
|
78
|
+
languageSupportService;
|
|
79
|
+
constructor() {
|
|
80
|
+
this.server = new mcp_js_1.McpServer({
|
|
81
|
+
name: 'codeseeker',
|
|
82
|
+
version: VERSION,
|
|
83
|
+
});
|
|
84
|
+
this.searchOrchestrator = new semantic_search_orchestrator_1.SemanticSearchOrchestrator();
|
|
85
|
+
this.indexingService = new indexing_service_1.IndexingService();
|
|
86
|
+
this.languageSupportService = new language_support_service_1.LanguageSupportService();
|
|
87
|
+
this.registerTools();
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Find CodeSeeker project by walking up directory tree from startPath
|
|
91
|
+
* looking for .codeseeker/project.json
|
|
92
|
+
*/
|
|
93
|
+
async findProjectPath(startPath) {
|
|
94
|
+
let currentPath = path.resolve(startPath);
|
|
95
|
+
const root = path.parse(currentPath).root;
|
|
96
|
+
while (currentPath !== root) {
|
|
97
|
+
const configPath = path.join(currentPath, '.codeseeker', 'project.json');
|
|
98
|
+
if (fs.existsSync(configPath)) {
|
|
99
|
+
return currentPath;
|
|
100
|
+
}
|
|
101
|
+
currentPath = path.dirname(currentPath);
|
|
102
|
+
}
|
|
103
|
+
// No project found, return original path
|
|
104
|
+
return startPath;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Register all MCP tools
|
|
108
|
+
*/
|
|
109
|
+
registerTools() {
|
|
110
|
+
this.registerSearchCodeTool();
|
|
111
|
+
this.registerFindAndReadTool();
|
|
112
|
+
this.registerGetFileContextTool();
|
|
113
|
+
this.registerGetCodeRelationshipsTool();
|
|
114
|
+
this.registerListProjectsTool();
|
|
115
|
+
this.registerIndexProjectTool();
|
|
116
|
+
this.registerNotifyFileChangesTool();
|
|
117
|
+
this.registerInstallLanguageSupportTool();
|
|
118
|
+
this.registerManageIndexTool();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Tool 1: Semantic search across indexed projects
|
|
122
|
+
*/
|
|
123
|
+
registerSearchCodeTool() {
|
|
124
|
+
this.server.registerTool('search_code', {
|
|
125
|
+
description: '**DEFAULT TOOL FOR CODE DISCOVERY** - Use this BEFORE grep/glob for any code search. ' +
|
|
126
|
+
'This semantic search finds code by meaning, not just text patterns. ' +
|
|
127
|
+
'ALWAYS use for: "Where is X handled?", "Find the auth logic", "How does Y work?", "What calls Z?" ' +
|
|
128
|
+
'Only fall back to grep when: you need exact literal strings, regex patterns, or already know the exact file. ' +
|
|
129
|
+
'Why better than grep: finds "user authentication" even if code says "login", "session", "credentials". ' +
|
|
130
|
+
'Examples: ❌ grep -r "damage.*ship" → ✅ search_code("how ships take damage"). ' +
|
|
131
|
+
'Returns absolute file paths ready for the Read tool. If not indexed, call index_project first.',
|
|
132
|
+
inputSchema: {
|
|
133
|
+
query: zod_1.z.string().describe('Natural language query or code snippet (e.g., "validation logic", "error handling")'),
|
|
134
|
+
project: zod_1.z.string().optional().describe('Project path (optional - auto-detects from indexed projects if omitted)'),
|
|
135
|
+
limit: zod_1.z.number().optional().default(10).describe('Maximum results (default: 10)'),
|
|
136
|
+
search_type: zod_1.z.enum(['hybrid', 'fts', 'vector', 'graph']).optional().default('hybrid')
|
|
137
|
+
.describe('Search method: hybrid (default), fts, vector, or graph'),
|
|
138
|
+
mode: zod_1.z.enum(['full', 'exists']).optional().default('full')
|
|
139
|
+
.describe('Mode: "full" returns detailed results, "exists" returns quick summary (faster)'),
|
|
140
|
+
},
|
|
141
|
+
}, async ({ query, project, limit = 10, search_type = 'hybrid', mode = 'full' }) => {
|
|
142
|
+
try {
|
|
143
|
+
// Get storage manager
|
|
144
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
145
|
+
const projectStore = storageManager.getProjectStore();
|
|
146
|
+
const projects = await projectStore.list();
|
|
147
|
+
// Resolve project path - auto-detect if not provided
|
|
148
|
+
let projectPath;
|
|
149
|
+
let projectRecord;
|
|
150
|
+
if (project) {
|
|
151
|
+
// Try to find by name/path
|
|
152
|
+
projectRecord = projects.find(p => p.name === project ||
|
|
153
|
+
p.path === project ||
|
|
154
|
+
path.basename(p.path) === project ||
|
|
155
|
+
path.resolve(project) === p.path);
|
|
156
|
+
if (projectRecord) {
|
|
157
|
+
projectPath = projectRecord.path;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// Use provided path directly and try to find CodeSeeker project
|
|
161
|
+
projectPath = await this.findProjectPath(path.resolve(project));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// Auto-detect: try cwd first, then fall back to most recently indexed project
|
|
166
|
+
const cwd = process.cwd();
|
|
167
|
+
projectRecord = projects.find(p => p.path === cwd ||
|
|
168
|
+
cwd.startsWith(p.path + path.sep) ||
|
|
169
|
+
cwd.startsWith(p.path + '/'));
|
|
170
|
+
if (projectRecord) {
|
|
171
|
+
projectPath = projectRecord.path;
|
|
172
|
+
}
|
|
173
|
+
else if (projects.length > 0) {
|
|
174
|
+
// Use most recently updated project
|
|
175
|
+
const sorted = [...projects].sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
176
|
+
projectRecord = sorted[0];
|
|
177
|
+
projectPath = projectRecord.path;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
return {
|
|
181
|
+
content: [{
|
|
182
|
+
type: 'text',
|
|
183
|
+
text: `No indexed projects found. Use index_project to index a project first.`,
|
|
184
|
+
}],
|
|
185
|
+
isError: true,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Check if project is indexed by checking for embeddings
|
|
190
|
+
const vectorStore = storageManager.getVectorStore();
|
|
191
|
+
if (!projectRecord) {
|
|
192
|
+
projectRecord = await projectStore.findByPath(projectPath);
|
|
193
|
+
}
|
|
194
|
+
if (projectRecord) {
|
|
195
|
+
// Quick check: does this project have any embeddings?
|
|
196
|
+
try {
|
|
197
|
+
const testResults = await vectorStore.searchByText('test', projectRecord.id, 1);
|
|
198
|
+
if (!testResults || testResults.length === 0) {
|
|
199
|
+
return {
|
|
200
|
+
content: [{
|
|
201
|
+
type: 'text',
|
|
202
|
+
text: `⚠️ Project "${path.basename(projectPath)}" found but not indexed.\n\n` +
|
|
203
|
+
`ACTION REQUIRED: Call index_project({path: "${projectPath}"}) then retry this search.`,
|
|
204
|
+
}],
|
|
205
|
+
isError: true,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
// If search fails, project likely not indexed
|
|
211
|
+
return {
|
|
212
|
+
content: [{
|
|
213
|
+
type: 'text',
|
|
214
|
+
text: `⚠️ Project "${path.basename(projectPath)}" needs indexing.\n\n` +
|
|
215
|
+
`ACTION REQUIRED: Call index_project({path: "${projectPath}"}) then retry this search.`,
|
|
216
|
+
}],
|
|
217
|
+
isError: true,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// Perform search
|
|
222
|
+
const results = await this.searchOrchestrator.performSemanticSearch(query, projectPath);
|
|
223
|
+
const limitedResults = results.slice(0, mode === 'exists' ? 5 : limit);
|
|
224
|
+
if (limitedResults.length === 0) {
|
|
225
|
+
// For exists mode, return structured response
|
|
226
|
+
if (mode === 'exists') {
|
|
227
|
+
return {
|
|
228
|
+
content: [{
|
|
229
|
+
type: 'text',
|
|
230
|
+
text: JSON.stringify({
|
|
231
|
+
exists: false,
|
|
232
|
+
query,
|
|
233
|
+
project: projectPath,
|
|
234
|
+
message: 'No matching code found',
|
|
235
|
+
}, null, 2),
|
|
236
|
+
}],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
content: [{
|
|
241
|
+
type: 'text',
|
|
242
|
+
text: `No results found for query: "${query}"\n\n` +
|
|
243
|
+
`This could mean:\n` +
|
|
244
|
+
`1. No matching code exists for this query\n` +
|
|
245
|
+
`2. Try different search terms or broader queries\n` +
|
|
246
|
+
`3. The project may need reindexing if code was recently added`,
|
|
247
|
+
}],
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
// For exists mode, return quick summary
|
|
251
|
+
if (mode === 'exists') {
|
|
252
|
+
const topResult = limitedResults[0];
|
|
253
|
+
const absolutePath = path.isAbsolute(topResult.file)
|
|
254
|
+
? topResult.file
|
|
255
|
+
: path.join(projectPath, topResult.file);
|
|
256
|
+
return {
|
|
257
|
+
content: [{
|
|
258
|
+
type: 'text',
|
|
259
|
+
text: JSON.stringify({
|
|
260
|
+
exists: true,
|
|
261
|
+
query,
|
|
262
|
+
project: projectPath,
|
|
263
|
+
total_matches: results.length,
|
|
264
|
+
top_file: absolutePath,
|
|
265
|
+
top_score: Math.round(topResult.similarity * 100) / 100,
|
|
266
|
+
hint: `Use Read tool with "${absolutePath}" to view the file`,
|
|
267
|
+
}, null, 2),
|
|
268
|
+
}],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
// Format full results with absolute paths
|
|
272
|
+
const formattedResults = limitedResults.map((r, i) => {
|
|
273
|
+
const absolutePath = path.isAbsolute(r.file)
|
|
274
|
+
? r.file
|
|
275
|
+
: path.join(projectPath, r.file);
|
|
276
|
+
return {
|
|
277
|
+
rank: i + 1,
|
|
278
|
+
file: absolutePath,
|
|
279
|
+
relative_path: r.file,
|
|
280
|
+
score: Math.round(r.similarity * 100) / 100,
|
|
281
|
+
type: r.type,
|
|
282
|
+
chunk: r.content.substring(0, 500) + (r.content.length > 500 ? '...' : ''),
|
|
283
|
+
lines: r.lineStart && r.lineEnd ? `${r.lineStart}-${r.lineEnd}` : undefined,
|
|
284
|
+
};
|
|
285
|
+
});
|
|
286
|
+
return {
|
|
287
|
+
content: [{
|
|
288
|
+
type: 'text',
|
|
289
|
+
text: JSON.stringify({
|
|
290
|
+
query,
|
|
291
|
+
project: projectPath,
|
|
292
|
+
total_results: limitedResults.length,
|
|
293
|
+
search_type,
|
|
294
|
+
results: formattedResults,
|
|
295
|
+
}, null, 2),
|
|
296
|
+
}],
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
301
|
+
return {
|
|
302
|
+
content: [{
|
|
303
|
+
type: 'text',
|
|
304
|
+
text: `Search failed: ${message}`,
|
|
305
|
+
}],
|
|
306
|
+
isError: true,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Tool 2: Find and read - combined search + read in one call
|
|
313
|
+
*/
|
|
314
|
+
registerFindAndReadTool() {
|
|
315
|
+
this.server.registerTool('find_and_read', {
|
|
316
|
+
description: '**SEARCH + READ IN ONE STEP** - Use when you need to see actual code, not just file paths. ' +
|
|
317
|
+
'Combines search_code + Read into a single call. Saves a round-trip when you know you\'ll need to read results. ' +
|
|
318
|
+
'Use this instead of search_code when: implementing something similar, understanding HOW code works, ' +
|
|
319
|
+
'user asks "show me the X code", or you need full context to make changes. ' +
|
|
320
|
+
'Examples: "Show me how damage is calculated" → find_and_read("damage calculation"). ' +
|
|
321
|
+
'"I need to add validation like login" → find_and_read("login form validation"). ' +
|
|
322
|
+
'Use search_code instead when: you only need file paths, checking if something exists (mode="exists"), ' +
|
|
323
|
+
'or want to see many results before picking one. Returns full file content with line numbers.',
|
|
324
|
+
inputSchema: {
|
|
325
|
+
query: zod_1.z.string().describe('Natural language query or code snippet (e.g., "validation logic", "error handling")'),
|
|
326
|
+
project: zod_1.z.string().optional().describe('Project path (optional - auto-detects from indexed projects if omitted)'),
|
|
327
|
+
max_files: zod_1.z.number().optional().default(1).describe('Maximum files to read (default: 1, max: 3)'),
|
|
328
|
+
max_lines: zod_1.z.number().optional().default(500).describe('Maximum lines per file (default: 500, max: 1000)'),
|
|
329
|
+
},
|
|
330
|
+
}, async ({ query, project, max_files = 1, max_lines = 500 }) => {
|
|
331
|
+
try {
|
|
332
|
+
// Cap the limits
|
|
333
|
+
const fileLimit = Math.min(max_files, 3);
|
|
334
|
+
const lineLimit = Math.min(max_lines, 1000);
|
|
335
|
+
// Get storage manager
|
|
336
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
337
|
+
const projectStore = storageManager.getProjectStore();
|
|
338
|
+
const projects = await projectStore.list();
|
|
339
|
+
// Resolve project path - auto-detect if not provided
|
|
340
|
+
let projectPath;
|
|
341
|
+
let projectRecord;
|
|
342
|
+
if (project) {
|
|
343
|
+
// Try to find by name/path
|
|
344
|
+
projectRecord = projects.find(p => p.name === project ||
|
|
345
|
+
p.path === project ||
|
|
346
|
+
path.basename(p.path) === project ||
|
|
347
|
+
path.resolve(project) === p.path);
|
|
348
|
+
if (projectRecord) {
|
|
349
|
+
projectPath = projectRecord.path;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
projectPath = await this.findProjectPath(path.resolve(project));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
// Auto-detect: try cwd first, then fall back to most recently indexed project
|
|
357
|
+
const cwd = process.cwd();
|
|
358
|
+
projectRecord = projects.find(p => p.path === cwd ||
|
|
359
|
+
cwd.startsWith(p.path + path.sep) ||
|
|
360
|
+
cwd.startsWith(p.path + '/'));
|
|
361
|
+
if (projectRecord) {
|
|
362
|
+
projectPath = projectRecord.path;
|
|
363
|
+
}
|
|
364
|
+
else if (projects.length > 0) {
|
|
365
|
+
// Use most recently updated project
|
|
366
|
+
const sorted = [...projects].sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
367
|
+
projectRecord = sorted[0];
|
|
368
|
+
projectPath = projectRecord.path;
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
return {
|
|
372
|
+
content: [{
|
|
373
|
+
type: 'text',
|
|
374
|
+
text: `No indexed projects found. Use index_project to index a project first.`,
|
|
375
|
+
}],
|
|
376
|
+
isError: true,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// Check if project is indexed
|
|
381
|
+
const vectorStore = storageManager.getVectorStore();
|
|
382
|
+
if (!projectRecord) {
|
|
383
|
+
projectRecord = await projectStore.findByPath(projectPath);
|
|
384
|
+
}
|
|
385
|
+
if (projectRecord) {
|
|
386
|
+
try {
|
|
387
|
+
const testResults = await vectorStore.searchByText('test', projectRecord.id, 1);
|
|
388
|
+
if (!testResults || testResults.length === 0) {
|
|
389
|
+
return {
|
|
390
|
+
content: [{
|
|
391
|
+
type: 'text',
|
|
392
|
+
text: `⚠️ Project "${path.basename(projectPath)}" found but not indexed.\n\n` +
|
|
393
|
+
`ACTION REQUIRED: Call index_project({path: "${projectPath}"}) then retry.`,
|
|
394
|
+
}],
|
|
395
|
+
isError: true,
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
catch {
|
|
400
|
+
return {
|
|
401
|
+
content: [{
|
|
402
|
+
type: 'text',
|
|
403
|
+
text: `⚠️ Project "${path.basename(projectPath)}" needs indexing.\n\n` +
|
|
404
|
+
`ACTION REQUIRED: Call index_project({path: "${projectPath}"}) then retry.`,
|
|
405
|
+
}],
|
|
406
|
+
isError: true,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
// Perform search
|
|
411
|
+
const results = await this.searchOrchestrator.performSemanticSearch(query, projectPath);
|
|
412
|
+
if (results.length === 0) {
|
|
413
|
+
return {
|
|
414
|
+
content: [{
|
|
415
|
+
type: 'text',
|
|
416
|
+
text: JSON.stringify({
|
|
417
|
+
query,
|
|
418
|
+
project: projectPath,
|
|
419
|
+
found: false,
|
|
420
|
+
message: 'No matching code found. Try different search terms.',
|
|
421
|
+
}, null, 2),
|
|
422
|
+
}],
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
// Get unique files (a search may return multiple chunks from the same file)
|
|
426
|
+
const seenFiles = new Set();
|
|
427
|
+
const uniqueResults = [];
|
|
428
|
+
for (const r of results) {
|
|
429
|
+
const normalizedPath = r.file.replace(/\\/g, '/');
|
|
430
|
+
if (!seenFiles.has(normalizedPath)) {
|
|
431
|
+
seenFiles.add(normalizedPath);
|
|
432
|
+
uniqueResults.push(r);
|
|
433
|
+
if (uniqueResults.length >= fileLimit)
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
// Read each file
|
|
438
|
+
const files = [];
|
|
439
|
+
for (const result of uniqueResults) {
|
|
440
|
+
const absolutePath = path.isAbsolute(result.file)
|
|
441
|
+
? result.file
|
|
442
|
+
: path.join(projectPath, result.file);
|
|
443
|
+
try {
|
|
444
|
+
if (!fs.existsSync(absolutePath)) {
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
const content = fs.readFileSync(absolutePath, 'utf-8');
|
|
448
|
+
const lines = content.split('\n');
|
|
449
|
+
const truncated = lines.length > lineLimit;
|
|
450
|
+
const displayLines = truncated ? lines.slice(0, lineLimit) : lines;
|
|
451
|
+
// Add line numbers
|
|
452
|
+
const numberedContent = displayLines
|
|
453
|
+
.map((line, i) => `${String(i + 1).padStart(4)}│ ${line}`)
|
|
454
|
+
.join('\n');
|
|
455
|
+
files.push({
|
|
456
|
+
file: absolutePath,
|
|
457
|
+
relative_path: result.file,
|
|
458
|
+
score: Math.round(result.similarity * 100) / 100,
|
|
459
|
+
match_type: result.type,
|
|
460
|
+
line_count: lines.length,
|
|
461
|
+
content: numberedContent + (truncated ? `\n... (truncated at ${lineLimit} lines)` : ''),
|
|
462
|
+
truncated,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
catch (err) {
|
|
466
|
+
// Skip files we can't read
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
if (files.length === 0) {
|
|
471
|
+
return {
|
|
472
|
+
content: [{
|
|
473
|
+
type: 'text',
|
|
474
|
+
text: JSON.stringify({
|
|
475
|
+
query,
|
|
476
|
+
project: projectPath,
|
|
477
|
+
found: true,
|
|
478
|
+
readable: false,
|
|
479
|
+
message: 'Found matching files but could not read them.',
|
|
480
|
+
}, null, 2),
|
|
481
|
+
}],
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
return {
|
|
485
|
+
content: [{
|
|
486
|
+
type: 'text',
|
|
487
|
+
text: JSON.stringify({
|
|
488
|
+
query,
|
|
489
|
+
project: projectPath,
|
|
490
|
+
files_found: results.length,
|
|
491
|
+
files_returned: files.length,
|
|
492
|
+
results: files,
|
|
493
|
+
}, null, 2),
|
|
494
|
+
}],
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
499
|
+
return {
|
|
500
|
+
content: [{
|
|
501
|
+
type: 'text',
|
|
502
|
+
text: `Find and read failed: ${message}`,
|
|
503
|
+
}],
|
|
504
|
+
isError: true,
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Tool 3: Get file with semantic context
|
|
511
|
+
*/
|
|
512
|
+
registerGetFileContextTool() {
|
|
513
|
+
this.server.registerTool('get_file_context', {
|
|
514
|
+
description: '**READ FILE WITH RELATED CODE** - Enhanced Read that includes semantically similar code. ' +
|
|
515
|
+
'Use instead of basic Read when: reading a file for the first time, the file references other modules, ' +
|
|
516
|
+
'or you want to discover patterns used elsewhere in the codebase. ' +
|
|
517
|
+
'Examples: Understanding a component → get_file_context("src/Button.tsx") returns Button + similar patterns. ' +
|
|
518
|
+
'Reading a service → get_file_context("src/api.ts") returns api.ts + related implementations. ' +
|
|
519
|
+
'Use basic Read instead when: you just need file contents, already understand the codebase, or making quick edits. ' +
|
|
520
|
+
'Set include_related=false to get just the file without related chunks.',
|
|
521
|
+
inputSchema: {
|
|
522
|
+
filepath: zod_1.z.string().describe('Path to the file (absolute or relative to project)'),
|
|
523
|
+
include_related: zod_1.z.boolean().optional().default(true)
|
|
524
|
+
.describe('If true, also return semantically similar chunks from other files'),
|
|
525
|
+
project: zod_1.z.string().optional().describe('Project name or path (optional, defaults to current directory)'),
|
|
526
|
+
},
|
|
527
|
+
}, async ({ filepath, include_related = true, project }) => {
|
|
528
|
+
try {
|
|
529
|
+
// Resolve project path
|
|
530
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
531
|
+
const projectStore = storageManager.getProjectStore();
|
|
532
|
+
let projectPath;
|
|
533
|
+
if (project) {
|
|
534
|
+
const projects = await projectStore.list();
|
|
535
|
+
const found = projects.find(p => p.name === project ||
|
|
536
|
+
p.path === project ||
|
|
537
|
+
path.basename(p.path) === project);
|
|
538
|
+
projectPath = found?.path || process.cwd();
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
projectPath = process.cwd();
|
|
542
|
+
}
|
|
543
|
+
// Resolve file path
|
|
544
|
+
const absolutePath = path.isAbsolute(filepath)
|
|
545
|
+
? filepath
|
|
546
|
+
: path.join(projectPath, filepath);
|
|
547
|
+
// Read file content
|
|
548
|
+
if (!fs.existsSync(absolutePath)) {
|
|
549
|
+
return {
|
|
550
|
+
content: [{
|
|
551
|
+
type: 'text',
|
|
552
|
+
text: `File not found: ${absolutePath}`,
|
|
553
|
+
}],
|
|
554
|
+
isError: true,
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
const content = fs.readFileSync(absolutePath, 'utf-8');
|
|
558
|
+
// Get related chunks if requested
|
|
559
|
+
let relatedChunks = [];
|
|
560
|
+
if (include_related) {
|
|
561
|
+
// Build a semantic search query from the file content
|
|
562
|
+
// Use the first meaningful lines of code (skip comments, imports, empty lines)
|
|
563
|
+
const lines = content.split('\n');
|
|
564
|
+
const meaningfulLines = [];
|
|
565
|
+
for (const line of lines) {
|
|
566
|
+
const trimmed = line.trim();
|
|
567
|
+
// Skip empty, comments, and import lines
|
|
568
|
+
if (!trimmed)
|
|
569
|
+
continue;
|
|
570
|
+
if (trimmed.startsWith('//') || trimmed.startsWith('/*') || trimmed.startsWith('*'))
|
|
571
|
+
continue;
|
|
572
|
+
if (trimmed.startsWith('import ') || trimmed.startsWith('from ') || trimmed.startsWith('require('))
|
|
573
|
+
continue;
|
|
574
|
+
if (trimmed.startsWith('#') && !trimmed.startsWith('##'))
|
|
575
|
+
continue; // Skip Python comments but not markdown headers
|
|
576
|
+
if (trimmed.startsWith('using ') || trimmed.startsWith('namespace '))
|
|
577
|
+
continue; // C#
|
|
578
|
+
meaningfulLines.push(trimmed);
|
|
579
|
+
if (meaningfulLines.length >= 5)
|
|
580
|
+
break; // Use first 5 meaningful lines
|
|
581
|
+
}
|
|
582
|
+
// Create search query from file name + meaningful content
|
|
583
|
+
const fileName = path.basename(filepath);
|
|
584
|
+
const fileNameQuery = fileName.replace(/\.[^.]+$/, '').replace(/[-_]/g, ' ');
|
|
585
|
+
const contentQuery = meaningfulLines.join(' ').substring(0, 200);
|
|
586
|
+
const searchQuery = `${fileNameQuery} ${contentQuery}`.trim();
|
|
587
|
+
const results = await this.searchOrchestrator.performSemanticSearch(searchQuery || fileNameQuery, // Fallback to filename if no content
|
|
588
|
+
projectPath);
|
|
589
|
+
// Filter out the current file and limit results
|
|
590
|
+
relatedChunks = results
|
|
591
|
+
.filter(r => !r.file.endsWith(path.basename(filepath)))
|
|
592
|
+
.slice(0, 5)
|
|
593
|
+
.map(r => ({
|
|
594
|
+
file: r.file,
|
|
595
|
+
chunk: r.content.substring(0, 300) + (r.content.length > 300 ? '...' : ''),
|
|
596
|
+
score: Math.round(r.similarity * 100) / 100,
|
|
597
|
+
}));
|
|
598
|
+
}
|
|
599
|
+
return {
|
|
600
|
+
content: [{
|
|
601
|
+
type: 'text',
|
|
602
|
+
text: JSON.stringify({
|
|
603
|
+
filepath: path.relative(projectPath, absolutePath),
|
|
604
|
+
content: content.length > 10000 ? content.substring(0, 10000) + '\n... (truncated)' : content,
|
|
605
|
+
line_count: content.split('\n').length,
|
|
606
|
+
related_chunks: include_related ? relatedChunks : undefined,
|
|
607
|
+
}, null, 2),
|
|
608
|
+
}],
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
catch (error) {
|
|
612
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
613
|
+
return {
|
|
614
|
+
content: [{
|
|
615
|
+
type: 'text',
|
|
616
|
+
text: `Failed to get file context: ${message}`,
|
|
617
|
+
}],
|
|
618
|
+
isError: true,
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Tool 3: Get code relationships from the knowledge graph
|
|
625
|
+
* Uses "Seed + Expand" strategy like the CLI's GraphAnalysisService
|
|
626
|
+
*/
|
|
627
|
+
registerGetCodeRelationshipsTool() {
|
|
628
|
+
this.server.registerTool('get_code_relationships', {
|
|
629
|
+
description: '**UNDERSTAND CODE CONNECTIONS** - Use after search_code to explore how files relate. ' +
|
|
630
|
+
'Maps imports, class hierarchies, function calls, dependencies. Essential for understanding impact of changes. ' +
|
|
631
|
+
'Use when: planning refactors ("what breaks if I change this?"), understanding architecture ("what depends on this?"), ' +
|
|
632
|
+
'tracing data flow ("where does this come from?"), before changing shared code. ' +
|
|
633
|
+
'WORKFLOW: 1) search_code to find files, 2) pass those paths here via filepaths parameter. ' +
|
|
634
|
+
'Filter with relationship_types: ["imports"], ["calls"], ["extends"] to reduce noise. ' +
|
|
635
|
+
'Use direction="in" to find what USES this file, direction="out" for what this file USES.',
|
|
636
|
+
inputSchema: {
|
|
637
|
+
filepath: zod_1.z.string().optional().describe('Single file path to explore (prefer filepaths for multiple)'),
|
|
638
|
+
filepaths: zod_1.z.array(zod_1.z.string()).optional().describe('PREFERRED: Array of file paths from search_code results'),
|
|
639
|
+
query: zod_1.z.string().optional().describe('Fallback: semantic search to find seed files (prefer using filepaths from search_code)'),
|
|
640
|
+
depth: zod_1.z.number().optional().default(1).describe('How many relationship hops to traverse (1-3, default: 1). Use 1 for focused results, 2+ can return many nodes.'),
|
|
641
|
+
relationship_types: zod_1.z.array(zod_1.z.enum([
|
|
642
|
+
'imports', 'exports', 'calls', 'extends', 'implements', 'contains', 'uses', 'depends_on'
|
|
643
|
+
])).optional().describe('Filter to specific relationship types (default: all). Recommended: use ["imports"] or ["imports", "calls"] to reduce output.'),
|
|
644
|
+
direction: zod_1.z.enum(['in', 'out', 'both']).optional().default('both')
|
|
645
|
+
.describe('Direction of relationships: in (what points to this), out (what this points to), both'),
|
|
646
|
+
max_nodes: zod_1.z.number().optional().default(50).describe('Maximum nodes to return (default: 50). Increase for comprehensive analysis.'),
|
|
647
|
+
project: zod_1.z.string().optional().describe('Project name or path'),
|
|
648
|
+
},
|
|
649
|
+
}, async ({ filepath, filepaths, query, depth = 1, relationship_types, direction = 'both', max_nodes = 50, project }) => {
|
|
650
|
+
try {
|
|
651
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
652
|
+
const projectStore = storageManager.getProjectStore();
|
|
653
|
+
const graphStore = storageManager.getGraphStore();
|
|
654
|
+
// Resolve project
|
|
655
|
+
let projectId;
|
|
656
|
+
let projectPath;
|
|
657
|
+
if (project) {
|
|
658
|
+
const projects = await projectStore.list();
|
|
659
|
+
const found = projects.find(p => p.name === project ||
|
|
660
|
+
p.path === project ||
|
|
661
|
+
path.basename(p.path) === project);
|
|
662
|
+
if (found) {
|
|
663
|
+
projectId = found.id;
|
|
664
|
+
projectPath = found.path;
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
projectPath = process.cwd();
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
projectPath = process.cwd();
|
|
672
|
+
const projects = await projectStore.list();
|
|
673
|
+
const found = projects.find(p => p.path === projectPath ||
|
|
674
|
+
path.basename(p.path) === path.basename(projectPath));
|
|
675
|
+
if (found) {
|
|
676
|
+
projectId = found.id;
|
|
677
|
+
projectPath = found.path;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
if (!projectId) {
|
|
681
|
+
return {
|
|
682
|
+
content: [{
|
|
683
|
+
type: 'text',
|
|
684
|
+
text: 'Project not indexed. Use index_project first.',
|
|
685
|
+
}],
|
|
686
|
+
isError: true,
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
// Determine seed file paths
|
|
690
|
+
let seedFilePaths = [];
|
|
691
|
+
if (query) {
|
|
692
|
+
// Use semantic search to find seed files
|
|
693
|
+
const searchResults = await this.searchOrchestrator.performSemanticSearch(query, projectPath);
|
|
694
|
+
seedFilePaths = searchResults.slice(0, 5).map(r => r.file.replace(/\\/g, '/'));
|
|
695
|
+
}
|
|
696
|
+
else if (filepaths && filepaths.length > 0) {
|
|
697
|
+
seedFilePaths = filepaths.map(fp => fp.replace(/\\/g, '/'));
|
|
698
|
+
}
|
|
699
|
+
else if (filepath) {
|
|
700
|
+
seedFilePaths = [filepath.replace(/\\/g, '/')];
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
return {
|
|
704
|
+
content: [{
|
|
705
|
+
type: 'text',
|
|
706
|
+
text: 'Please provide filepath, filepaths, or query to explore relationships.',
|
|
707
|
+
}],
|
|
708
|
+
isError: true,
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
// Find all nodes for this project and get graph stats
|
|
712
|
+
const allNodes = await graphStore.findNodes(projectId);
|
|
713
|
+
const graphStats = {
|
|
714
|
+
total_nodes: allNodes.length,
|
|
715
|
+
file_nodes: allNodes.filter(n => n.type === 'file').length,
|
|
716
|
+
class_nodes: allNodes.filter(n => n.type === 'class').length,
|
|
717
|
+
function_nodes: allNodes.filter(n => n.type === 'function' || n.type === 'method').length,
|
|
718
|
+
};
|
|
719
|
+
// Find starting nodes using flexible path matching (like CLI's GraphAnalysisService)
|
|
720
|
+
const startNodes = allNodes.filter(n => {
|
|
721
|
+
const normalizedNodePath = n.filePath.replace(/\\/g, '/');
|
|
722
|
+
const nodeRelativePath = n.properties?.relativePath?.replace(/\\/g, '/');
|
|
723
|
+
return seedFilePaths.some(seedPath => {
|
|
724
|
+
const normalizedSeedPath = seedPath.replace(/\\/g, '/');
|
|
725
|
+
return (
|
|
726
|
+
// Exact matches
|
|
727
|
+
normalizedNodePath === normalizedSeedPath ||
|
|
728
|
+
nodeRelativePath === normalizedSeedPath ||
|
|
729
|
+
// Ends with (for relative paths)
|
|
730
|
+
normalizedNodePath.endsWith(normalizedSeedPath) ||
|
|
731
|
+
normalizedNodePath.endsWith('/' + normalizedSeedPath) ||
|
|
732
|
+
// Contains match (for partial paths)
|
|
733
|
+
normalizedNodePath.includes('/' + normalizedSeedPath) ||
|
|
734
|
+
// Name match (for class/function names)
|
|
735
|
+
n.name === path.basename(normalizedSeedPath).replace(/\.[^.]+$/, ''));
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
if (startNodes.length === 0) {
|
|
739
|
+
// List available files in graph with relative paths
|
|
740
|
+
const fileNodes = allNodes.filter(n => n.type === 'file').slice(0, 15);
|
|
741
|
+
const availableFiles = fileNodes.map(n => {
|
|
742
|
+
const relPath = n.properties?.relativePath;
|
|
743
|
+
return relPath || path.relative(projectPath, n.filePath);
|
|
744
|
+
});
|
|
745
|
+
return {
|
|
746
|
+
content: [{
|
|
747
|
+
type: 'text',
|
|
748
|
+
text: JSON.stringify({
|
|
749
|
+
error: `No graph nodes found for: ${seedFilePaths.join(', ')}`,
|
|
750
|
+
suggestion: query
|
|
751
|
+
? 'The semantic search found files but they are not in the knowledge graph. Try re-indexing.'
|
|
752
|
+
: 'The file(s) may not be indexed in the knowledge graph.',
|
|
753
|
+
available_files: availableFiles,
|
|
754
|
+
tip: 'Use relative paths like "src/mcp/mcp-server.ts" or a query like "authentication middleware"',
|
|
755
|
+
}, null, 2),
|
|
756
|
+
}],
|
|
757
|
+
isError: true,
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
// Traverse relationships from all start nodes (Seed + Expand)
|
|
761
|
+
const visitedNodes = new Map();
|
|
762
|
+
const collectedEdges = [];
|
|
763
|
+
let truncated = false;
|
|
764
|
+
const traverse = async (nodeId, currentDepth) => {
|
|
765
|
+
// Stop if we've reached max_nodes limit
|
|
766
|
+
if (visitedNodes.size >= max_nodes) {
|
|
767
|
+
truncated = true;
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
if (currentDepth > Math.min(depth, 3) || visitedNodes.has(nodeId))
|
|
771
|
+
return;
|
|
772
|
+
const node = await graphStore.getNode(nodeId);
|
|
773
|
+
if (!node)
|
|
774
|
+
return;
|
|
775
|
+
const relPath = node.properties?.relativePath;
|
|
776
|
+
visitedNodes.set(nodeId, {
|
|
777
|
+
id: node.id,
|
|
778
|
+
type: node.type,
|
|
779
|
+
name: node.name,
|
|
780
|
+
file: relPath || path.relative(projectPath, node.filePath),
|
|
781
|
+
});
|
|
782
|
+
// Get edges based on direction
|
|
783
|
+
const edges = await graphStore.getEdges(nodeId, direction);
|
|
784
|
+
for (const edge of edges) {
|
|
785
|
+
// Stop if we've reached max_nodes limit
|
|
786
|
+
if (visitedNodes.size >= max_nodes) {
|
|
787
|
+
truncated = true;
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
// Filter by relationship type if specified
|
|
791
|
+
if (relationship_types && relationship_types.length > 0) {
|
|
792
|
+
if (!relationship_types.includes(edge.type))
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
collectedEdges.push({
|
|
796
|
+
from: edge.source,
|
|
797
|
+
to: edge.target,
|
|
798
|
+
type: edge.type,
|
|
799
|
+
});
|
|
800
|
+
// Continue traversal
|
|
801
|
+
const nextNodeId = edge.source === nodeId ? edge.target : edge.source;
|
|
802
|
+
await traverse(nextNodeId, currentDepth + 1);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
// Traverse from ALL start nodes (multiple seeds)
|
|
806
|
+
for (const startNode of startNodes) {
|
|
807
|
+
if (visitedNodes.size >= max_nodes) {
|
|
808
|
+
truncated = true;
|
|
809
|
+
break;
|
|
810
|
+
}
|
|
811
|
+
await traverse(startNode.id, 1);
|
|
812
|
+
}
|
|
813
|
+
// Format output
|
|
814
|
+
const nodes = Array.from(visitedNodes.values());
|
|
815
|
+
const uniqueEdges = collectedEdges.filter((e, i, arr) => arr.findIndex(x => x.from === e.from && x.to === e.to && x.type === e.type) === i);
|
|
816
|
+
// Create a summary
|
|
817
|
+
const summary = {
|
|
818
|
+
graph_stats: graphStats,
|
|
819
|
+
seed_files: startNodes.map(n => ({
|
|
820
|
+
name: n.name,
|
|
821
|
+
type: n.type,
|
|
822
|
+
file: n.properties?.relativePath || path.relative(projectPath, n.filePath),
|
|
823
|
+
})),
|
|
824
|
+
traversal: {
|
|
825
|
+
depth_requested: depth,
|
|
826
|
+
direction,
|
|
827
|
+
relationship_filters: relationship_types || 'all',
|
|
828
|
+
seed_method: query ? 'semantic_search' : (filepaths ? 'multiple_files' : 'single_file'),
|
|
829
|
+
max_nodes,
|
|
830
|
+
},
|
|
831
|
+
results: {
|
|
832
|
+
seed_nodes: startNodes.length,
|
|
833
|
+
nodes_found: nodes.length,
|
|
834
|
+
relationships_found: uniqueEdges.length,
|
|
835
|
+
truncated,
|
|
836
|
+
},
|
|
837
|
+
nodes: nodes.map(n => ({
|
|
838
|
+
name: n.name,
|
|
839
|
+
type: n.type,
|
|
840
|
+
file: n.file,
|
|
841
|
+
})),
|
|
842
|
+
relationships: uniqueEdges.map(e => {
|
|
843
|
+
const fromNode = visitedNodes.get(e.from);
|
|
844
|
+
const toNode = visitedNodes.get(e.to);
|
|
845
|
+
return {
|
|
846
|
+
type: e.type,
|
|
847
|
+
from: fromNode?.name || e.from,
|
|
848
|
+
to: toNode?.name || e.to,
|
|
849
|
+
};
|
|
850
|
+
}),
|
|
851
|
+
};
|
|
852
|
+
// Add truncation warning and recommendations if results were limited
|
|
853
|
+
if (truncated) {
|
|
854
|
+
summary.truncated_warning = {
|
|
855
|
+
message: `Results truncated at ${max_nodes} nodes.`,
|
|
856
|
+
recommendations: [
|
|
857
|
+
relationship_types ? null : 'Add relationship_types filter (e.g., ["imports"])',
|
|
858
|
+
depth > 1 ? 'Reduce depth to 1' : null,
|
|
859
|
+
`Increase max_nodes (current: ${max_nodes})`,
|
|
860
|
+
].filter(Boolean),
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
return {
|
|
864
|
+
content: [{
|
|
865
|
+
type: 'text',
|
|
866
|
+
text: JSON.stringify(summary, null, 2),
|
|
867
|
+
}],
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
catch (error) {
|
|
871
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
872
|
+
return {
|
|
873
|
+
content: [{
|
|
874
|
+
type: 'text',
|
|
875
|
+
text: `Failed to get code relationships: ${message}`,
|
|
876
|
+
}],
|
|
877
|
+
isError: true,
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Tool 4: List indexed projects
|
|
884
|
+
*/
|
|
885
|
+
registerListProjectsTool() {
|
|
886
|
+
this.server.registerTool('list_projects', {
|
|
887
|
+
description: 'List all indexed projects with their metadata. ' +
|
|
888
|
+
'Returns project names, paths, indexed file counts, and last index timestamps. ' +
|
|
889
|
+
'Use to discover available projects before running search_code or get_code_relationships. ' +
|
|
890
|
+
'Example: list_projects() shows all projects ready for semantic search.',
|
|
891
|
+
}, async () => {
|
|
892
|
+
try {
|
|
893
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
894
|
+
const projectStore = storageManager.getProjectStore();
|
|
895
|
+
const vectorStore = storageManager.getVectorStore();
|
|
896
|
+
const projects = await projectStore.list();
|
|
897
|
+
if (projects.length === 0) {
|
|
898
|
+
return {
|
|
899
|
+
content: [{
|
|
900
|
+
type: 'text',
|
|
901
|
+
text: 'No projects indexed. Use index_project to add a project.',
|
|
902
|
+
}],
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
// Get file and chunk counts for each project
|
|
906
|
+
const projectsWithCounts = await Promise.all(projects.map(async (p) => {
|
|
907
|
+
const fileCount = await vectorStore.countFiles(p.id);
|
|
908
|
+
const chunkCount = await vectorStore.count(p.id);
|
|
909
|
+
return {
|
|
910
|
+
name: p.name,
|
|
911
|
+
path: p.path,
|
|
912
|
+
files: fileCount,
|
|
913
|
+
chunks: chunkCount,
|
|
914
|
+
last_indexed: p.updatedAt.toISOString(),
|
|
915
|
+
};
|
|
916
|
+
}));
|
|
917
|
+
return {
|
|
918
|
+
content: [{
|
|
919
|
+
type: 'text',
|
|
920
|
+
text: JSON.stringify({
|
|
921
|
+
storage_mode: storageManager.getMode(),
|
|
922
|
+
total_projects: projects.length,
|
|
923
|
+
projects: projectsWithCounts,
|
|
924
|
+
}, null, 2),
|
|
925
|
+
}],
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
catch (error) {
|
|
929
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
930
|
+
return {
|
|
931
|
+
content: [{
|
|
932
|
+
type: 'text',
|
|
933
|
+
text: `Failed to list projects: ${message}`,
|
|
934
|
+
}],
|
|
935
|
+
isError: true,
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Tool 5: Index a project (with proper embeddings and knowledge graph)
|
|
942
|
+
*/
|
|
943
|
+
registerIndexProjectTool() {
|
|
944
|
+
this.server.registerTool('index_project', {
|
|
945
|
+
description: 'Index a project directory for semantic search and knowledge graph. ' +
|
|
946
|
+
'Scans code, documentation, configs, and other text files. Generates vector embeddings and extracts code relationships. ' +
|
|
947
|
+
'Run once per project, then use notify_file_changes for incremental updates. ' +
|
|
948
|
+
'Example: index_project({path: "/home/user/my-app"}) indexes all files in my-app.',
|
|
949
|
+
inputSchema: {
|
|
950
|
+
path: zod_1.z.string().describe('Absolute path to the project directory'),
|
|
951
|
+
name: zod_1.z.string().optional().describe('Project name (defaults to directory name)'),
|
|
952
|
+
},
|
|
953
|
+
}, async (args) => {
|
|
954
|
+
try {
|
|
955
|
+
const { path: projectPath, name } = args;
|
|
956
|
+
// Validate path
|
|
957
|
+
const absolutePath = path.isAbsolute(projectPath)
|
|
958
|
+
? projectPath
|
|
959
|
+
: path.resolve(projectPath);
|
|
960
|
+
if (!fs.existsSync(absolutePath)) {
|
|
961
|
+
return {
|
|
962
|
+
content: [{
|
|
963
|
+
type: 'text',
|
|
964
|
+
text: `Directory not found: ${absolutePath}`,
|
|
965
|
+
}],
|
|
966
|
+
isError: true,
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
if (!fs.statSync(absolutePath).isDirectory()) {
|
|
970
|
+
return {
|
|
971
|
+
content: [{
|
|
972
|
+
type: 'text',
|
|
973
|
+
text: `Not a directory: ${absolutePath}`,
|
|
974
|
+
}],
|
|
975
|
+
isError: true,
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
const projectName = name || path.basename(absolutePath);
|
|
979
|
+
// Get storage and create project
|
|
980
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
981
|
+
const projectStore = storageManager.getProjectStore();
|
|
982
|
+
const vectorStore = storageManager.getVectorStore();
|
|
983
|
+
const graphStore = storageManager.getGraphStore();
|
|
984
|
+
// Create or update project
|
|
985
|
+
const project = await projectStore.upsert({
|
|
986
|
+
id: this.generateProjectId(absolutePath),
|
|
987
|
+
name: projectName,
|
|
988
|
+
path: absolutePath,
|
|
989
|
+
metadata: { indexedAt: new Date().toISOString() },
|
|
990
|
+
});
|
|
991
|
+
// Clear existing index data for clean reindex
|
|
992
|
+
await vectorStore.deleteByProject(project.id);
|
|
993
|
+
await graphStore.deleteByProject(project.id);
|
|
994
|
+
// Delete coding standards file (will be regenerated)
|
|
995
|
+
const codingStandardsPath = path.join(absolutePath, '.codeseeker', 'coding-standards.json');
|
|
996
|
+
if (fs.existsSync(codingStandardsPath)) {
|
|
997
|
+
fs.unlinkSync(codingStandardsPath);
|
|
998
|
+
}
|
|
999
|
+
// Use IndexingService for proper indexing with embeddings and graph
|
|
1000
|
+
// Track progress for detailed reporting
|
|
1001
|
+
let lastProgress;
|
|
1002
|
+
const result = await this.indexingService.indexProject(absolutePath, project.id, (progress) => {
|
|
1003
|
+
lastProgress = progress;
|
|
1004
|
+
});
|
|
1005
|
+
// Build response with progress details
|
|
1006
|
+
const response = {
|
|
1007
|
+
success: result.success,
|
|
1008
|
+
project_name: projectName,
|
|
1009
|
+
project_path: absolutePath,
|
|
1010
|
+
files_indexed: result.filesIndexed,
|
|
1011
|
+
chunks_created: result.chunksCreated,
|
|
1012
|
+
graph_nodes: result.nodesCreated,
|
|
1013
|
+
graph_edges: result.edgesCreated,
|
|
1014
|
+
duration_ms: result.durationMs,
|
|
1015
|
+
};
|
|
1016
|
+
// Add scanning summary if available
|
|
1017
|
+
if (lastProgress?.scanningStatus) {
|
|
1018
|
+
response.scanning_summary = {
|
|
1019
|
+
folders_scanned: lastProgress.scanningStatus.foldersScanned,
|
|
1020
|
+
files_found: lastProgress.scanningStatus.filesFound,
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
// Add warnings (file limits, recommendations)
|
|
1024
|
+
if (result.warnings && result.warnings.length > 0) {
|
|
1025
|
+
response.warnings = result.warnings;
|
|
1026
|
+
}
|
|
1027
|
+
// Add errors if any
|
|
1028
|
+
if (result.errors.length > 0) {
|
|
1029
|
+
response.errors = result.errors.slice(0, 5);
|
|
1030
|
+
}
|
|
1031
|
+
return {
|
|
1032
|
+
content: [{
|
|
1033
|
+
type: 'text',
|
|
1034
|
+
text: JSON.stringify(response, null, 2),
|
|
1035
|
+
}],
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
catch (error) {
|
|
1039
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1040
|
+
return {
|
|
1041
|
+
content: [{
|
|
1042
|
+
type: 'text',
|
|
1043
|
+
text: `Failed to index project: ${message}`,
|
|
1044
|
+
}],
|
|
1045
|
+
isError: true,
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Tool 5: Notify file changes for incremental updates
|
|
1052
|
+
*/
|
|
1053
|
+
registerNotifyFileChangesTool() {
|
|
1054
|
+
this.server.registerTool('notify_file_changes', {
|
|
1055
|
+
description: '**KEEP INDEX IN SYNC** - Call this after creating, editing, or deleting files. ' +
|
|
1056
|
+
'IMPORTANT: If search_code returns stale results or grep finds content not in search results, ' +
|
|
1057
|
+
'call this tool immediately to sync. Fast incremental updates (~100-500ms per file). ' +
|
|
1058
|
+
'Use after: Edit/Write tool, file deletions, or when search results seem outdated. ' +
|
|
1059
|
+
'For large changes (git pull, branch switch, many files), use full_reindex: true instead.',
|
|
1060
|
+
inputSchema: {
|
|
1061
|
+
project: zod_1.z.string().optional().describe('Project name or path (optional - auto-detects from indexed projects)'),
|
|
1062
|
+
changes: zod_1.z.array(zod_1.z.object({
|
|
1063
|
+
type: zod_1.z.enum(['created', 'modified', 'deleted']),
|
|
1064
|
+
path: zod_1.z.string().describe('Path to the changed file'),
|
|
1065
|
+
})).optional().describe('Array of file changes (not needed if full_reindex is true)'),
|
|
1066
|
+
full_reindex: zod_1.z.boolean().optional().default(false)
|
|
1067
|
+
.describe('Trigger a complete re-index of the project. Use after git pull, branch switch, or major changes.'),
|
|
1068
|
+
},
|
|
1069
|
+
}, async ({ project, changes, full_reindex = false }) => {
|
|
1070
|
+
try {
|
|
1071
|
+
const startTime = Date.now();
|
|
1072
|
+
// Resolve project
|
|
1073
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
1074
|
+
const projectStore = storageManager.getProjectStore();
|
|
1075
|
+
const vectorStore = storageManager.getVectorStore();
|
|
1076
|
+
const graphStore = storageManager.getGraphStore();
|
|
1077
|
+
const projects = await projectStore.list();
|
|
1078
|
+
// Auto-detect project if not provided
|
|
1079
|
+
let found;
|
|
1080
|
+
if (project) {
|
|
1081
|
+
found = projects.find(p => p.name === project ||
|
|
1082
|
+
p.path === project ||
|
|
1083
|
+
path.basename(p.path) === project ||
|
|
1084
|
+
path.resolve(project) === p.path);
|
|
1085
|
+
}
|
|
1086
|
+
else {
|
|
1087
|
+
// Try to find project from file paths in changes
|
|
1088
|
+
if (changes && changes.length > 0) {
|
|
1089
|
+
const firstPath = changes[0].path;
|
|
1090
|
+
if (path.isAbsolute(firstPath)) {
|
|
1091
|
+
found = projects.find(p => firstPath.startsWith(p.path));
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
// If still not found, use single project if only one exists
|
|
1095
|
+
if (!found && projects.length === 1) {
|
|
1096
|
+
found = projects[0];
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
if (!found) {
|
|
1100
|
+
return {
|
|
1101
|
+
content: [{
|
|
1102
|
+
type: 'text',
|
|
1103
|
+
text: project
|
|
1104
|
+
? `Project not found: ${project}. Use list_projects to see available projects.`
|
|
1105
|
+
: `Could not auto-detect project. Specify project name or use absolute paths in changes. Available: ${projects.map(p => p.name).join(', ')}`,
|
|
1106
|
+
}],
|
|
1107
|
+
isError: true,
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
// Full reindex mode - use IndexingService
|
|
1111
|
+
if (full_reindex) {
|
|
1112
|
+
// Clear existing index for this project
|
|
1113
|
+
await vectorStore.deleteByProject(found.id);
|
|
1114
|
+
await graphStore.deleteByProject(found.id);
|
|
1115
|
+
// Delete coding standards file (will be regenerated)
|
|
1116
|
+
const codingStandardsPath = path.join(found.path, '.codeseeker', 'coding-standards.json');
|
|
1117
|
+
if (fs.existsSync(codingStandardsPath)) {
|
|
1118
|
+
fs.unlinkSync(codingStandardsPath);
|
|
1119
|
+
}
|
|
1120
|
+
// Re-index all files using IndexingService (with proper embeddings and graph)
|
|
1121
|
+
let lastProgress;
|
|
1122
|
+
const result = await this.indexingService.indexProject(found.path, found.id, (progress) => {
|
|
1123
|
+
lastProgress = progress;
|
|
1124
|
+
});
|
|
1125
|
+
// Update project metadata
|
|
1126
|
+
await projectStore.upsert({
|
|
1127
|
+
id: found.id,
|
|
1128
|
+
name: found.name,
|
|
1129
|
+
path: found.path,
|
|
1130
|
+
metadata: {
|
|
1131
|
+
...found.metadata,
|
|
1132
|
+
lastFullReindex: new Date().toISOString(),
|
|
1133
|
+
},
|
|
1134
|
+
});
|
|
1135
|
+
// Build response with all details
|
|
1136
|
+
const response = {
|
|
1137
|
+
success: result.success,
|
|
1138
|
+
mode: 'full_reindex',
|
|
1139
|
+
project: found.name,
|
|
1140
|
+
files_indexed: result.filesIndexed,
|
|
1141
|
+
chunks_created: result.chunksCreated,
|
|
1142
|
+
graph_nodes: result.nodesCreated,
|
|
1143
|
+
graph_edges: result.edgesCreated,
|
|
1144
|
+
duration_ms: result.durationMs,
|
|
1145
|
+
message: `Complete reindex finished. ${result.filesIndexed} files indexed, ${result.chunksCreated} chunks created.`,
|
|
1146
|
+
};
|
|
1147
|
+
// Add scanning summary
|
|
1148
|
+
if (lastProgress?.scanningStatus) {
|
|
1149
|
+
response.scanning_summary = {
|
|
1150
|
+
folders_scanned: lastProgress.scanningStatus.foldersScanned,
|
|
1151
|
+
files_found: lastProgress.scanningStatus.filesFound,
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
// Add warnings
|
|
1155
|
+
if (result.warnings && result.warnings.length > 0) {
|
|
1156
|
+
response.warnings = result.warnings;
|
|
1157
|
+
}
|
|
1158
|
+
// Add errors
|
|
1159
|
+
if (result.errors.length > 0) {
|
|
1160
|
+
response.errors = result.errors.slice(0, 5);
|
|
1161
|
+
}
|
|
1162
|
+
return {
|
|
1163
|
+
content: [{
|
|
1164
|
+
type: 'text',
|
|
1165
|
+
text: JSON.stringify(response, null, 2),
|
|
1166
|
+
}],
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
// Incremental update mode - use IndexingService
|
|
1170
|
+
if (!changes || changes.length === 0) {
|
|
1171
|
+
return {
|
|
1172
|
+
content: [{
|
|
1173
|
+
type: 'text',
|
|
1174
|
+
text: 'No changes provided. Either pass file changes or set full_reindex: true.',
|
|
1175
|
+
}],
|
|
1176
|
+
isError: true,
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
let chunksCreated = 0;
|
|
1180
|
+
let chunksDeleted = 0;
|
|
1181
|
+
let filesProcessed = 0;
|
|
1182
|
+
let filesSkipped = 0;
|
|
1183
|
+
const errors = [];
|
|
1184
|
+
for (const change of changes) {
|
|
1185
|
+
const relativePath = path.isAbsolute(change.path)
|
|
1186
|
+
? path.relative(found.path, change.path)
|
|
1187
|
+
: change.path;
|
|
1188
|
+
try {
|
|
1189
|
+
if (change.type === 'deleted') {
|
|
1190
|
+
// Remove chunks for deleted file using IndexingService
|
|
1191
|
+
const result = await this.indexingService.deleteFile(found.id, relativePath);
|
|
1192
|
+
if (result.success) {
|
|
1193
|
+
chunksDeleted += result.deleted;
|
|
1194
|
+
filesProcessed++;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
else {
|
|
1198
|
+
// created or modified: re-index the file using IndexingService
|
|
1199
|
+
// Uses two-stage change detection: mtime (~0.1ms) then hash (~1-5ms)
|
|
1200
|
+
const result = await this.indexingService.indexSingleFile(found.path, relativePath, found.id);
|
|
1201
|
+
if (result.success) {
|
|
1202
|
+
if (result.skipped) {
|
|
1203
|
+
filesSkipped++;
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
chunksCreated += result.chunksCreated;
|
|
1207
|
+
filesProcessed++;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
catch (error) {
|
|
1213
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
1214
|
+
errors.push(`${change.path}: ${msg}`);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
// Update coding standards if pattern-related files changed
|
|
1218
|
+
try {
|
|
1219
|
+
const changedPaths = changes.map(c => c.path);
|
|
1220
|
+
const generator = new coding_standards_generator_1.CodingStandardsGenerator(vectorStore);
|
|
1221
|
+
await generator.updateStandards(found.id, found.path, changedPaths);
|
|
1222
|
+
}
|
|
1223
|
+
catch (error) {
|
|
1224
|
+
// Don't fail the whole operation if standards update fails
|
|
1225
|
+
console.error('Failed to update coding standards:', error);
|
|
1226
|
+
}
|
|
1227
|
+
const duration = Date.now() - startTime;
|
|
1228
|
+
return {
|
|
1229
|
+
content: [{
|
|
1230
|
+
type: 'text',
|
|
1231
|
+
text: JSON.stringify({
|
|
1232
|
+
success: errors.length === 0,
|
|
1233
|
+
mode: 'incremental',
|
|
1234
|
+
project: found.name,
|
|
1235
|
+
changes_processed: changes.length,
|
|
1236
|
+
files_reindexed: filesProcessed,
|
|
1237
|
+
files_skipped: filesSkipped > 0 ? filesSkipped : undefined,
|
|
1238
|
+
chunks_created: chunksCreated,
|
|
1239
|
+
chunks_deleted: chunksDeleted,
|
|
1240
|
+
duration_ms: duration,
|
|
1241
|
+
note: filesSkipped > 0 ? `${filesSkipped} file(s) unchanged (skipped via mtime/hash check)` : undefined,
|
|
1242
|
+
errors: errors.length > 0 ? errors.slice(0, 5) : undefined,
|
|
1243
|
+
}, null, 2),
|
|
1244
|
+
}],
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
catch (error) {
|
|
1248
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1249
|
+
return {
|
|
1250
|
+
content: [{
|
|
1251
|
+
type: 'text',
|
|
1252
|
+
text: `Failed to process file changes: ${message}`,
|
|
1253
|
+
}],
|
|
1254
|
+
isError: true,
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
// get_coding_standards - Get auto-detected coding standards
|
|
1259
|
+
this.server.registerTool('get_coding_standards', {
|
|
1260
|
+
description: 'Get auto-detected coding patterns and standards for a project. ' +
|
|
1261
|
+
'Returns validation patterns, error handling patterns, logging patterns, and testing patterns ' +
|
|
1262
|
+
'discovered from the codebase. Use this to write code that follows project conventions. ' +
|
|
1263
|
+
'Example: get_coding_standards({project: "my-app", category: "validation"})',
|
|
1264
|
+
inputSchema: {
|
|
1265
|
+
project: zod_1.z.string().describe('Project name or path'),
|
|
1266
|
+
category: zod_1.z.enum(['validation', 'error-handling', 'logging', 'testing', 'all']).optional().default('all')
|
|
1267
|
+
.describe('Category of standards to retrieve (default: all)'),
|
|
1268
|
+
},
|
|
1269
|
+
}, async ({ project, category = 'all' }) => {
|
|
1270
|
+
try {
|
|
1271
|
+
// Resolve project
|
|
1272
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
1273
|
+
const projectStore = storageManager.getProjectStore();
|
|
1274
|
+
const vectorStore = storageManager.getVectorStore();
|
|
1275
|
+
const projects = await projectStore.list();
|
|
1276
|
+
const found = projects.find(p => p.name === project ||
|
|
1277
|
+
p.path === project ||
|
|
1278
|
+
path.basename(p.path) === project);
|
|
1279
|
+
if (!found) {
|
|
1280
|
+
return {
|
|
1281
|
+
content: [{
|
|
1282
|
+
type: 'text',
|
|
1283
|
+
text: `Project not found: ${project}. Use list_projects to see available projects.`,
|
|
1284
|
+
}],
|
|
1285
|
+
isError: true,
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
// Try to load standards file
|
|
1289
|
+
const standardsPath = path.join(found.path, '.codeseeker', 'coding-standards.json');
|
|
1290
|
+
let standardsContent;
|
|
1291
|
+
try {
|
|
1292
|
+
standardsContent = fs.readFileSync(standardsPath, 'utf-8');
|
|
1293
|
+
}
|
|
1294
|
+
catch (error) {
|
|
1295
|
+
// Standards file doesn't exist - generate it now
|
|
1296
|
+
const generator = new coding_standards_generator_1.CodingStandardsGenerator(vectorStore);
|
|
1297
|
+
await generator.generateStandards(found.id, found.path);
|
|
1298
|
+
// Try reading again
|
|
1299
|
+
try {
|
|
1300
|
+
standardsContent = fs.readFileSync(standardsPath, 'utf-8');
|
|
1301
|
+
}
|
|
1302
|
+
catch {
|
|
1303
|
+
return {
|
|
1304
|
+
content: [{
|
|
1305
|
+
type: 'text',
|
|
1306
|
+
text: 'No coding standards detected yet. The project may need to be indexed first using index_project.',
|
|
1307
|
+
}],
|
|
1308
|
+
isError: true,
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
const standards = JSON.parse(standardsContent);
|
|
1313
|
+
// Filter by category if requested
|
|
1314
|
+
let result = standards;
|
|
1315
|
+
if (category !== 'all') {
|
|
1316
|
+
result = {
|
|
1317
|
+
...standards,
|
|
1318
|
+
standards: {
|
|
1319
|
+
[category]: standards.standards[category] || {}
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
return {
|
|
1324
|
+
content: [{
|
|
1325
|
+
type: 'text',
|
|
1326
|
+
text: JSON.stringify(result, null, 2),
|
|
1327
|
+
}],
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
catch (error) {
|
|
1331
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1332
|
+
return {
|
|
1333
|
+
content: [{
|
|
1334
|
+
type: 'text',
|
|
1335
|
+
text: `Failed to get coding standards: ${message}`,
|
|
1336
|
+
}],
|
|
1337
|
+
isError: true,
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Tool 7: Install language support (Tree-sitter parsers)
|
|
1344
|
+
*/
|
|
1345
|
+
registerInstallLanguageSupportTool() {
|
|
1346
|
+
this.server.registerTool('install_language_support', {
|
|
1347
|
+
description: 'Analyze project languages and install Tree-sitter parsers for better code understanding. ' +
|
|
1348
|
+
'Detects which programming languages are used in a project and installs enhanced parsers. ' +
|
|
1349
|
+
'Enhanced parsers provide better AST extraction for imports, classes, functions, and relationships. ' +
|
|
1350
|
+
'Example: install_language_support({project: "/path/to/project"}) to auto-detect and install. ' +
|
|
1351
|
+
'Example: install_language_support({languages: ["python", "java"]}) to install specific parsers.',
|
|
1352
|
+
inputSchema: {
|
|
1353
|
+
project: zod_1.z.string().optional().describe('Project path to analyze for languages (auto-detects needed parsers)'),
|
|
1354
|
+
languages: zod_1.z.array(zod_1.z.string()).optional().describe('Specific languages to install parsers for (e.g., ["python", "java", "csharp"])'),
|
|
1355
|
+
list_available: zod_1.z.boolean().optional().default(false).describe('List all available language parsers and their status'),
|
|
1356
|
+
},
|
|
1357
|
+
}, async ({ project, languages, list_available = false }) => {
|
|
1358
|
+
try {
|
|
1359
|
+
// List mode - show available parsers
|
|
1360
|
+
if (list_available) {
|
|
1361
|
+
const parsers = await this.languageSupportService.checkInstalledParsers();
|
|
1362
|
+
const installed = parsers.filter(p => p.installed);
|
|
1363
|
+
const available = parsers.filter(p => !p.installed);
|
|
1364
|
+
return {
|
|
1365
|
+
content: [{
|
|
1366
|
+
type: 'text',
|
|
1367
|
+
text: JSON.stringify({
|
|
1368
|
+
installed_parsers: installed.map(p => ({
|
|
1369
|
+
language: p.language,
|
|
1370
|
+
extensions: p.extensions,
|
|
1371
|
+
quality: p.quality,
|
|
1372
|
+
description: p.description,
|
|
1373
|
+
})),
|
|
1374
|
+
available_parsers: available.map(p => ({
|
|
1375
|
+
language: p.language,
|
|
1376
|
+
extensions: p.extensions,
|
|
1377
|
+
npm_package: p.npmPackage,
|
|
1378
|
+
quality: p.quality,
|
|
1379
|
+
description: p.description,
|
|
1380
|
+
})),
|
|
1381
|
+
install_command: available.length > 0
|
|
1382
|
+
? `Use install_language_support({languages: [${available.slice(0, 3).map(p => `"${p.language.toLowerCase()}"`).join(', ')}]})`
|
|
1383
|
+
: 'All parsers are already installed!',
|
|
1384
|
+
}, null, 2),
|
|
1385
|
+
}],
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
// Install specific languages
|
|
1389
|
+
if (languages && languages.length > 0) {
|
|
1390
|
+
const result = await this.languageSupportService.installLanguageParsers(languages);
|
|
1391
|
+
return {
|
|
1392
|
+
content: [{
|
|
1393
|
+
type: 'text',
|
|
1394
|
+
text: JSON.stringify({
|
|
1395
|
+
success: result.success,
|
|
1396
|
+
installed: result.installed,
|
|
1397
|
+
failed: result.failed.length > 0 ? result.failed : undefined,
|
|
1398
|
+
message: result.message,
|
|
1399
|
+
next_step: result.success
|
|
1400
|
+
? 'Reindex your project to use the new parsers: notify_file_changes({project: "...", full_reindex: true})'
|
|
1401
|
+
: 'Check the errors above and try again.',
|
|
1402
|
+
}, null, 2),
|
|
1403
|
+
}],
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
// Analyze project and suggest parsers
|
|
1407
|
+
if (project) {
|
|
1408
|
+
const projectPath = path.isAbsolute(project)
|
|
1409
|
+
? project
|
|
1410
|
+
: path.resolve(project);
|
|
1411
|
+
if (!fs.existsSync(projectPath)) {
|
|
1412
|
+
return {
|
|
1413
|
+
content: [{
|
|
1414
|
+
type: 'text',
|
|
1415
|
+
text: `Directory not found: ${projectPath}`,
|
|
1416
|
+
}],
|
|
1417
|
+
isError: true,
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
const analysis = await this.languageSupportService.analyzeProjectLanguages(projectPath);
|
|
1421
|
+
// If there are missing parsers, offer to install them
|
|
1422
|
+
const missingLanguages = analysis.missingParsers.map(p => p.language.toLowerCase());
|
|
1423
|
+
return {
|
|
1424
|
+
content: [{
|
|
1425
|
+
type: 'text',
|
|
1426
|
+
text: JSON.stringify({
|
|
1427
|
+
project: projectPath,
|
|
1428
|
+
detected_languages: analysis.detectedLanguages,
|
|
1429
|
+
installed_parsers: analysis.installedParsers,
|
|
1430
|
+
missing_parsers: analysis.missingParsers.map(p => ({
|
|
1431
|
+
language: p.language,
|
|
1432
|
+
npm_package: p.npmPackage,
|
|
1433
|
+
quality: p.quality,
|
|
1434
|
+
description: p.description,
|
|
1435
|
+
})),
|
|
1436
|
+
recommendations: analysis.recommendations,
|
|
1437
|
+
install_command: missingLanguages.length > 0
|
|
1438
|
+
? `Use install_language_support({languages: [${missingLanguages.map(l => `"${l}"`).join(', ')}]}) to install enhanced parsers`
|
|
1439
|
+
: 'All detected languages have parsers installed!',
|
|
1440
|
+
}, null, 2),
|
|
1441
|
+
}],
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
// No arguments - show usage
|
|
1445
|
+
return {
|
|
1446
|
+
content: [{
|
|
1447
|
+
type: 'text',
|
|
1448
|
+
text: JSON.stringify({
|
|
1449
|
+
usage: {
|
|
1450
|
+
analyze_project: 'install_language_support({project: "/path/to/project"}) - Detect languages and suggest parsers',
|
|
1451
|
+
install_specific: 'install_language_support({languages: ["python", "java"]}) - Install parsers for specific languages',
|
|
1452
|
+
list_available: 'install_language_support({list_available: true}) - Show all available parsers',
|
|
1453
|
+
},
|
|
1454
|
+
supported_languages: [
|
|
1455
|
+
'TypeScript (bundled)', 'JavaScript (bundled)',
|
|
1456
|
+
'Python', 'Java', 'C#', 'Go', 'Rust',
|
|
1457
|
+
'C', 'C++', 'Ruby', 'PHP', 'Swift', 'Kotlin'
|
|
1458
|
+
],
|
|
1459
|
+
}, null, 2),
|
|
1460
|
+
}],
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
catch (error) {
|
|
1464
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1465
|
+
return {
|
|
1466
|
+
content: [{
|
|
1467
|
+
type: 'text',
|
|
1468
|
+
text: `Failed to manage language support: ${message}`,
|
|
1469
|
+
}],
|
|
1470
|
+
isError: true,
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* Tool 8: Manage index exclusions/inclusions dynamically
|
|
1477
|
+
* Allows Claude to exclude files that shouldn't be indexed (like Unity's Library folder)
|
|
1478
|
+
* and include files that were wrongly excluded
|
|
1479
|
+
*/
|
|
1480
|
+
registerManageIndexTool() {
|
|
1481
|
+
this.server.registerTool('manage_index', {
|
|
1482
|
+
description: 'Dynamically manage which files are included or excluded from the index. ' +
|
|
1483
|
+
'Use this to exclude files that shouldn\'t be searched (e.g., Library/, build outputs, generated files) ' +
|
|
1484
|
+
'or include files that were incorrectly excluded. Exclusions persist in .codeseeker/exclusions.json. ' +
|
|
1485
|
+
'Example: manage_index({action: "exclude", project: "my-app", paths: ["Library/**", "Temp/**"]}) ' +
|
|
1486
|
+
'to exclude Unity folders. Changes take effect immediately - excluded files are removed from the index.',
|
|
1487
|
+
inputSchema: {
|
|
1488
|
+
action: zod_1.z.enum(['exclude', 'include', 'list']).describe('Action: "exclude" adds paths to exclusion list and removes from index, ' +
|
|
1489
|
+
'"include" removes paths from exclusion list (they will be indexed on next reindex), ' +
|
|
1490
|
+
'"list" shows current exclusions'),
|
|
1491
|
+
project: zod_1.z.string().describe('Project name or path'),
|
|
1492
|
+
paths: zod_1.z.array(zod_1.z.string()).optional().describe('File paths or glob patterns to exclude/include (e.g., ["Library/**", "Temp/**", "*.generated.cs"]). ' +
|
|
1493
|
+
'Required for exclude/include actions.'),
|
|
1494
|
+
reason: zod_1.z.string().optional().describe('Optional reason for the exclusion (for documentation)'),
|
|
1495
|
+
},
|
|
1496
|
+
}, async ({ action, project, paths, reason }) => {
|
|
1497
|
+
try {
|
|
1498
|
+
// Resolve project
|
|
1499
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
1500
|
+
const projectStore = storageManager.getProjectStore();
|
|
1501
|
+
const vectorStore = storageManager.getVectorStore();
|
|
1502
|
+
const graphStore = storageManager.getGraphStore();
|
|
1503
|
+
const projects = await projectStore.list();
|
|
1504
|
+
const found = projects.find(p => p.name === project ||
|
|
1505
|
+
p.path === project ||
|
|
1506
|
+
path.basename(p.path) === project);
|
|
1507
|
+
if (!found) {
|
|
1508
|
+
return {
|
|
1509
|
+
content: [{
|
|
1510
|
+
type: 'text',
|
|
1511
|
+
text: `Project not found: ${project}. Use list_projects to see available projects.`,
|
|
1512
|
+
}],
|
|
1513
|
+
isError: true,
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
// Load or create exclusions file
|
|
1517
|
+
const exclusionsPath = path.join(found.path, '.codeseeker', 'exclusions.json');
|
|
1518
|
+
let exclusions = {
|
|
1519
|
+
patterns: [],
|
|
1520
|
+
lastModified: new Date().toISOString()
|
|
1521
|
+
};
|
|
1522
|
+
// Ensure .codeseeker directory exists
|
|
1523
|
+
const codeseekerDir = path.join(found.path, '.codeseeker');
|
|
1524
|
+
if (!fs.existsSync(codeseekerDir)) {
|
|
1525
|
+
fs.mkdirSync(codeseekerDir, { recursive: true });
|
|
1526
|
+
}
|
|
1527
|
+
// Load existing exclusions
|
|
1528
|
+
if (fs.existsSync(exclusionsPath)) {
|
|
1529
|
+
try {
|
|
1530
|
+
exclusions = JSON.parse(fs.readFileSync(exclusionsPath, 'utf-8'));
|
|
1531
|
+
}
|
|
1532
|
+
catch {
|
|
1533
|
+
// Invalid JSON, start fresh
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
// Handle list action
|
|
1537
|
+
if (action === 'list') {
|
|
1538
|
+
return {
|
|
1539
|
+
content: [{
|
|
1540
|
+
type: 'text',
|
|
1541
|
+
text: JSON.stringify({
|
|
1542
|
+
project: found.name,
|
|
1543
|
+
project_path: found.path,
|
|
1544
|
+
exclusions_file: exclusionsPath,
|
|
1545
|
+
total_exclusions: exclusions.patterns.length,
|
|
1546
|
+
patterns: exclusions.patterns,
|
|
1547
|
+
last_modified: exclusions.lastModified,
|
|
1548
|
+
usage: {
|
|
1549
|
+
exclude: 'manage_index({action: "exclude", project: "...", paths: ["pattern/**"]})',
|
|
1550
|
+
include: 'manage_index({action: "include", project: "...", paths: ["pattern/**"]})',
|
|
1551
|
+
}
|
|
1552
|
+
}, null, 2),
|
|
1553
|
+
}],
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
// Validate paths for exclude/include
|
|
1557
|
+
if (!paths || paths.length === 0) {
|
|
1558
|
+
return {
|
|
1559
|
+
content: [{
|
|
1560
|
+
type: 'text',
|
|
1561
|
+
text: 'No paths provided. Please specify paths or patterns to exclude/include.',
|
|
1562
|
+
}],
|
|
1563
|
+
isError: true,
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
// Handle exclude action
|
|
1567
|
+
if (action === 'exclude') {
|
|
1568
|
+
const addedPatterns = [];
|
|
1569
|
+
const alreadyExcluded = [];
|
|
1570
|
+
let filesRemoved = 0;
|
|
1571
|
+
for (const pattern of paths) {
|
|
1572
|
+
// Normalize pattern (use forward slashes)
|
|
1573
|
+
const normalizedPattern = pattern.replace(/\\/g, '/');
|
|
1574
|
+
// Check if already excluded
|
|
1575
|
+
if (exclusions.patterns.some(p => p.pattern === normalizedPattern)) {
|
|
1576
|
+
alreadyExcluded.push(normalizedPattern);
|
|
1577
|
+
continue;
|
|
1578
|
+
}
|
|
1579
|
+
// Add to exclusions
|
|
1580
|
+
exclusions.patterns.push({
|
|
1581
|
+
pattern: normalizedPattern,
|
|
1582
|
+
reason: reason,
|
|
1583
|
+
addedAt: new Date().toISOString()
|
|
1584
|
+
});
|
|
1585
|
+
addedPatterns.push(normalizedPattern);
|
|
1586
|
+
// Remove matching files from the vector store and graph
|
|
1587
|
+
// Search for files matching this pattern
|
|
1588
|
+
const results = await vectorStore.searchByText(normalizedPattern, found.id, 1000);
|
|
1589
|
+
for (const result of results) {
|
|
1590
|
+
const filePath = result.document.filePath.replace(/\\/g, '/');
|
|
1591
|
+
// Check if file matches the exclusion pattern
|
|
1592
|
+
if (this.matchesExclusionPattern(filePath, normalizedPattern)) {
|
|
1593
|
+
// Delete from vector store
|
|
1594
|
+
await vectorStore.delete(result.document.id);
|
|
1595
|
+
filesRemoved++;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
// Save exclusions
|
|
1600
|
+
exclusions.lastModified = new Date().toISOString();
|
|
1601
|
+
fs.writeFileSync(exclusionsPath, JSON.stringify(exclusions, null, 2));
|
|
1602
|
+
// Flush to persist deletions
|
|
1603
|
+
await vectorStore.flush();
|
|
1604
|
+
return {
|
|
1605
|
+
content: [{
|
|
1606
|
+
type: 'text',
|
|
1607
|
+
text: JSON.stringify({
|
|
1608
|
+
success: true,
|
|
1609
|
+
action: 'exclude',
|
|
1610
|
+
project: found.name,
|
|
1611
|
+
patterns_added: addedPatterns,
|
|
1612
|
+
already_excluded: alreadyExcluded.length > 0 ? alreadyExcluded : undefined,
|
|
1613
|
+
files_removed_from_index: filesRemoved,
|
|
1614
|
+
total_exclusions: exclusions.patterns.length,
|
|
1615
|
+
message: addedPatterns.length > 0
|
|
1616
|
+
? `Added ${addedPatterns.length} exclusion pattern(s). ${filesRemoved} file chunk(s) removed from index.`
|
|
1617
|
+
: 'No new patterns added (all were already excluded).',
|
|
1618
|
+
note: 'Excluded files will not appear in search results. Use action: "include" to re-enable indexing.'
|
|
1619
|
+
}, null, 2),
|
|
1620
|
+
}],
|
|
1621
|
+
};
|
|
1622
|
+
}
|
|
1623
|
+
// Handle include action (remove from exclusions)
|
|
1624
|
+
if (action === 'include') {
|
|
1625
|
+
const removedPatterns = [];
|
|
1626
|
+
const notFound = [];
|
|
1627
|
+
for (const pattern of paths) {
|
|
1628
|
+
const normalizedPattern = pattern.replace(/\\/g, '/');
|
|
1629
|
+
const index = exclusions.patterns.findIndex(p => p.pattern === normalizedPattern);
|
|
1630
|
+
if (index >= 0) {
|
|
1631
|
+
exclusions.patterns.splice(index, 1);
|
|
1632
|
+
removedPatterns.push(normalizedPattern);
|
|
1633
|
+
}
|
|
1634
|
+
else {
|
|
1635
|
+
notFound.push(normalizedPattern);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
// Save exclusions
|
|
1639
|
+
exclusions.lastModified = new Date().toISOString();
|
|
1640
|
+
fs.writeFileSync(exclusionsPath, JSON.stringify(exclusions, null, 2));
|
|
1641
|
+
return {
|
|
1642
|
+
content: [{
|
|
1643
|
+
type: 'text',
|
|
1644
|
+
text: JSON.stringify({
|
|
1645
|
+
success: true,
|
|
1646
|
+
action: 'include',
|
|
1647
|
+
project: found.name,
|
|
1648
|
+
patterns_removed: removedPatterns,
|
|
1649
|
+
not_found: notFound.length > 0 ? notFound : undefined,
|
|
1650
|
+
total_exclusions: exclusions.patterns.length,
|
|
1651
|
+
message: removedPatterns.length > 0
|
|
1652
|
+
? `Removed ${removedPatterns.length} exclusion pattern(s). ` +
|
|
1653
|
+
`Files matching these patterns will be indexed on next reindex.`
|
|
1654
|
+
: 'No patterns were removed (none matched).',
|
|
1655
|
+
next_step: removedPatterns.length > 0
|
|
1656
|
+
? 'Run notify_file_changes({project: "...", full_reindex: true}) to index the previously excluded files.'
|
|
1657
|
+
: undefined
|
|
1658
|
+
}, null, 2),
|
|
1659
|
+
}],
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
// Should not reach here
|
|
1663
|
+
return {
|
|
1664
|
+
content: [{
|
|
1665
|
+
type: 'text',
|
|
1666
|
+
text: `Unknown action: ${action}`,
|
|
1667
|
+
}],
|
|
1668
|
+
isError: true,
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
catch (error) {
|
|
1672
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1673
|
+
return {
|
|
1674
|
+
content: [{
|
|
1675
|
+
type: 'text',
|
|
1676
|
+
text: `Failed to manage index: ${message}`,
|
|
1677
|
+
}],
|
|
1678
|
+
isError: true,
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Check if a file path matches an exclusion pattern
|
|
1685
|
+
* Supports glob-like patterns: ** for any path, * for any segment
|
|
1686
|
+
*/
|
|
1687
|
+
matchesExclusionPattern(filePath, pattern) {
|
|
1688
|
+
// Normalize paths
|
|
1689
|
+
const normalizedPath = filePath.replace(/\\/g, '/').toLowerCase();
|
|
1690
|
+
const normalizedPattern = pattern.replace(/\\/g, '/').toLowerCase();
|
|
1691
|
+
// Direct match
|
|
1692
|
+
if (normalizedPath === normalizedPattern) {
|
|
1693
|
+
return true;
|
|
1694
|
+
}
|
|
1695
|
+
// Convert glob pattern to regex
|
|
1696
|
+
// ** matches any path including slashes
|
|
1697
|
+
// * matches any characters except slashes
|
|
1698
|
+
let regexPattern = normalizedPattern
|
|
1699
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&') // Escape special regex chars except * and ?
|
|
1700
|
+
.replace(/\*\*/g, '<<GLOBSTAR>>') // Temporarily replace **
|
|
1701
|
+
.replace(/\*/g, '[^/]*') // * matches anything except /
|
|
1702
|
+
.replace(/<<GLOBSTAR>>/g, '.*') // ** matches anything including /
|
|
1703
|
+
.replace(/\?/g, '.'); // ? matches any single char
|
|
1704
|
+
// Check if pattern should match at start
|
|
1705
|
+
if (!regexPattern.startsWith('.*')) {
|
|
1706
|
+
// Pattern like "Library/**" should match "Library/foo" but not "src/Library/foo"
|
|
1707
|
+
// Unless it's a more specific path pattern
|
|
1708
|
+
if (normalizedPattern.includes('/')) {
|
|
1709
|
+
regexPattern = `(^|/)${regexPattern}`;
|
|
1710
|
+
}
|
|
1711
|
+
else {
|
|
1712
|
+
regexPattern = `(^|/)${regexPattern}`;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
// Allow matching at end without trailing slash
|
|
1716
|
+
regexPattern = `${regexPattern}(/.*)?$`;
|
|
1717
|
+
try {
|
|
1718
|
+
const regex = new RegExp(regexPattern);
|
|
1719
|
+
return regex.test(normalizedPath);
|
|
1720
|
+
}
|
|
1721
|
+
catch {
|
|
1722
|
+
// If regex fails, try simple includes check
|
|
1723
|
+
return normalizedPath.includes(normalizedPattern.replace(/\*/g, ''));
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Generate a deterministic project ID from path
|
|
1728
|
+
*/
|
|
1729
|
+
generateProjectId(projectPath) {
|
|
1730
|
+
return crypto.createHash('md5').update(projectPath).digest('hex');
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* Start the MCP server
|
|
1734
|
+
*/
|
|
1735
|
+
async start() {
|
|
1736
|
+
// Use stderr for logging since stdout is for JSON-RPC
|
|
1737
|
+
console.error('Starting CodeSeeker MCP server...');
|
|
1738
|
+
// Initialize storage manager first to ensure singleton is ready
|
|
1739
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
1740
|
+
console.error(`Storage mode: ${storageManager.getMode()}`);
|
|
1741
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
1742
|
+
await this.server.connect(transport);
|
|
1743
|
+
console.error('CodeSeeker MCP server running on stdio');
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Graceful shutdown - flush and close all storage before exit
|
|
1747
|
+
*/
|
|
1748
|
+
async shutdown() {
|
|
1749
|
+
console.error('Shutting down CodeSeeker MCP server...');
|
|
1750
|
+
try {
|
|
1751
|
+
const storageManager = await (0, storage_1.getStorageManager)();
|
|
1752
|
+
// Flush first to ensure data is saved
|
|
1753
|
+
await storageManager.flushAll();
|
|
1754
|
+
console.error('Storage flushed successfully');
|
|
1755
|
+
// Close to stop interval timers and release resources
|
|
1756
|
+
await storageManager.closeAll();
|
|
1757
|
+
console.error('Storage closed successfully');
|
|
1758
|
+
}
|
|
1759
|
+
catch (error) {
|
|
1760
|
+
console.error('Error during storage shutdown:', error);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
exports.CodeSeekerMcpServer = CodeSeekerMcpServer;
|
|
1765
|
+
/**
|
|
1766
|
+
* Main entry point for MCP server
|
|
1767
|
+
*/
|
|
1768
|
+
async function startMcpServer() {
|
|
1769
|
+
const server = new CodeSeekerMcpServer();
|
|
1770
|
+
let isShuttingDown = false;
|
|
1771
|
+
// Register signal handlers for graceful shutdown
|
|
1772
|
+
const shutdown = async (signal) => {
|
|
1773
|
+
// Prevent multiple shutdown attempts
|
|
1774
|
+
if (isShuttingDown) {
|
|
1775
|
+
console.error(`Already shutting down, ignoring ${signal}`);
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
isShuttingDown = true;
|
|
1779
|
+
console.error(`\nReceived ${signal}, shutting down gracefully...`);
|
|
1780
|
+
// Set a hard timeout to force exit if shutdown takes too long
|
|
1781
|
+
const forceExitTimeout = setTimeout(() => {
|
|
1782
|
+
console.error('Shutdown timeout, forcing exit...');
|
|
1783
|
+
process.exit(1);
|
|
1784
|
+
}, 5000);
|
|
1785
|
+
try {
|
|
1786
|
+
await server.shutdown();
|
|
1787
|
+
clearTimeout(forceExitTimeout);
|
|
1788
|
+
process.exit(0);
|
|
1789
|
+
}
|
|
1790
|
+
catch (error) {
|
|
1791
|
+
console.error('Error during shutdown:', error);
|
|
1792
|
+
clearTimeout(forceExitTimeout);
|
|
1793
|
+
process.exit(1);
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
1797
|
+
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
1798
|
+
// CRITICAL: Handle stdin close - this is how MCP clients signal disconnect
|
|
1799
|
+
// On Windows, signals are unreliable, so stdin close is the primary shutdown mechanism
|
|
1800
|
+
process.stdin.on('close', () => shutdown('stdin-close'));
|
|
1801
|
+
process.stdin.on('end', () => shutdown('stdin-end'));
|
|
1802
|
+
// Also handle stdin errors (broken pipe, etc.)
|
|
1803
|
+
process.stdin.on('error', (err) => {
|
|
1804
|
+
// EPIPE and similar errors mean the parent process disconnected
|
|
1805
|
+
console.error(`stdin error: ${err.message}`);
|
|
1806
|
+
shutdown('stdin-error');
|
|
1807
|
+
});
|
|
1808
|
+
// Handle Windows-specific signals
|
|
1809
|
+
if (process.platform === 'win32') {
|
|
1810
|
+
process.on('SIGHUP', () => shutdown('SIGHUP'));
|
|
1811
|
+
// Windows: also listen for parent process disconnect via stdin
|
|
1812
|
+
// Resume stdin to ensure we receive close/end events
|
|
1813
|
+
process.stdin.resume();
|
|
1814
|
+
}
|
|
1815
|
+
// Handle uncaught exceptions - try to flush before crashing
|
|
1816
|
+
process.on('uncaughtException', async (error) => {
|
|
1817
|
+
console.error('Uncaught exception:', error);
|
|
1818
|
+
await shutdown('uncaughtException');
|
|
1819
|
+
});
|
|
1820
|
+
// Handle unhandled promise rejections
|
|
1821
|
+
process.on('unhandledRejection', async (reason) => {
|
|
1822
|
+
console.error('Unhandled rejection:', reason);
|
|
1823
|
+
await shutdown('unhandledRejection');
|
|
1824
|
+
});
|
|
1825
|
+
await server.start();
|
|
1826
|
+
}
|
|
1827
|
+
//# sourceMappingURL=mcp-server.js.map
|