@egentica/codemap 0.1.5
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.md +165 -0
- package/README.md +479 -0
- package/dist/adapters/EgenticaMcpAdapter.d.ts +128 -0
- package/dist/adapters/EgenticaMcpAdapter.d.ts.map +1 -0
- package/dist/adapters/EgenticaMcpAdapter.js +218 -0
- package/dist/adapters/EgenticaMcpAdapter.js.map +1 -0
- package/dist/assist/AssistEngine.d.ts +107 -0
- package/dist/assist/AssistEngine.d.ts.map +1 -0
- package/dist/assist/AssistEngine.js +188 -0
- package/dist/assist/AssistEngine.js.map +1 -0
- package/dist/assist/AssistScorer.d.ts +91 -0
- package/dist/assist/AssistScorer.d.ts.map +1 -0
- package/dist/assist/AssistScorer.js +254 -0
- package/dist/assist/AssistScorer.js.map +1 -0
- package/dist/assist/PatternAggregator.d.ts +116 -0
- package/dist/assist/PatternAggregator.d.ts.map +1 -0
- package/dist/assist/PatternAggregator.js +311 -0
- package/dist/assist/PatternAggregator.js.map +1 -0
- package/dist/assist/RelevanceScorer.d.ts +104 -0
- package/dist/assist/RelevanceScorer.d.ts.map +1 -0
- package/dist/assist/RelevanceScorer.js +240 -0
- package/dist/assist/RelevanceScorer.js.map +1 -0
- package/dist/assist/index.d.ts +6 -0
- package/dist/assist/index.d.ts.map +1 -0
- package/dist/assist/index.js +9 -0
- package/dist/assist/index.js.map +1 -0
- package/dist/core/AnnotationStore.d.ts +101 -0
- package/dist/core/AnnotationStore.d.ts.map +1 -0
- package/dist/core/AnnotationStore.js +236 -0
- package/dist/core/AnnotationStore.js.map +1 -0
- package/dist/core/BackupManager.d.ts +92 -0
- package/dist/core/BackupManager.d.ts.map +1 -0
- package/dist/core/BackupManager.js +311 -0
- package/dist/core/BackupManager.js.map +1 -0
- package/dist/core/ChecklistStore.d.ts +66 -0
- package/dist/core/ChecklistStore.d.ts.map +1 -0
- package/dist/core/ChecklistStore.js +199 -0
- package/dist/core/ChecklistStore.js.map +1 -0
- package/dist/core/CodeMap.d.ts +614 -0
- package/dist/core/CodeMap.d.ts.map +1 -0
- package/dist/core/CodeMap.js +880 -0
- package/dist/core/CodeMap.js.map +1 -0
- package/dist/core/DisplayFilter.d.ts +83 -0
- package/dist/core/DisplayFilter.d.ts.map +1 -0
- package/dist/core/DisplayFilter.js +228 -0
- package/dist/core/DisplayFilter.js.map +1 -0
- package/dist/core/EventBus.d.ts +114 -0
- package/dist/core/EventBus.d.ts.map +1 -0
- package/dist/core/EventBus.js +192 -0
- package/dist/core/EventBus.js.map +1 -0
- package/dist/core/ExperienceStore.d.ts +170 -0
- package/dist/core/ExperienceStore.d.ts.map +1 -0
- package/dist/core/ExperienceStore.js +292 -0
- package/dist/core/ExperienceStore.js.map +1 -0
- package/dist/core/ExperienceTracker.d.ts +110 -0
- package/dist/core/ExperienceTracker.d.ts.map +1 -0
- package/dist/core/ExperienceTracker.js +291 -0
- package/dist/core/ExperienceTracker.js.map +1 -0
- package/dist/core/FileSystemGraph.d.ts +157 -0
- package/dist/core/FileSystemGraph.d.ts.map +1 -0
- package/dist/core/FileSystemGraph.js +316 -0
- package/dist/core/FileSystemGraph.js.map +1 -0
- package/dist/core/FileSystemIO.d.ts +222 -0
- package/dist/core/FileSystemIO.d.ts.map +1 -0
- package/dist/core/FileSystemIO.js +403 -0
- package/dist/core/FileSystemIO.js.map +1 -0
- package/dist/core/FuzzyMatcher.d.ts +51 -0
- package/dist/core/FuzzyMatcher.d.ts.map +1 -0
- package/dist/core/FuzzyMatcher.js +280 -0
- package/dist/core/FuzzyMatcher.js.map +1 -0
- package/dist/core/GroupStore.d.ts +114 -0
- package/dist/core/GroupStore.d.ts.map +1 -0
- package/dist/core/GroupStore.js +246 -0
- package/dist/core/GroupStore.js.map +1 -0
- package/dist/core/HelpRegistry.d.ts +116 -0
- package/dist/core/HelpRegistry.d.ts.map +1 -0
- package/dist/core/HelpRegistry.js +160 -0
- package/dist/core/HelpRegistry.js.map +1 -0
- package/dist/core/HintRegistry.d.ts +49 -0
- package/dist/core/HintRegistry.d.ts.map +1 -0
- package/dist/core/HintRegistry.js +81 -0
- package/dist/core/HintRegistry.js.map +1 -0
- package/dist/core/LabelStore.d.ts +88 -0
- package/dist/core/LabelStore.d.ts.map +1 -0
- package/dist/core/LabelStore.js +520 -0
- package/dist/core/LabelStore.js.map +1 -0
- package/dist/core/LineRangeWriter.d.ts +63 -0
- package/dist/core/LineRangeWriter.d.ts.map +1 -0
- package/dist/core/LineRangeWriter.js +179 -0
- package/dist/core/LineRangeWriter.js.map +1 -0
- package/dist/core/ParserRegistry.d.ts +70 -0
- package/dist/core/ParserRegistry.d.ts.map +1 -0
- package/dist/core/ParserRegistry.js +109 -0
- package/dist/core/ParserRegistry.js.map +1 -0
- package/dist/core/PluginRegistry.d.ts +120 -0
- package/dist/core/PluginRegistry.d.ts.map +1 -0
- package/dist/core/PluginRegistry.js +230 -0
- package/dist/core/PluginRegistry.js.map +1 -0
- package/dist/core/QueryEngine.d.ts +134 -0
- package/dist/core/QueryEngine.d.ts.map +1 -0
- package/dist/core/QueryEngine.js +211 -0
- package/dist/core/QueryEngine.js.map +1 -0
- package/dist/core/Scanner.d.ts +84 -0
- package/dist/core/Scanner.d.ts.map +1 -0
- package/dist/core/Scanner.js +184 -0
- package/dist/core/Scanner.js.map +1 -0
- package/dist/core/SessionTransactionLog.d.ts +138 -0
- package/dist/core/SessionTransactionLog.d.ts.map +1 -0
- package/dist/core/SessionTransactionLog.js +397 -0
- package/dist/core/SessionTransactionLog.js.map +1 -0
- package/dist/core/TargetParser.d.ts +85 -0
- package/dist/core/TargetParser.d.ts.map +1 -0
- package/dist/core/TargetParser.js +167 -0
- package/dist/core/TargetParser.js.map +1 -0
- package/dist/core/TargetResolver.d.ts +115 -0
- package/dist/core/TargetResolver.d.ts.map +1 -0
- package/dist/core/TargetResolver.js +237 -0
- package/dist/core/TargetResolver.js.map +1 -0
- package/dist/core/WriteSafetyGuard.d.ts +101 -0
- package/dist/core/WriteSafetyGuard.d.ts.map +1 -0
- package/dist/core/WriteSafetyGuard.js +265 -0
- package/dist/core/WriteSafetyGuard.js.map +1 -0
- package/dist/core/index.d.ts +38 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +51 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/query/DependencyTraversal.d.ts +23 -0
- package/dist/core/query/DependencyTraversal.d.ts.map +1 -0
- package/dist/core/query/DependencyTraversal.js +55 -0
- package/dist/core/query/DependencyTraversal.js.map +1 -0
- package/dist/core/query/ResultProcessor.d.ts +20 -0
- package/dist/core/query/ResultProcessor.d.ts.map +1 -0
- package/dist/core/query/ResultProcessor.js +99 -0
- package/dist/core/query/ResultProcessor.js.map +1 -0
- package/dist/core/query/SymbolSearchEngine.d.ts +20 -0
- package/dist/core/query/SymbolSearchEngine.d.ts.map +1 -0
- package/dist/core/query/SymbolSearchEngine.js +109 -0
- package/dist/core/query/SymbolSearchEngine.js.map +1 -0
- package/dist/core/query/TextSearchEngine.d.ts +23 -0
- package/dist/core/query/TextSearchEngine.d.ts.map +1 -0
- package/dist/core/query/TextSearchEngine.js +69 -0
- package/dist/core/query/TextSearchEngine.js.map +1 -0
- package/dist/core/query/index.d.ts +11 -0
- package/dist/core/query/index.d.ts.map +1 -0
- package/dist/core/query/index.js +18 -0
- package/dist/core/query/index.js.map +1 -0
- package/dist/core/scan/DependencyResolver.d.ts +26 -0
- package/dist/core/scan/DependencyResolver.d.ts.map +1 -0
- package/dist/core/scan/DependencyResolver.js +81 -0
- package/dist/core/scan/DependencyResolver.js.map +1 -0
- package/dist/core/scan/DirectoryWalker.d.ts +39 -0
- package/dist/core/scan/DirectoryWalker.d.ts.map +1 -0
- package/dist/core/scan/DirectoryWalker.js +136 -0
- package/dist/core/scan/DirectoryWalker.js.map +1 -0
- package/dist/core/scan/IgnorePatternMatcher.d.ts +32 -0
- package/dist/core/scan/IgnorePatternMatcher.d.ts.map +1 -0
- package/dist/core/scan/IgnorePatternMatcher.js +120 -0
- package/dist/core/scan/IgnorePatternMatcher.js.map +1 -0
- package/dist/core/scan/index.d.ts +10 -0
- package/dist/core/scan/index.d.ts.map +1 -0
- package/dist/core/scan/index.js +16 -0
- package/dist/core/scan/index.js.map +1 -0
- package/dist/core/utils/packageDiscovery.d.ts +24 -0
- package/dist/core/utils/packageDiscovery.d.ts.map +1 -0
- package/dist/core/utils/packageDiscovery.js +37 -0
- package/dist/core/utils/packageDiscovery.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/operations/annotations.d.ts +9 -0
- package/dist/mcp/operations/annotations.d.ts.map +1 -0
- package/dist/mcp/operations/annotations.js +66 -0
- package/dist/mcp/operations/annotations.js.map +1 -0
- package/dist/mcp/operations/files.d.ts +13 -0
- package/dist/mcp/operations/files.d.ts.map +1 -0
- package/dist/mcp/operations/files.js +173 -0
- package/dist/mcp/operations/files.js.map +1 -0
- package/dist/mcp/operations/graph.d.ts +10 -0
- package/dist/mcp/operations/graph.d.ts.map +1 -0
- package/dist/mcp/operations/graph.js +69 -0
- package/dist/mcp/operations/graph.js.map +1 -0
- package/dist/mcp/operations/groups.d.ts +55 -0
- package/dist/mcp/operations/groups.d.ts.map +1 -0
- package/dist/mcp/operations/groups.js +233 -0
- package/dist/mcp/operations/groups.js.map +1 -0
- package/dist/mcp/operations/help.d.ts +36 -0
- package/dist/mcp/operations/help.d.ts.map +1 -0
- package/dist/mcp/operations/help.js +322 -0
- package/dist/mcp/operations/help.js.map +1 -0
- package/dist/mcp/operations/session.d.ts +13 -0
- package/dist/mcp/operations/session.d.ts.map +1 -0
- package/dist/mcp/operations/session.js +169 -0
- package/dist/mcp/operations/session.js.map +1 -0
- package/dist/mcp/operations/writes.d.ts +14 -0
- package/dist/mcp/operations/writes.d.ts.map +1 -0
- package/dist/mcp/operations/writes.js +287 -0
- package/dist/mcp/operations/writes.js.map +1 -0
- package/dist/mcp/registry/ToolRegistry.d.ts +54 -0
- package/dist/mcp/registry/ToolRegistry.d.ts.map +1 -0
- package/dist/mcp/registry/ToolRegistry.js +219 -0
- package/dist/mcp/registry/ToolRegistry.js.map +1 -0
- package/dist/mcp/registry/context-guard.d.ts +13 -0
- package/dist/mcp/registry/context-guard.d.ts.map +1 -0
- package/dist/mcp/registry/context-guard.js +19 -0
- package/dist/mcp/registry/context-guard.js.map +1 -0
- package/dist/mcp/registry/schemas.d.ts +221 -0
- package/dist/mcp/registry/schemas.d.ts.map +1 -0
- package/dist/mcp/registry/schemas.js +217 -0
- package/dist/mcp/registry/schemas.js.map +1 -0
- package/dist/mcp/registry/types.d.ts +50 -0
- package/dist/mcp/registry/types.d.ts.map +1 -0
- package/dist/mcp/registry/types.js +5 -0
- package/dist/mcp/registry/types.js.map +1 -0
- package/dist/mcp/server.d.ts +35 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +264 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/annotations/add.tool.d.ts +10 -0
- package/dist/mcp/tools/annotations/add.tool.d.ts.map +1 -0
- package/dist/mcp/tools/annotations/add.tool.js +88 -0
- package/dist/mcp/tools/annotations/add.tool.js.map +1 -0
- package/dist/mcp/tools/annotations/edit.tool.d.ts +10 -0
- package/dist/mcp/tools/annotations/edit.tool.d.ts.map +1 -0
- package/dist/mcp/tools/annotations/edit.tool.js +92 -0
- package/dist/mcp/tools/annotations/edit.tool.js.map +1 -0
- package/dist/mcp/tools/annotations/remove.tool.d.ts +9 -0
- package/dist/mcp/tools/annotations/remove.tool.d.ts.map +1 -0
- package/dist/mcp/tools/annotations/remove.tool.js +87 -0
- package/dist/mcp/tools/annotations/remove.tool.js.map +1 -0
- package/dist/mcp/tools/annotations/search-annotations.tool.d.ts +11 -0
- package/dist/mcp/tools/annotations/search-annotations.tool.d.ts.map +1 -0
- package/dist/mcp/tools/annotations/search-annotations.tool.js +91 -0
- package/dist/mcp/tools/annotations/search-annotations.tool.js.map +1 -0
- package/dist/mcp/tools/backup/list.tool.d.ts +16 -0
- package/dist/mcp/tools/backup/list.tool.d.ts.map +1 -0
- package/dist/mcp/tools/backup/list.tool.js +48 -0
- package/dist/mcp/tools/backup/list.tool.js.map +1 -0
- package/dist/mcp/tools/backup/restore.tool.d.ts +15 -0
- package/dist/mcp/tools/backup/restore.tool.d.ts.map +1 -0
- package/dist/mcp/tools/backup/restore.tool.js +138 -0
- package/dist/mcp/tools/backup/restore.tool.js.map +1 -0
- package/dist/mcp/tools/checklist/add.tool.d.ts +17 -0
- package/dist/mcp/tools/checklist/add.tool.d.ts.map +1 -0
- package/dist/mcp/tools/checklist/add.tool.js +53 -0
- package/dist/mcp/tools/checklist/add.tool.js.map +1 -0
- package/dist/mcp/tools/checklist/list.tool.d.ts +11 -0
- package/dist/mcp/tools/checklist/list.tool.d.ts.map +1 -0
- package/dist/mcp/tools/checklist/list.tool.js +53 -0
- package/dist/mcp/tools/checklist/list.tool.js.map +1 -0
- package/dist/mcp/tools/checklist/remove.tool.d.ts +9 -0
- package/dist/mcp/tools/checklist/remove.tool.d.ts.map +1 -0
- package/dist/mcp/tools/checklist/remove.tool.js +63 -0
- package/dist/mcp/tools/checklist/remove.tool.js.map +1 -0
- package/dist/mcp/tools/graph/get-dependencies.tool.d.ts +8 -0
- package/dist/mcp/tools/graph/get-dependencies.tool.d.ts.map +1 -0
- package/dist/mcp/tools/graph/get-dependencies.tool.js +58 -0
- package/dist/mcp/tools/graph/get-dependencies.tool.js.map +1 -0
- package/dist/mcp/tools/graph/get-related.tool.d.ts +9 -0
- package/dist/mcp/tools/graph/get-related.tool.d.ts.map +1 -0
- package/dist/mcp/tools/graph/get-related.tool.js +63 -0
- package/dist/mcp/tools/graph/get-related.tool.js.map +1 -0
- package/dist/mcp/tools/graph/impact-analysis.tool.d.ts +9 -0
- package/dist/mcp/tools/graph/impact-analysis.tool.d.ts.map +1 -0
- package/dist/mcp/tools/graph/impact-analysis.tool.js +61 -0
- package/dist/mcp/tools/graph/impact-analysis.tool.js.map +1 -0
- package/dist/mcp/tools/graph/traverse.tool.d.ts +13 -0
- package/dist/mcp/tools/graph/traverse.tool.d.ts.map +1 -0
- package/dist/mcp/tools/graph/traverse.tool.js +59 -0
- package/dist/mcp/tools/graph/traverse.tool.js.map +1 -0
- package/dist/mcp/tools/groups/add.tool.d.ts +10 -0
- package/dist/mcp/tools/groups/add.tool.d.ts.map +1 -0
- package/dist/mcp/tools/groups/add.tool.js +85 -0
- package/dist/mcp/tools/groups/add.tool.js.map +1 -0
- package/dist/mcp/tools/groups/notate.tool.d.ts +11 -0
- package/dist/mcp/tools/groups/notate.tool.d.ts.map +1 -0
- package/dist/mcp/tools/groups/notate.tool.js +86 -0
- package/dist/mcp/tools/groups/notate.tool.js.map +1 -0
- package/dist/mcp/tools/groups/search.tool.d.ts +8 -0
- package/dist/mcp/tools/groups/search.tool.d.ts.map +1 -0
- package/dist/mcp/tools/groups/search.tool.js +81 -0
- package/dist/mcp/tools/groups/search.tool.js.map +1 -0
- package/dist/mcp/tools/io/append.tool.d.ts +10 -0
- package/dist/mcp/tools/io/append.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/append.tool.js +103 -0
- package/dist/mcp/tools/io/append.tool.js.map +1 -0
- package/dist/mcp/tools/io/create.tool.d.ts +11 -0
- package/dist/mcp/tools/io/create.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/create.tool.js +119 -0
- package/dist/mcp/tools/io/create.tool.js.map +1 -0
- package/dist/mcp/tools/io/delete.tool.d.ts +9 -0
- package/dist/mcp/tools/io/delete.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/delete.tool.js +129 -0
- package/dist/mcp/tools/io/delete.tool.js.map +1 -0
- package/dist/mcp/tools/io/get-annotations.tool.d.ts +10 -0
- package/dist/mcp/tools/io/get-annotations.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/get-annotations.tool.js +97 -0
- package/dist/mcp/tools/io/get-annotations.tool.js.map +1 -0
- package/dist/mcp/tools/io/get-symbols.tool.d.ts +9 -0
- package/dist/mcp/tools/io/get-symbols.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/get-symbols.tool.js +63 -0
- package/dist/mcp/tools/io/get-symbols.tool.js.map +1 -0
- package/dist/mcp/tools/io/list.tool.d.ts +8 -0
- package/dist/mcp/tools/io/list.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/list.tool.js +68 -0
- package/dist/mcp/tools/io/list.tool.js.map +1 -0
- package/dist/mcp/tools/io/peek.tool.d.ts +11 -0
- package/dist/mcp/tools/io/peek.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/peek.tool.js +74 -0
- package/dist/mcp/tools/io/peek.tool.js.map +1 -0
- package/dist/mcp/tools/io/read-multiple.tool.d.ts +9 -0
- package/dist/mcp/tools/io/read-multiple.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/read-multiple.tool.js +72 -0
- package/dist/mcp/tools/io/read-multiple.tool.js.map +1 -0
- package/dist/mcp/tools/io/read.tool.d.ts +13 -0
- package/dist/mcp/tools/io/read.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/read.tool.js +132 -0
- package/dist/mcp/tools/io/read.tool.js.map +1 -0
- package/dist/mcp/tools/io/rename.tool.d.ts +9 -0
- package/dist/mcp/tools/io/rename.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/rename.tool.js +101 -0
- package/dist/mcp/tools/io/rename.tool.js.map +1 -0
- package/dist/mcp/tools/io/replace-many.tool.d.ts +10 -0
- package/dist/mcp/tools/io/replace-many.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/replace-many.tool.js +114 -0
- package/dist/mcp/tools/io/replace-many.tool.js.map +1 -0
- package/dist/mcp/tools/io/replace-text.tool.d.ts +12 -0
- package/dist/mcp/tools/io/replace-text.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/replace-text.tool.js +213 -0
- package/dist/mcp/tools/io/replace-text.tool.js.map +1 -0
- package/dist/mcp/tools/io/write.tool.d.ts +10 -0
- package/dist/mcp/tools/io/write.tool.d.ts.map +1 -0
- package/dist/mcp/tools/io/write.tool.js +103 -0
- package/dist/mcp/tools/io/write.tool.js.map +1 -0
- package/dist/mcp/tools/labels/assign.tool.d.ts +16 -0
- package/dist/mcp/tools/labels/assign.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/assign.tool.js +52 -0
- package/dist/mcp/tools/labels/assign.tool.js.map +1 -0
- package/dist/mcp/tools/labels/create.tool.d.ts +12 -0
- package/dist/mcp/tools/labels/create.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/create.tool.js +51 -0
- package/dist/mcp/tools/labels/create.tool.js.map +1 -0
- package/dist/mcp/tools/labels/delete.tool.d.ts +9 -0
- package/dist/mcp/tools/labels/delete.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/delete.tool.js +48 -0
- package/dist/mcp/tools/labels/delete.tool.js.map +1 -0
- package/dist/mcp/tools/labels/edit.tool.d.ts +13 -0
- package/dist/mcp/tools/labels/edit.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/edit.tool.js +58 -0
- package/dist/mcp/tools/labels/edit.tool.js.map +1 -0
- package/dist/mcp/tools/labels/list.tool.d.ts +11 -0
- package/dist/mcp/tools/labels/list.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/list.tool.js +47 -0
- package/dist/mcp/tools/labels/list.tool.js.map +1 -0
- package/dist/mcp/tools/labels/migrate.tool.d.ts +10 -0
- package/dist/mcp/tools/labels/migrate.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/migrate.tool.js +50 -0
- package/dist/mcp/tools/labels/migrate.tool.js.map +1 -0
- package/dist/mcp/tools/labels/search.tool.d.ts +16 -0
- package/dist/mcp/tools/labels/search.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/search.tool.js +55 -0
- package/dist/mcp/tools/labels/search.tool.js.map +1 -0
- package/dist/mcp/tools/labels/unassign.tool.d.ts +9 -0
- package/dist/mcp/tools/labels/unassign.tool.d.ts.map +1 -0
- package/dist/mcp/tools/labels/unassign.tool.js +49 -0
- package/dist/mcp/tools/labels/unassign.tool.js.map +1 -0
- package/dist/mcp/tools/search/find-by-name.tool.d.ts +8 -0
- package/dist/mcp/tools/search/find-by-name.tool.d.ts.map +1 -0
- package/dist/mcp/tools/search/find-by-name.tool.js +57 -0
- package/dist/mcp/tools/search/find-by-name.tool.js.map +1 -0
- package/dist/mcp/tools/search/find-relevant.tool.d.ts +9 -0
- package/dist/mcp/tools/search/find-relevant.tool.d.ts.map +1 -0
- package/dist/mcp/tools/search/find-relevant.tool.js +71 -0
- package/dist/mcp/tools/search/find-relevant.tool.js.map +1 -0
- package/dist/mcp/tools/search/scan.tool.d.ts +8 -0
- package/dist/mcp/tools/search/scan.tool.d.ts.map +1 -0
- package/dist/mcp/tools/search/scan.tool.js +103 -0
- package/dist/mcp/tools/search/scan.tool.js.map +1 -0
- package/dist/mcp/tools/search/search-elements.tool.d.ts +11 -0
- package/dist/mcp/tools/search/search-elements.tool.d.ts.map +1 -0
- package/dist/mcp/tools/search/search-elements.tool.js +71 -0
- package/dist/mcp/tools/search/search-elements.tool.js.map +1 -0
- package/dist/mcp/tools/search/search-in-files.tool.d.ts +14 -0
- package/dist/mcp/tools/search/search-in-files.tool.d.ts.map +1 -0
- package/dist/mcp/tools/search/search-in-files.tool.js +204 -0
- package/dist/mcp/tools/search/search-in-files.tool.js.map +1 -0
- package/dist/mcp/tools/search/search.tool.d.ts +25 -0
- package/dist/mcp/tools/search/search.tool.d.ts.map +1 -0
- package/dist/mcp/tools/search/search.tool.js +109 -0
- package/dist/mcp/tools/search/search.tool.js.map +1 -0
- package/dist/mcp/tools/session/audit.tool.d.ts +6 -0
- package/dist/mcp/tools/session/audit.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/audit.tool.js +64 -0
- package/dist/mcp/tools/session/audit.tool.js.map +1 -0
- package/dist/mcp/tools/session/close.tool.d.ts +11 -0
- package/dist/mcp/tools/session/close.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/close.tool.js +79 -0
- package/dist/mcp/tools/session/close.tool.js.map +1 -0
- package/dist/mcp/tools/session/execute-shell.tool.d.ts +11 -0
- package/dist/mcp/tools/session/execute-shell.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/execute-shell.tool.js +87 -0
- package/dist/mcp/tools/session/execute-shell.tool.js.map +1 -0
- package/dist/mcp/tools/session/help.tool.d.ts +8 -0
- package/dist/mcp/tools/session/help.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/help.tool.js +84 -0
- package/dist/mcp/tools/session/help.tool.js.map +1 -0
- package/dist/mcp/tools/session/list.tool.d.ts +9 -0
- package/dist/mcp/tools/session/list.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/list.tool.js +49 -0
- package/dist/mcp/tools/session/list.tool.js.map +1 -0
- package/dist/mcp/tools/session/next-session.tool.d.ts +8 -0
- package/dist/mcp/tools/session/next-session.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/next-session.tool.js +87 -0
- package/dist/mcp/tools/session/next-session.tool.js.map +1 -0
- package/dist/mcp/tools/session/orient.tool.d.ts +11 -0
- package/dist/mcp/tools/session/orient.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/orient.tool.js +239 -0
- package/dist/mcp/tools/session/orient.tool.js.map +1 -0
- package/dist/mcp/tools/session/read.tool.d.ts +8 -0
- package/dist/mcp/tools/session/read.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/read.tool.js +63 -0
- package/dist/mcp/tools/session/read.tool.js.map +1 -0
- package/dist/mcp/tools/session/reindex.tool.d.ts +6 -0
- package/dist/mcp/tools/session/reindex.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/reindex.tool.js +59 -0
- package/dist/mcp/tools/session/reindex.tool.js.map +1 -0
- package/dist/mcp/tools/session/start.tool.d.ts +8 -0
- package/dist/mcp/tools/session/start.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/start.tool.js +170 -0
- package/dist/mcp/tools/session/start.tool.js.map +1 -0
- package/dist/mcp/tools/session/stats.tool.d.ts +6 -0
- package/dist/mcp/tools/session/stats.tool.d.ts.map +1 -0
- package/dist/mcp/tools/session/stats.tool.js +46 -0
- package/dist/mcp/tools/session/stats.tool.js.map +1 -0
- package/dist/plugins/parser-typescript/index.d.ts +80 -0
- package/dist/plugins/parser-typescript/index.d.ts.map +1 -0
- package/dist/plugins/parser-typescript/index.js +467 -0
- package/dist/plugins/parser-typescript/index.js.map +1 -0
- package/dist/plugins/parser-vue/index.d.ts +20 -0
- package/dist/plugins/parser-vue/index.d.ts.map +1 -0
- package/dist/plugins/parser-vue/index.js +88 -0
- package/dist/plugins/parser-vue/index.js.map +1 -0
- package/dist/plugins/parser-vue/script-parser.d.ts +18 -0
- package/dist/plugins/parser-vue/script-parser.d.ts.map +1 -0
- package/dist/plugins/parser-vue/script-parser.js +100 -0
- package/dist/plugins/parser-vue/script-parser.js.map +1 -0
- package/dist/plugins/parser-vue/template-parser.d.ts +14 -0
- package/dist/plugins/parser-vue/template-parser.d.ts.map +1 -0
- package/dist/plugins/parser-vue/template-parser.js +95 -0
- package/dist/plugins/parser-vue/template-parser.js.map +1 -0
- package/dist/query/SymbolSearch.d.ts +56 -0
- package/dist/query/SymbolSearch.d.ts.map +1 -0
- package/dist/query/SymbolSearch.js +132 -0
- package/dist/query/SymbolSearch.js.map +1 -0
- package/dist/query/TextSearch.d.ts +47 -0
- package/dist/query/TextSearch.d.ts.map +1 -0
- package/dist/query/TextSearch.js +110 -0
- package/dist/query/TextSearch.js.map +1 -0
- package/dist/storage/NodeFsProvider.d.ts +148 -0
- package/dist/storage/NodeFsProvider.d.ts.map +1 -0
- package/dist/storage/NodeFsProvider.js +264 -0
- package/dist/storage/NodeFsProvider.js.map +1 -0
- package/dist/types/annotation.d.ts +79 -0
- package/dist/types/annotation.d.ts.map +1 -0
- package/dist/types/annotation.js +10 -0
- package/dist/types/annotation.js.map +1 -0
- package/dist/types/assist.d.ts +147 -0
- package/dist/types/assist.d.ts.map +1 -0
- package/dist/types/assist.js +12 -0
- package/dist/types/assist.js.map +1 -0
- package/dist/types/contracts/FileSystemProvider.d.ts +24 -0
- package/dist/types/contracts/FileSystemProvider.d.ts.map +1 -0
- package/dist/types/contracts/FileSystemProvider.js +9 -0
- package/dist/types/contracts/FileSystemProvider.js.map +1 -0
- package/dist/types/contracts/LanguageParser.d.ts +146 -0
- package/dist/types/contracts/LanguageParser.d.ts.map +1 -0
- package/dist/types/contracts/LanguageParser.js +43 -0
- package/dist/types/contracts/LanguageParser.js.map +1 -0
- package/dist/types/contracts/Plugin.d.ts +226 -0
- package/dist/types/contracts/Plugin.d.ts.map +1 -0
- package/dist/types/contracts/Plugin.js +21 -0
- package/dist/types/contracts/Plugin.js.map +1 -0
- package/dist/types/contracts/index.d.ts +10 -0
- package/dist/types/contracts/index.d.ts.map +1 -0
- package/dist/types/contracts/index.js +26 -0
- package/dist/types/contracts/index.js.map +1 -0
- package/dist/types/core.d.ts +170 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +10 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/events.d.ts +29 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +18 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/experience.d.ts +153 -0
- package/dist/types/experience.d.ts.map +1 -0
- package/dist/types/experience.js +9 -0
- package/dist/types/experience.js.map +1 -0
- package/dist/types/graph.d.ts +35 -0
- package/dist/types/graph.d.ts.map +1 -0
- package/dist/types/graph.js +8 -0
- package/dist/types/graph.js.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +33 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/label.d.ts +150 -0
- package/dist/types/label.d.ts.map +1 -0
- package/dist/types/label.js +9 -0
- package/dist/types/label.js.map +1 -0
- package/dist/types/query.d.ts +104 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/query.js +11 -0
- package/dist/types/query.js.map +1 -0
- package/dist/types/response.d.ts +133 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +60 -0
- package/dist/types/response.js.map +1 -0
- package/dist/types/target.d.ts +68 -0
- package/dist/types/target.d.ts.map +1 -0
- package/dist/types/target.js +11 -0
- package/dist/types/target.js.map +1 -0
- package/dist/utils/version.d.ts +9 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +30 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,880 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CodeMap - Main orchestrator class.
|
|
4
|
+
*
|
|
5
|
+
* Ties together FileSystemGraph, FileSystemIO, Scanner, PluginRegistry, and QueryEngine
|
|
6
|
+
* into a single cohesive API. This is the entry point for all CodeMap consumers.
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* - Single entry point for all operations
|
|
10
|
+
* - Dependency injection via FileSystemProvider
|
|
11
|
+
* - Plugin-based extensibility
|
|
12
|
+
* - Event-driven lifecycle hooks
|
|
13
|
+
* - Zero Egentica coupling
|
|
14
|
+
*
|
|
15
|
+
* @codemap.domain.name CodeMap Core API
|
|
16
|
+
* @codemap.usage Initialize CodeMap instances and configure root path and file system provider
|
|
17
|
+
* @codemap.usage Register or unregister plugins for language parsing and feature extensions
|
|
18
|
+
* @codemap.usage Access query engine, filesystem gateway, or target resolver APIs
|
|
19
|
+
* @codemap.usage Hook into lifecycle events (scan, file operations) for custom behavior
|
|
20
|
+
* @codemap.usage Change core CodeMap architecture or orchestration logic
|
|
21
|
+
* @codemap.policy This is the ONLY public API. All other classes are internal implementation.
|
|
22
|
+
* @codemap.policy FileSystemProvider defaults to Node.js filesystem — consumers can override if needed.
|
|
23
|
+
*
|
|
24
|
+
* @example Basic Usage
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { CodeMap, NodeFsProvider } from '@egentica/codemap';
|
|
27
|
+
*
|
|
28
|
+
* // Initialize
|
|
29
|
+
* const codemap = new CodeMap({
|
|
30
|
+
* rootPath: '/project',
|
|
31
|
+
* provider: new NodeFsProvider()
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Register plugins
|
|
35
|
+
* codemap.registerPlugin(new TypeScriptParser());
|
|
36
|
+
* codemap.registerPlugin(new TimeWarpPlugin());
|
|
37
|
+
*
|
|
38
|
+
* // Scan project
|
|
39
|
+
* await codemap.scan();
|
|
40
|
+
*
|
|
41
|
+
* // Query
|
|
42
|
+
* const results = codemap.query.search({ query: 'auth login' });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example Event Hooks
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Hook into file writes
|
|
48
|
+
* codemap.on('file:write:before', async (payload) => {
|
|
49
|
+
* console.log('About to write:', payload.path);
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* // Hook into scan events
|
|
53
|
+
* codemap.on('scan:file', async (payload) => {
|
|
54
|
+
* console.log('Scanned:', payload.file.relativePath);
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
59
|
+
if (k2 === undefined) k2 = k;
|
|
60
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
61
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
62
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
63
|
+
}
|
|
64
|
+
Object.defineProperty(o, k2, desc);
|
|
65
|
+
}) : (function(o, m, k, k2) {
|
|
66
|
+
if (k2 === undefined) k2 = k;
|
|
67
|
+
o[k2] = m[k];
|
|
68
|
+
}));
|
|
69
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
70
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
71
|
+
}) : function(o, v) {
|
|
72
|
+
o["default"] = v;
|
|
73
|
+
});
|
|
74
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
75
|
+
var ownKeys = function(o) {
|
|
76
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
77
|
+
var ar = [];
|
|
78
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
79
|
+
return ar;
|
|
80
|
+
};
|
|
81
|
+
return ownKeys(o);
|
|
82
|
+
};
|
|
83
|
+
return function (mod) {
|
|
84
|
+
if (mod && mod.__esModule) return mod;
|
|
85
|
+
var result = {};
|
|
86
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
87
|
+
__setModuleDefault(result, mod);
|
|
88
|
+
return result;
|
|
89
|
+
};
|
|
90
|
+
})();
|
|
91
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
92
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
93
|
+
};
|
|
94
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95
|
+
exports.CodeMap = void 0;
|
|
96
|
+
const FileSystemGraph_1 = require("./FileSystemGraph");
|
|
97
|
+
const FileSystemIO_1 = require("./FileSystemIO");
|
|
98
|
+
const TargetResolver_1 = require("./TargetResolver");
|
|
99
|
+
const Scanner_1 = require("./Scanner");
|
|
100
|
+
const PluginRegistry_1 = require("./PluginRegistry");
|
|
101
|
+
const ParserRegistry_1 = require("./ParserRegistry");
|
|
102
|
+
const QueryEngine_1 = require("./QueryEngine");
|
|
103
|
+
const EventBus_1 = require("./EventBus");
|
|
104
|
+
const HelpRegistry_1 = require("./HelpRegistry");
|
|
105
|
+
const GroupStore_1 = require("./GroupStore");
|
|
106
|
+
const SessionTransactionLog_1 = require("./SessionTransactionLog");
|
|
107
|
+
const ChecklistStore_1 = require("./ChecklistStore");
|
|
108
|
+
const BackupManager_1 = require("./BackupManager");
|
|
109
|
+
const AnnotationStore_1 = require("./AnnotationStore");
|
|
110
|
+
const LabelStore_1 = require("./LabelStore");
|
|
111
|
+
const DisplayFilter_1 = require("./DisplayFilter");
|
|
112
|
+
const path = __importStar(require("node:path"));
|
|
113
|
+
const NodeFsProvider_js_1 = __importDefault(require("../storage/NodeFsProvider.js"));
|
|
114
|
+
/**
|
|
115
|
+
* CodeMap orchestrator.
|
|
116
|
+
* Main entry point for all CodeMap operations.
|
|
117
|
+
*/
|
|
118
|
+
class CodeMap {
|
|
119
|
+
// ── Core Components ────────────────────────────────────────────────────────
|
|
120
|
+
/**
|
|
121
|
+
* Root path of the project.
|
|
122
|
+
*/
|
|
123
|
+
rootPath;
|
|
124
|
+
/**
|
|
125
|
+
* Knowledge graph access.
|
|
126
|
+
*
|
|
127
|
+
* Direct read-only access to the file system graph.
|
|
128
|
+
* Contains all files, symbols, and dependencies.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const file = codemap.graph.getFile('src/auth/login.ts');
|
|
133
|
+
* const allFiles = codemap.graph.getAllFiles();
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
graph;
|
|
137
|
+
/**
|
|
138
|
+
* Internal event bus.
|
|
139
|
+
*/
|
|
140
|
+
eventBus;
|
|
141
|
+
/**
|
|
142
|
+
* Target resolver (central path/symbol formatting).
|
|
143
|
+
*/
|
|
144
|
+
targetResolver;
|
|
145
|
+
/**
|
|
146
|
+
* File system gateway (emits lifecycle events).
|
|
147
|
+
*/
|
|
148
|
+
fsGateway;
|
|
149
|
+
/**
|
|
150
|
+
* Scanner (walks directory tree).
|
|
151
|
+
*/
|
|
152
|
+
scanner;
|
|
153
|
+
/**
|
|
154
|
+
* Plugin registry for managing plugin lifecycle.
|
|
155
|
+
*/
|
|
156
|
+
pluginRegistry;
|
|
157
|
+
/**
|
|
158
|
+
* Parser registry for bundled language parsers.
|
|
159
|
+
*/
|
|
160
|
+
parserRegistry;
|
|
161
|
+
/**
|
|
162
|
+
* Help registry (core + plugin help topics).
|
|
163
|
+
*/
|
|
164
|
+
_helpRegistry;
|
|
165
|
+
/**
|
|
166
|
+
* Backup manager (hybrid backup system for persistent storage).
|
|
167
|
+
*/
|
|
168
|
+
_backupManager;
|
|
169
|
+
/**
|
|
170
|
+
* Display filter (hint and annotation suppression).
|
|
171
|
+
*/
|
|
172
|
+
_displayFilter;
|
|
173
|
+
/**
|
|
174
|
+
* Group store (persistent code organization).
|
|
175
|
+
*/
|
|
176
|
+
_groupStore;
|
|
177
|
+
/**
|
|
178
|
+
* Annotation store (persistent metadata storage).
|
|
179
|
+
*/
|
|
180
|
+
_annotationStore;
|
|
181
|
+
/**
|
|
182
|
+
* Label store (persistent label system).
|
|
183
|
+
*/
|
|
184
|
+
_labelStore;
|
|
185
|
+
/**
|
|
186
|
+
* Session transaction log (semi-persistent session tracking).
|
|
187
|
+
*/
|
|
188
|
+
_sessionLog;
|
|
189
|
+
/**
|
|
190
|
+
* Checklist store (persistent workflow guidance).
|
|
191
|
+
*/
|
|
192
|
+
_checklistStore;
|
|
193
|
+
/**
|
|
194
|
+
* Query engine (search and traversal).
|
|
195
|
+
*/
|
|
196
|
+
queryEngine;
|
|
197
|
+
/**
|
|
198
|
+
* File system provider (always defined after construction).
|
|
199
|
+
*/
|
|
200
|
+
provider;
|
|
201
|
+
/**
|
|
202
|
+
* Full config loaded from .codemap/config.json.
|
|
203
|
+
*/
|
|
204
|
+
_config = {};
|
|
205
|
+
/**
|
|
206
|
+
* Track whether parsers have been auto-loaded.
|
|
207
|
+
*/
|
|
208
|
+
_parsersLoaded = false;
|
|
209
|
+
// ── Public API ─────────────────────────────────────────────────────────────
|
|
210
|
+
constructor(config) {
|
|
211
|
+
this.rootPath = config.rootPath;
|
|
212
|
+
this.provider = config.provider ?? NodeFsProvider_js_1.default; // Always assigned
|
|
213
|
+
// Load full config from disk asynchronously (non-blocking)
|
|
214
|
+
this.loadConfig().catch(err => {
|
|
215
|
+
console.error('[CodeMap] Failed to load config:', err);
|
|
216
|
+
});
|
|
217
|
+
// Initialize core components
|
|
218
|
+
this.graph = new FileSystemGraph_1.FileSystemGraph(config.rootPath);
|
|
219
|
+
this.eventBus = new EventBus_1.EventBus();
|
|
220
|
+
this.targetResolver = new TargetResolver_1.TargetResolver(config.rootPath);
|
|
221
|
+
this.fsGateway = new FileSystemIO_1.FileSystemIO(this.provider);
|
|
222
|
+
// Give FileSystemIO access to CodeMap for parser lookups
|
|
223
|
+
this.fsGateway.setCodeMap(this);
|
|
224
|
+
// Bridge FileSystemIO events to EventBus (for session tracking and external listeners)
|
|
225
|
+
this.fsGateway.on('file:write:before', (payload) => {
|
|
226
|
+
this.eventBus.emit('file:write:before', payload);
|
|
227
|
+
});
|
|
228
|
+
this.fsGateway.on('file:write:after', (payload) => {
|
|
229
|
+
this.eventBus.emit('file:write:after', payload);
|
|
230
|
+
});
|
|
231
|
+
this.fsGateway.on('file:delete', (payload) => {
|
|
232
|
+
this.eventBus.emit('file:delete', payload);
|
|
233
|
+
});
|
|
234
|
+
this.fsGateway.on('file:rename', (payload) => {
|
|
235
|
+
this.eventBus.emit('file:rename', payload);
|
|
236
|
+
});
|
|
237
|
+
this.scanner = new Scanner_1.Scanner({
|
|
238
|
+
rootPath: config.rootPath,
|
|
239
|
+
provider: this.provider,
|
|
240
|
+
eventBus: this.eventBus,
|
|
241
|
+
graph: this.graph,
|
|
242
|
+
ignorePatterns: config.ignorePatterns,
|
|
243
|
+
bypassHardcodedIgnoreList: config.bypassHardcodedIgnoreList
|
|
244
|
+
});
|
|
245
|
+
this.pluginRegistry = new PluginRegistry_1.PluginRegistry(this);
|
|
246
|
+
this.parserRegistry = new ParserRegistry_1.ParserRegistry();
|
|
247
|
+
this._helpRegistry = new HelpRegistry_1.HelpRegistry();
|
|
248
|
+
// Initialize backup manager first (needed by stores)
|
|
249
|
+
this._backupManager = new BackupManager_1.BackupManager(config.rootPath, this.provider);
|
|
250
|
+
// Load config asynchronously (non-blocking)
|
|
251
|
+
this._backupManager.loadConfig().catch(err => {
|
|
252
|
+
console.error('[CodeMap] Failed to load backup config:', err);
|
|
253
|
+
});
|
|
254
|
+
// Initialize display filter
|
|
255
|
+
this._displayFilter = new DisplayFilter_1.DisplayFilter(config.rootPath, this.provider);
|
|
256
|
+
// Load config and state asynchronously (non-blocking)
|
|
257
|
+
this._displayFilter.loadConfig().catch(err => {
|
|
258
|
+
console.error('[CodeMap] Failed to load display filter config:', err);
|
|
259
|
+
});
|
|
260
|
+
this._displayFilter.load().catch(err => {
|
|
261
|
+
console.error('[CodeMap] Failed to load display filter state:', err);
|
|
262
|
+
});
|
|
263
|
+
// Initialize stores with backup manager
|
|
264
|
+
this._groupStore = new GroupStore_1.GroupStore(config.rootPath, this.provider, this._backupManager);
|
|
265
|
+
this._annotationStore = new AnnotationStore_1.AnnotationStore(this.provider, path.join(config.rootPath, '.codemap'), this._backupManager);
|
|
266
|
+
this._labelStore = new LabelStore_1.LabelStore(config.rootPath, this.provider, this._backupManager);
|
|
267
|
+
this._sessionLog = new SessionTransactionLog_1.SessionTransactionLog(this.provider, path.join(config.rootPath, '.codemap'));
|
|
268
|
+
this._checklistStore = new ChecklistStore_1.ChecklistStore(this.provider, path.join(config.rootPath, '.codemap'));
|
|
269
|
+
this.queryEngine = new QueryEngine_1.QueryEngine({
|
|
270
|
+
graph: this.graph,
|
|
271
|
+
groupStore: this._groupStore,
|
|
272
|
+
eventBus: this.eventBus
|
|
273
|
+
});
|
|
274
|
+
// Wire up automatic session transaction tracking
|
|
275
|
+
this.setupSessionTracking();
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Setup automatic transaction tracking for session logging.
|
|
279
|
+
*
|
|
280
|
+
* Hooks into lifecycle events to automatically track:
|
|
281
|
+
* - File operations (create, update, delete, rename)
|
|
282
|
+
* - Group operations (add, notate)
|
|
283
|
+
* - Annotation operations (add)
|
|
284
|
+
*
|
|
285
|
+
* All tracked operations are logged to .codemap/session-transactions.json
|
|
286
|
+
* until session close (codemap_close).
|
|
287
|
+
*/
|
|
288
|
+
setupSessionTracking() {
|
|
289
|
+
// Track file writes (create and update)
|
|
290
|
+
this.eventBus.on('file:write:after', async (payload) => {
|
|
291
|
+
const { path: filePath } = payload;
|
|
292
|
+
if (!filePath)
|
|
293
|
+
return;
|
|
294
|
+
await this._sessionLog.track('file:update', filePath);
|
|
295
|
+
});
|
|
296
|
+
// Track file deletions
|
|
297
|
+
this.eventBus.on('file:delete', async (payload) => {
|
|
298
|
+
const { path: filePath } = payload;
|
|
299
|
+
if (!filePath)
|
|
300
|
+
return;
|
|
301
|
+
await this._sessionLog.track('file:delete', filePath);
|
|
302
|
+
});
|
|
303
|
+
// Track file renames
|
|
304
|
+
this.eventBus.on('file:rename', async (payload) => {
|
|
305
|
+
const { oldPath, newPath } = payload;
|
|
306
|
+
if (!oldPath || !newPath)
|
|
307
|
+
return;
|
|
308
|
+
await this._sessionLog.track('file:rename', oldPath, { from: oldPath, to: newPath });
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Load config from .codemap/config.json.
|
|
313
|
+
* Called during initialization, stores config for tool access.
|
|
314
|
+
*/
|
|
315
|
+
async loadConfig() {
|
|
316
|
+
const configPath = path.join(this.rootPath, '.codemap', 'config.json');
|
|
317
|
+
try {
|
|
318
|
+
const exists = await this.provider.exists(configPath);
|
|
319
|
+
if (!exists) {
|
|
320
|
+
return; // Use defaults
|
|
321
|
+
}
|
|
322
|
+
const content = await this.provider.read(configPath);
|
|
323
|
+
this._config = JSON.parse(content);
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
console.error('[CodeMap] Failed to load config:', error);
|
|
327
|
+
// Continue with empty config
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Register a plugin.
|
|
332
|
+
*
|
|
333
|
+
* Plugins hook into lifecycle events and extend CodeMap functionality.
|
|
334
|
+
* Examples: language parsers, TimeWarp, custom enrichments.
|
|
335
|
+
*
|
|
336
|
+
* @param plugin - Plugin to register
|
|
337
|
+
*/
|
|
338
|
+
async registerPlugin(plugin) {
|
|
339
|
+
await this.pluginRegistry.register(plugin);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Unregister a plugin by name.
|
|
343
|
+
*
|
|
344
|
+
* @param name - Plugin name
|
|
345
|
+
* @returns True if plugin was unregistered
|
|
346
|
+
*/
|
|
347
|
+
async unregisterPlugin(name) {
|
|
348
|
+
return this.pluginRegistry.unregister(name);
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Execute full project scan.
|
|
352
|
+
*
|
|
353
|
+
* Walks directory tree, emits events, populates graph.
|
|
354
|
+
* Automatically loads bundled parsers on first scan.
|
|
355
|
+
* Plugins hook into scan:file events to extract symbols.
|
|
356
|
+
*
|
|
357
|
+
* @returns Scan statistics
|
|
358
|
+
*/
|
|
359
|
+
async scan() {
|
|
360
|
+
// Auto-load parsers and plugins on first scan (only if not already loaded)
|
|
361
|
+
if (!this._parsersLoaded && this.parserRegistry.count === 0) {
|
|
362
|
+
await this.parserRegistry.autoloadParsers(this, this._config);
|
|
363
|
+
await this.pluginRegistry.autoloadPlugins(this._config);
|
|
364
|
+
this._parsersLoaded = true;
|
|
365
|
+
}
|
|
366
|
+
return this.scanner.scan();
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Query engine access.
|
|
370
|
+
*
|
|
371
|
+
* Provides search, traversal, and discovery methods.
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* const results = codemap.query.search({ query: 'auth' });
|
|
376
|
+
* const importers = codemap.query.findImporters('src/auth.ts');
|
|
377
|
+
* ```
|
|
378
|
+
*/
|
|
379
|
+
get query() {
|
|
380
|
+
return this.queryEngine;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* File system gateway access.
|
|
384
|
+
*
|
|
385
|
+
* All file operations go through this gateway.
|
|
386
|
+
* Emits lifecycle events (file:write:before, file:write:after, etc.).
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```typescript
|
|
390
|
+
* const content = await codemap.fs.read('src/index.ts');
|
|
391
|
+
* await codemap.fs.write('src/new.ts', 'export const x = 1;');
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
get fs() {
|
|
395
|
+
return {
|
|
396
|
+
read: (path) => this.fsGateway.read(path),
|
|
397
|
+
write: async (path, content) => {
|
|
398
|
+
await this.fsGateway.write(path, content);
|
|
399
|
+
},
|
|
400
|
+
exists: (path) => this.fsGateway.exists(path)
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* I/O gateway access.
|
|
405
|
+
*
|
|
406
|
+
* Provides full filesystem operations with lifecycle event emission.
|
|
407
|
+
* Storage-agnostic: works with any FileSystemProvider (Node.js fs, database, memory, S3, etc.).
|
|
408
|
+
*
|
|
409
|
+
* All write operations (write, remove, rename, mkdir) emit lifecycle events
|
|
410
|
+
* that plugins hook into (TimeWarp, graph updates, logging, etc.).
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```typescript
|
|
414
|
+
* // Read operations
|
|
415
|
+
* const entries = await codemap.io.readdir(dirPath);
|
|
416
|
+
* const stats = await codemap.io.stat(filePath);
|
|
417
|
+
* const content = await codemap.io.read(filePath);
|
|
418
|
+
*
|
|
419
|
+
* // Write operations (emit events)
|
|
420
|
+
* await codemap.io.write(path, content); // Emits file:write:before/after
|
|
421
|
+
* await codemap.io.remove(path); // Emits file:delete
|
|
422
|
+
* await codemap.io.rename(oldPath, newPath); // Emits file:rename
|
|
423
|
+
* await codemap.io.mkdir(dirPath); // Creates directory
|
|
424
|
+
* await codemap.io.append(path, text); // Appends to file
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
get io() {
|
|
428
|
+
return this.fsGateway;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Target resolver access.
|
|
432
|
+
*
|
|
433
|
+
* Central resolution and formatting for all paths/symbols.
|
|
434
|
+
* Use this to convert between absolute paths and relative paths.
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```typescript
|
|
438
|
+
* const resolved = codemap.resolver.resolve('src/main/index.ts');
|
|
439
|
+
* const relativePath = resolved.relativePath; // "src/main/index.ts"
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
442
|
+
get resolver() {
|
|
443
|
+
return this.targetResolver;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Label store access.
|
|
447
|
+
*
|
|
448
|
+
* Manage labels for organizing and categorizing code entities.
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ```typescript
|
|
452
|
+
* const labels = await codemap.labels.list();
|
|
453
|
+
* await codemap.labels.assign('my-label', ['src/auth/login.ts']);
|
|
454
|
+
* ```
|
|
455
|
+
*/
|
|
456
|
+
get labels() {
|
|
457
|
+
return this._labelStore;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Group store access.
|
|
461
|
+
*
|
|
462
|
+
* Manage code groups for organizing related files and symbols.
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```typescript
|
|
466
|
+
* const groups = await codemap.groups.list();
|
|
467
|
+
* const group = await codemap.groups.get('auth-system');
|
|
468
|
+
* ```
|
|
469
|
+
*/
|
|
470
|
+
get groups() {
|
|
471
|
+
return this._groupStore;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Session transaction log access.
|
|
475
|
+
*
|
|
476
|
+
* Track changes and operations during a session.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```typescript
|
|
480
|
+
* const history = await codemap.sessions.list();
|
|
481
|
+
* const session = await codemap.sessions.get(sessionId);
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
484
|
+
get sessions() {
|
|
485
|
+
return this._sessionLog;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Annotation store access.
|
|
489
|
+
*
|
|
490
|
+
* Manage code annotations for documentation and metadata.
|
|
491
|
+
*
|
|
492
|
+
* @example
|
|
493
|
+
* ```typescript
|
|
494
|
+
* await codemap.annotations.add('src/auth.ts', {
|
|
495
|
+
* key: 'domain.name',
|
|
496
|
+
* value: 'Authentication System'
|
|
497
|
+
* });
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
500
|
+
get annotations() {
|
|
501
|
+
return this._annotationStore;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Register a lifecycle event handler.
|
|
505
|
+
*
|
|
506
|
+
* Implements CodeMapHost interface for plugins.
|
|
507
|
+
*
|
|
508
|
+
* @param event - Event name
|
|
509
|
+
* @param handler - Event handler
|
|
510
|
+
*/
|
|
511
|
+
on(event, handler) {
|
|
512
|
+
this.eventBus.on(event, handler);
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Remove event handler.
|
|
516
|
+
*
|
|
517
|
+
* @param event - Event name
|
|
518
|
+
* @param handler - Handler to remove
|
|
519
|
+
*/
|
|
520
|
+
off(event, handler) {
|
|
521
|
+
this.eventBus.off(event, handler);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Add a symbol to the graph.
|
|
525
|
+
*
|
|
526
|
+
* Implements CodeMapHost interface for plugins.
|
|
527
|
+
* Used by language parsers to enrich the graph.
|
|
528
|
+
*
|
|
529
|
+
* @param symbol - Symbol metadata
|
|
530
|
+
*/
|
|
531
|
+
addSymbol(symbol) {
|
|
532
|
+
// Add symbol to file's symbols array
|
|
533
|
+
const file = this.graph.getFile(symbol.file.relativePath);
|
|
534
|
+
if (!file) {
|
|
535
|
+
throw new Error(`Cannot add symbol: file not found: ${symbol.file.relativePath}`);
|
|
536
|
+
}
|
|
537
|
+
if (!file.symbols) {
|
|
538
|
+
file.symbols = [];
|
|
539
|
+
}
|
|
540
|
+
const symbolEntry = {
|
|
541
|
+
name: symbol.name,
|
|
542
|
+
kind: symbol.kind,
|
|
543
|
+
startLine: symbol.line,
|
|
544
|
+
startCol: 0,
|
|
545
|
+
endLine: symbol.line,
|
|
546
|
+
endCol: 0,
|
|
547
|
+
exported: false, // Parsers can override if available
|
|
548
|
+
// Deprecated fields for backward compatibility
|
|
549
|
+
line: symbol.line,
|
|
550
|
+
bodyEnd: symbol.line
|
|
551
|
+
};
|
|
552
|
+
file.symbols.push(symbolEntry);
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Add a dependency edge to the graph.
|
|
556
|
+
*
|
|
557
|
+
* Implements CodeMapHost interface for plugins.
|
|
558
|
+
* Used by parsers to track import relationships.
|
|
559
|
+
*
|
|
560
|
+
* @param from - Source file (relative path)
|
|
561
|
+
* @param to - Target file (relative path)
|
|
562
|
+
*/
|
|
563
|
+
addDependency(from, to) {
|
|
564
|
+
this.graph.addDependency(from, to);
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Get plugin-specific configuration from .codemap/config.json.
|
|
568
|
+
* Returns undefined if plugin config not present.
|
|
569
|
+
*
|
|
570
|
+
* @param pluginName - Name of the plugin (should match Plugin.name)
|
|
571
|
+
* @returns Plugin configuration object or undefined
|
|
572
|
+
*/
|
|
573
|
+
getPluginConfig(pluginName) {
|
|
574
|
+
if (!this._config || !this._config.plugins) {
|
|
575
|
+
return undefined;
|
|
576
|
+
}
|
|
577
|
+
return this._config.plugins[pluginName];
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Set plugin metadata on a file.
|
|
581
|
+
* Emits 'metadata:set' event for tracking.
|
|
582
|
+
*
|
|
583
|
+
* @param path - File path (relative or absolute)
|
|
584
|
+
* @param key - Metadata key (namespace: pluginName.fieldName)
|
|
585
|
+
* @param value - Metadata value (must be JSON-serializable)
|
|
586
|
+
*/
|
|
587
|
+
setMetadata(path, key, value) {
|
|
588
|
+
const file = this.graph.getFile(path);
|
|
589
|
+
if (!file) {
|
|
590
|
+
throw new Error(`File not found: ${path}`);
|
|
591
|
+
}
|
|
592
|
+
if (!file.metadata) {
|
|
593
|
+
file.metadata = {};
|
|
594
|
+
}
|
|
595
|
+
file.metadata[key] = value;
|
|
596
|
+
// Emit event for tracking
|
|
597
|
+
this.eventBus.emit('metadata:set', { path, key, value });
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Get plugin metadata from a file.
|
|
601
|
+
* Emits 'metadata:get' event for tracking.
|
|
602
|
+
*
|
|
603
|
+
* @param path - File path (relative or absolute)
|
|
604
|
+
* @param key - Metadata key (namespace: pluginName.fieldName)
|
|
605
|
+
* @returns Metadata value or undefined if not found
|
|
606
|
+
*/
|
|
607
|
+
getMetadata(path, key) {
|
|
608
|
+
const file = this.graph.getFile(path);
|
|
609
|
+
if (!file || !file.metadata) {
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
const value = file.metadata[key];
|
|
613
|
+
// Emit event for tracking
|
|
614
|
+
this.eventBus.emit('metadata:get', { path, key, value });
|
|
615
|
+
return value;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Get a file entry from the graph (read-only).
|
|
619
|
+
* Delegates to FileSystemGraph for consistent access.
|
|
620
|
+
*
|
|
621
|
+
* @param path - File path (relative or absolute)
|
|
622
|
+
* @returns File entry or undefined if not found
|
|
623
|
+
*/
|
|
624
|
+
getFile(path) {
|
|
625
|
+
return this.graph.getFile(path);
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Query the graph with advanced filters (read-only).
|
|
629
|
+
* Delegates to QueryEngine for consistent search behavior.
|
|
630
|
+
*
|
|
631
|
+
* @param options - Search options
|
|
632
|
+
* @returns Search results sorted by relevance
|
|
633
|
+
*/
|
|
634
|
+
queryGraph(options) {
|
|
635
|
+
const envelope = this.queryEngine.search({
|
|
636
|
+
query: options.query,
|
|
637
|
+
mode: options.mode || 'text',
|
|
638
|
+
maxResults: options.maxResults || 10,
|
|
639
|
+
});
|
|
640
|
+
// Extract results from envelope (handle empty data gracefully)
|
|
641
|
+
if (!envelope.data) {
|
|
642
|
+
return [];
|
|
643
|
+
}
|
|
644
|
+
return envelope.data.results.map(result => ({
|
|
645
|
+
file: result.file,
|
|
646
|
+
relevance: result.relevance,
|
|
647
|
+
reasons: result.reasons,
|
|
648
|
+
}));
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Get all files that import or are imported by a given file.
|
|
652
|
+
* Traverses the dependency graph recursively.
|
|
653
|
+
*
|
|
654
|
+
* @param path - File path (relative or absolute)
|
|
655
|
+
* @param direction - 'imports' (what it imports) or 'importers' (what imports it)
|
|
656
|
+
* @param maxDepth - Maximum traversal depth (default: 3)
|
|
657
|
+
* @returns Array of file entries in dependency chain
|
|
658
|
+
*/
|
|
659
|
+
traverseDependencies(path, direction, maxDepth = 3) {
|
|
660
|
+
const file = this.graph.getFile(path);
|
|
661
|
+
if (!file) {
|
|
662
|
+
return [];
|
|
663
|
+
}
|
|
664
|
+
const visited = new Set();
|
|
665
|
+
const results = [];
|
|
666
|
+
const traverse = (currentPath, depth) => {
|
|
667
|
+
if (depth > maxDepth || visited.has(currentPath)) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
visited.add(currentPath);
|
|
671
|
+
const current = this.graph.getFile(currentPath);
|
|
672
|
+
if (!current) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
// Get related paths based on direction
|
|
676
|
+
const relatedPaths = direction === 'imports'
|
|
677
|
+
? current.references
|
|
678
|
+
: current.referencedBy;
|
|
679
|
+
for (const relatedPath of relatedPaths) {
|
|
680
|
+
const relatedFile = this.graph.getFile(relatedPath);
|
|
681
|
+
if (relatedFile && !visited.has(relatedPath)) {
|
|
682
|
+
results.push(relatedFile);
|
|
683
|
+
traverse(relatedPath, depth + 1);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
traverse(path, 0);
|
|
688
|
+
return results;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Get graph statistics.
|
|
692
|
+
*
|
|
693
|
+
* @returns File/directory/symbol counts
|
|
694
|
+
*/
|
|
695
|
+
getStats() {
|
|
696
|
+
let symbolCount = 0;
|
|
697
|
+
for (const file of this.graph.getAllFiles()) {
|
|
698
|
+
symbolCount += file.symbols?.length || 0;
|
|
699
|
+
}
|
|
700
|
+
return {
|
|
701
|
+
files: this.graph.getFileCount(),
|
|
702
|
+
directories: this.graph.getDirectoryCount(),
|
|
703
|
+
symbols: symbolCount,
|
|
704
|
+
dependencies: this.graph.getDependencyCount()
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Get file entry by relative path.
|
|
709
|
+
* Returns file metadata including symbols if available.
|
|
710
|
+
/**
|
|
711
|
+
* Get registered plugins.
|
|
712
|
+
*
|
|
713
|
+
* @returns Array of plugin names
|
|
714
|
+
*/
|
|
715
|
+
getPlugins() {
|
|
716
|
+
return this.pluginRegistry.getRegisteredPlugins();
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Get plugin info (name, version, registration time).
|
|
720
|
+
* \n * @returns Array of plugin metadata
|
|
721
|
+
*/
|
|
722
|
+
getPluginInfo() {
|
|
723
|
+
return this.pluginRegistry.getPluginInfo();
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Get help registry.
|
|
727
|
+
*
|
|
728
|
+
* Provides access to the help topic registry for both core and plugin help content.
|
|
729
|
+
* Plugins can register their own help topics via this registry.
|
|
730
|
+
*
|
|
731
|
+
* @returns HelpRegistry instance
|
|
732
|
+
*/
|
|
733
|
+
get helpRegistry() {
|
|
734
|
+
return this._helpRegistry;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Get group store.
|
|
738
|
+
*
|
|
739
|
+
* Provides access to the persistent group storage for organizing code.
|
|
740
|
+
* Groups persist in .codemap/groups.json and survive reboots.
|
|
741
|
+
*
|
|
742
|
+
* @returns GroupStore instance
|
|
743
|
+
*/
|
|
744
|
+
get groupStore() {
|
|
745
|
+
return this._groupStore;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Get annotation store.
|
|
749
|
+
*
|
|
750
|
+
* Provides access to the annotation metadata storage system.
|
|
751
|
+
* Annotations persist in .codemap/annotations.json.
|
|
752
|
+
*
|
|
753
|
+
* @returns AnnotationStore instance
|
|
754
|
+
*/
|
|
755
|
+
get annotationStore() {
|
|
756
|
+
return this._annotationStore;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Get label store.
|
|
760
|
+
*
|
|
761
|
+
* Provides access to the persistent label system for organizing code.
|
|
762
|
+
* Labels persist in .codemap/labels.json and survive reboots.
|
|
763
|
+
*
|
|
764
|
+
* @returns LabelStore instance
|
|
765
|
+
*/
|
|
766
|
+
get labelStore() {
|
|
767
|
+
return this._labelStore;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Get backup manager.
|
|
771
|
+
*
|
|
772
|
+
* Provides access to the backup system for persistent storage files.
|
|
773
|
+
* Manages daily and turn-based backups with configurable retention.
|
|
774
|
+
*
|
|
775
|
+
* @returns BackupManager instance
|
|
776
|
+
*/
|
|
777
|
+
get backupManager() {
|
|
778
|
+
return this._backupManager;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Get display filter.
|
|
782
|
+
*
|
|
783
|
+
* Provides access to the hint and annotation suppression system.
|
|
784
|
+
* Reduces context pollution by tracking and suppressing repetitive content.
|
|
785
|
+
*
|
|
786
|
+
* @returns DisplayFilter instance
|
|
787
|
+
*/
|
|
788
|
+
get displayFilter() {
|
|
789
|
+
return this._displayFilter;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Get session transaction log.
|
|
793
|
+
*
|
|
794
|
+
* Provides access to the semi-persistent session tracking system.
|
|
795
|
+
* Transactions persist in .codemap/session-transactions.json until session close.
|
|
796
|
+
*
|
|
797
|
+
* @returns SessionTransactionLog instance
|
|
798
|
+
*/
|
|
799
|
+
get sessionLog() {
|
|
800
|
+
return this._sessionLog;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Get checklist store.
|
|
804
|
+
*
|
|
805
|
+
* Provides access to the persistent checklist system for workflow guidance.
|
|
806
|
+
* Checklists persist in .codemap/checklists.json (version controlled).
|
|
807
|
+
*
|
|
808
|
+
* @returns ChecklistStore instance
|
|
809
|
+
*/
|
|
810
|
+
get checklistStore() {
|
|
811
|
+
return this._checklistStore;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Get config.
|
|
815
|
+
*
|
|
816
|
+
* Provides access to the full config loaded from .codemap/config.json.
|
|
817
|
+
* Config is loaded asynchronously during initialization.
|
|
818
|
+
*
|
|
819
|
+
* @returns Config object
|
|
820
|
+
*/
|
|
821
|
+
get config() {
|
|
822
|
+
return this._config;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Set the parser registry.
|
|
826
|
+
* Called by the MCP server after creating ParserRegistry.
|
|
827
|
+
*
|
|
828
|
+
* @param registry - Parser registry instance
|
|
829
|
+
*/
|
|
830
|
+
setParserRegistry(registry) {
|
|
831
|
+
this.parserRegistry = registry;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Get loaded language parsers.
|
|
835
|
+
*
|
|
836
|
+
* @returns Array of parser metadata (name, version, extensions)
|
|
837
|
+
*/
|
|
838
|
+
getLoadedParsers() {
|
|
839
|
+
if (!this.parserRegistry) {
|
|
840
|
+
return [];
|
|
841
|
+
}
|
|
842
|
+
return this.parserRegistry.getLoadedParsers();
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Get a language parser that can handle the given file.
|
|
846
|
+
* Used for annotation manipulation and other parser-specific operations.
|
|
847
|
+
*
|
|
848
|
+
* @param filePath - File path to find parser for
|
|
849
|
+
* @returns LanguageParser instance or undefined
|
|
850
|
+
*/
|
|
851
|
+
getParserForFile(filePath) {
|
|
852
|
+
return this.pluginRegistry.getParserForFile(filePath);
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Collect orient contributions from all registered plugins.
|
|
856
|
+
* Emits `orient:contribute` event and gathers markdown sections from plugins.
|
|
857
|
+
*
|
|
858
|
+
* @returns Array of plugin contributions sorted by priority (high to low)
|
|
859
|
+
*/
|
|
860
|
+
async collectOrientContributions() {
|
|
861
|
+
const contributions = [];
|
|
862
|
+
// Emit orient:contribute event
|
|
863
|
+
// Plugins can push contributions to the array via the payload
|
|
864
|
+
await this.eventBus.emit('orient:contribute', { contributions });
|
|
865
|
+
// Sort by priority (higher first)
|
|
866
|
+
return contributions.sort((a, b) => (b.priority || 0) - (a.priority || 0));
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Cleanup and shutdown.
|
|
870
|
+
*
|
|
871
|
+
* Unregisters all plugins, clears event handlers.
|
|
872
|
+
* Call this before disposing of CodeMap instance.
|
|
873
|
+
*/
|
|
874
|
+
async dispose() {
|
|
875
|
+
await this.pluginRegistry.unregisterAll();
|
|
876
|
+
this.eventBus.removeAllListeners();
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
exports.CodeMap = CodeMap;
|
|
880
|
+
//# sourceMappingURL=CodeMap.js.map
|