@mycodemap/mycodemap 0.1.1 → 0.2.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/CHANGELOG.md +78 -0
- package/README.md +241 -67
- package/dist/cli/commands/ci.d.ts +7 -1
- package/dist/cli/commands/ci.d.ts.map +1 -1
- package/dist/cli/commands/ci.js +38 -0
- package/dist/cli/commands/ci.js.map +1 -1
- package/dist/cli/commands/export.d.ts +6 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +108 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +96 -0
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/server.d.ts +9 -0
- package/dist/cli/commands/server.d.ts.map +1 -0
- package/dist/cli/commands/server.js +68 -0
- package/dist/cli/commands/server.js.map +1 -0
- package/dist/cli/index.js +22 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli-new/commands/export.d.ts +15 -0
- package/dist/cli-new/commands/export.d.ts.map +1 -0
- package/dist/cli-new/commands/export.js +107 -0
- package/dist/cli-new/commands/export.js.map +1 -0
- package/dist/cli-new/commands/query.d.ts +14 -0
- package/dist/cli-new/commands/query.d.ts.map +1 -0
- package/dist/cli-new/commands/query.js +120 -0
- package/dist/cli-new/commands/query.js.map +1 -0
- package/dist/cli-new/commands/server.d.ts +13 -0
- package/dist/cli-new/commands/server.d.ts.map +1 -0
- package/dist/cli-new/commands/server.js +94 -0
- package/dist/cli-new/commands/server.js.map +1 -0
- package/dist/cli-new/index.d.ts +11 -0
- package/dist/cli-new/index.d.ts.map +1 -0
- package/dist/cli-new/index.js +63 -0
- package/dist/cli-new/index.js.map +1 -0
- package/dist/cli-new/types/index.d.ts +88 -0
- package/dist/cli-new/types/index.d.ts.map +1 -0
- package/dist/cli-new/types/index.js +7 -0
- package/dist/cli-new/types/index.js.map +1 -0
- package/dist/domain/entities/CodeGraph.d.ts +134 -0
- package/dist/domain/entities/CodeGraph.d.ts.map +1 -0
- package/dist/domain/entities/CodeGraph.js +316 -0
- package/dist/domain/entities/CodeGraph.js.map +1 -0
- package/dist/domain/entities/Dependency.d.ts +78 -0
- package/dist/domain/entities/Dependency.d.ts.map +1 -0
- package/dist/domain/entities/Dependency.js +132 -0
- package/dist/domain/entities/Dependency.js.map +1 -0
- package/dist/domain/entities/Module.d.ts +75 -0
- package/dist/domain/entities/Module.d.ts.map +1 -0
- package/dist/domain/entities/Module.js +151 -0
- package/dist/domain/entities/Module.js.map +1 -0
- package/dist/domain/entities/Project.d.ts +50 -0
- package/dist/domain/entities/Project.d.ts.map +1 -0
- package/dist/domain/entities/Project.js +99 -0
- package/dist/domain/entities/Project.js.map +1 -0
- package/dist/domain/entities/Symbol.d.ts +75 -0
- package/dist/domain/entities/Symbol.d.ts.map +1 -0
- package/dist/domain/entities/Symbol.js +130 -0
- package/dist/domain/entities/Symbol.js.map +1 -0
- package/dist/domain/events/DomainEvent.d.ts +76 -0
- package/dist/domain/events/DomainEvent.d.ts.map +1 -0
- package/dist/domain/events/DomainEvent.js +153 -0
- package/dist/domain/events/DomainEvent.js.map +1 -0
- package/dist/domain/index.d.ts +10 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +18 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/repositories/CodeGraphRepository.d.ts +58 -0
- package/dist/domain/repositories/CodeGraphRepository.d.ts.map +1 -0
- package/dist/domain/repositories/CodeGraphRepository.js +37 -0
- package/dist/domain/repositories/CodeGraphRepository.js.map +1 -0
- package/dist/domain/services/CodeGraphBuilder.d.ts +50 -0
- package/dist/domain/services/CodeGraphBuilder.d.ts.map +1 -0
- package/dist/domain/services/CodeGraphBuilder.js +121 -0
- package/dist/domain/services/CodeGraphBuilder.js.map +1 -0
- package/dist/infrastructure/parser/implementations/GoParser.d.ts +25 -0
- package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/GoParser.js +158 -0
- package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -0
- package/dist/infrastructure/parser/implementations/PythonParser.d.ts +30 -0
- package/dist/infrastructure/parser/implementations/PythonParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/PythonParser.js +201 -0
- package/dist/infrastructure/parser/implementations/PythonParser.js.map +1 -0
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +63 -0
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js +420 -0
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -0
- package/dist/infrastructure/parser/index.d.ts +13 -0
- package/dist/infrastructure/parser/index.d.ts.map +1 -0
- package/dist/infrastructure/parser/index.js +32 -0
- package/dist/infrastructure/parser/index.js.map +1 -0
- package/dist/infrastructure/parser/interfaces/ParserBase.d.ts +124 -0
- package/dist/infrastructure/parser/interfaces/ParserBase.d.ts.map +1 -0
- package/dist/infrastructure/parser/interfaces/ParserBase.js +200 -0
- package/dist/infrastructure/parser/interfaces/ParserBase.js.map +1 -0
- package/dist/infrastructure/parser/registry/ParserRegistry.d.ts +68 -0
- package/dist/infrastructure/parser/registry/ParserRegistry.d.ts.map +1 -0
- package/dist/infrastructure/parser/registry/ParserRegistry.js +116 -0
- package/dist/infrastructure/parser/registry/ParserRegistry.js.map +1 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts +44 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts.map +1 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js +129 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js.map +1 -0
- package/dist/infrastructure/repositories/index.d.ts +3 -0
- package/dist/infrastructure/repositories/index.d.ts.map +1 -0
- package/dist/infrastructure/repositories/index.js +7 -0
- package/dist/infrastructure/repositories/index.js.map +1 -0
- package/dist/infrastructure/storage/StorageFactory.d.ts +53 -0
- package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -0
- package/dist/infrastructure/storage/StorageFactory.js +150 -0
- package/dist/infrastructure/storage/StorageFactory.js.map +1 -0
- package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts +52 -0
- package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts.map +1 -0
- package/dist/infrastructure/storage/adapters/FileSystemStorage.js +315 -0
- package/dist/infrastructure/storage/adapters/FileSystemStorage.js.map +1 -0
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts +52 -0
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts.map +1 -0
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.js +235 -0
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.js.map +1 -0
- package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts +37 -0
- package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts.map +1 -0
- package/dist/infrastructure/storage/adapters/MemoryStorage.js +229 -0
- package/dist/infrastructure/storage/adapters/MemoryStorage.js.map +1 -0
- package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts +49 -0
- package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts.map +1 -0
- package/dist/infrastructure/storage/adapters/Neo4jStorage.js +222 -0
- package/dist/infrastructure/storage/adapters/Neo4jStorage.js.map +1 -0
- package/dist/infrastructure/storage/index.d.ts +6 -0
- package/dist/infrastructure/storage/index.d.ts.map +1 -0
- package/dist/infrastructure/storage/index.js +13 -0
- package/dist/infrastructure/storage/index.js.map +1 -0
- package/dist/infrastructure/storage/interfaces/StorageBase.d.ts +76 -0
- package/dist/infrastructure/storage/interfaces/StorageBase.d.ts.map +1 -0
- package/dist/infrastructure/storage/interfaces/StorageBase.js +116 -0
- package/dist/infrastructure/storage/interfaces/StorageBase.js.map +1 -0
- package/dist/interface/config/index.d.ts +102 -0
- package/dist/interface/config/index.d.ts.map +1 -0
- package/dist/interface/config/index.js +7 -0
- package/dist/interface/config/index.js.map +1 -0
- package/dist/interface/types/index.d.ts +425 -0
- package/dist/interface/types/index.d.ts.map +1 -0
- package/dist/interface/types/index.js +8 -0
- package/dist/interface/types/index.js.map +1 -0
- package/dist/interface/types/parser.d.ts +103 -0
- package/dist/interface/types/parser.d.ts.map +1 -0
- package/dist/interface/types/parser.js +7 -0
- package/dist/interface/types/parser.js.map +1 -0
- package/dist/interface/types/storage.d.ts +98 -0
- package/dist/interface/types/storage.d.ts.map +1 -0
- package/dist/interface/types/storage.js +7 -0
- package/dist/interface/types/storage.js.map +1 -0
- package/dist/orchestrator/test-linker.js +1 -1
- package/dist/orchestrator/test-linker.js.map +1 -1
- package/dist/server/CodeMapServer.d.ts +51 -0
- package/dist/server/CodeMapServer.d.ts.map +1 -0
- package/dist/server/CodeMapServer.js +146 -0
- package/dist/server/CodeMapServer.js.map +1 -0
- package/dist/server/handlers/AnalysisHandler.d.ts +82 -0
- package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -0
- package/dist/server/handlers/AnalysisHandler.js +196 -0
- package/dist/server/handlers/AnalysisHandler.js.map +1 -0
- package/dist/server/handlers/QueryHandler.d.ts +57 -0
- package/dist/server/handlers/QueryHandler.d.ts.map +1 -0
- package/dist/server/handlers/QueryHandler.js +260 -0
- package/dist/server/handlers/QueryHandler.js.map +1 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +13 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/routes/api.d.ts +8 -0
- package/dist/server/routes/api.d.ts.map +1 -0
- package/dist/server/routes/api.js +372 -0
- package/dist/server/routes/api.js.map +1 -0
- package/dist/server/types/index.d.ts +171 -0
- package/dist/server/types/index.d.ts.map +1 -0
- package/dist/server/types/index.js +7 -0
- package/dist/server/types/index.js.map +1 -0
- package/dist/types/index.d.ts +6 -372
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +9 -3
- package/dist/types/index.js.map +1 -1
- package/docs/AI_ASSISTANT_SETUP.md +68 -0
- package/docs/PUBLISHING.md +162 -0
- package/docs/README.md +37 -0
- package/docs/SETUP_GUIDE.md +91 -5
- package/docs/ai-guide/COMMANDS.md +369 -0
- package/docs/ai-guide/INTEGRATION.md +513 -0
- package/docs/ai-guide/OUTPUT.md +465 -0
- package/docs/ai-guide/PATTERNS.md +409 -0
- package/docs/ai-guide/PROMPTS.md +414 -0
- package/docs/ai-guide/QUICKSTART.md +114 -0
- package/docs/ai-guide/README.md +66 -0
- package/docs/archive/AI_INTEGRATION_GUIDE_ARCHIVED.md +7 -1
- package/docs/archive/ARCHIVE.md +39 -0
- package/docs/archive/MYCLAUDE_GUIDE.md +305 -0
- package/docs/archive/PUBLISH_NPM_DESIGN_V1.md +6 -0
- package/docs/archive/PUBLISH_NPM_DESIGN_V2.md +6 -0
- package/docs/archive/README.md +29 -0
- package/docs/archive/TASK_DESIGN_COVERAGE_REPORT.md +6 -0
- package/docs/archive/TEST_SUMMARY.md +140 -0
- package/docs/archive/comprehensive_test_report.md +337 -0
- package/docs/{CI_GATEWAY_DESIGN.md → archive/design-docs/CI_GATEWAY_DESIGN.md} +6 -0
- package/docs/{PUBLISH_NPM_DESIGN_FINAL.md → archive/design-docs/PUBLISH_NPM_DESIGN_FINAL.md} +7 -1
- package/docs/{REFACTOR_ARCHITECTURE_OVERVIEW.md → archive/design-docs/REFACTOR_ARCHITECTURE_OVERVIEW.md} +8 -2
- package/docs/{REFACTOR_CONFIDENCE_DESIGN.md → archive/design-docs/REFACTOR_CONFIDENCE_DESIGN.md} +6 -0
- package/docs/{REFACTOR_GIT_ANALYZER_DESIGN.md → archive/design-docs/REFACTOR_GIT_ANALYZER_DESIGN.md} +8 -2
- package/docs/{REFACTOR_ORCHESTRATOR_DESIGN.md → archive/design-docs/REFACTOR_ORCHESTRATOR_DESIGN.md} +6 -0
- package/docs/{REFACTOR_RESULT_FUSION_DESIGN.md → archive/design-docs/REFACTOR_RESULT_FUSION_DESIGN.md} +6 -0
- package/docs/{REFACTOR_TEST_LINKER_DESIGN.md → archive/design-docs/REFACTOR_TEST_LINKER_DESIGN.md} +6 -0
- package/docs/archive/myclaude.md +1084 -0
- package/docs/archive/plans/2026-03-14-go-language-support-design.md +92 -0
- package/docs/{REFACTOR_REQUIREMENTS.md → archive/product-specs/REFACTOR_REQUIREMENTS.md} +11 -5
- package/docs/archive/scenario-2-deps-analysis.md +353 -0
- package/docs/archive/test-report-symbol-search.md +384 -0
- package/docs/archive/test-scenario-4-complexity-analysis.md +460 -0
- package/docs/archive/test_report_scenario5.md +615 -0
- package/docs/archive/test_scenario_3_impact_analysis_report.md +520 -0
- package/docs/design-docs/README.md +26 -0
- package/docs/exec-plans/MVP3-IMPLEMENTATION-ROADMAP.md +524 -0
- package/docs/exec-plans/README.md +29 -0
- package/docs/exec-plans/active/.gitkeep +0 -0
- package/docs/exec-plans/completed/.gitkeep +0 -0
- package/docs/{plans/POST_TASK_PLAN.md → exec-plans/completed/2026-03-03-post-task-plan.md} +9 -3
- package/docs/exec-plans/completed/harness-engineering-rollout.md +184 -0
- package/docs/exec-plans/tech-debt/.gitkeep +0 -0
- package/docs/exec-plans/tech-debt/2026-03-15-lint-guardrail-gap.md +30 -0
- package/docs/generated/README.md +19 -0
- package/docs/product-specs/MVP3-ARCHITECTURE-COMPARISON.md +504 -0
- package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-PRD.md +322 -0
- package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-TECH-PRD.md +1374 -0
- package/docs/product-specs/README.md +22 -0
- package/docs/references/README.md +15 -0
- package/docs/references/tmp.md +527 -0
- package/docs/rules/README.md +16 -0
- package/docs/rules/architecture-guardrails.md +349 -0
- package/docs/rules/code-quality-redlines.md +321 -0
- package/docs/rules/deployment.md +23 -0
- package/docs/rules/engineering-with-codex-openai.md +202 -0
- package/docs/rules/testing.md +73 -0
- package/docs/rules/validation.md +39 -0
- package/package.json +19 -6
- package/docs/OMC_TEAM_DEBUG_REPORT.md +0 -285
- /package/docs/{plans/archive → exec-plans/completed}/2026-03-03-deps-path-extension-fix.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryHandler.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/QueryHandler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,QAAQ;IAErC;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAsB1F;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAkB1F;;OAEG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAqC7E;;OAEG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAmB7E;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA4CpF;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAYrD;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAqBtD;;OAEG;IACG,kBAAkB,CAAC,MAAM,GAAE,gBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAmBzF;;OAEG;IACG,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAgBrE;;OAEG;IACG,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAoBrE,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,gBAAgB;CAOzB"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
// [META] since:2026-03 | owner:architecture-team | stable:true
|
|
2
|
+
// [WHY] Query handler - handles read-only queries against the code graph
|
|
3
|
+
// ============================================
|
|
4
|
+
// 查询处理器 - 处理针对代码图的只读查询
|
|
5
|
+
// ============================================
|
|
6
|
+
/**
|
|
7
|
+
* 查询处理器
|
|
8
|
+
*
|
|
9
|
+
* 职责:
|
|
10
|
+
* - 处理所有只读查询操作
|
|
11
|
+
* - 协调存储层和响应转换
|
|
12
|
+
* - 支持搜索、过滤、分页
|
|
13
|
+
*/
|
|
14
|
+
export class QueryHandler {
|
|
15
|
+
storage;
|
|
16
|
+
constructor(storage) {
|
|
17
|
+
this.storage = storage;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 搜索符号
|
|
21
|
+
*/
|
|
22
|
+
async searchSymbols(request) {
|
|
23
|
+
const limit = request.limit ?? 50;
|
|
24
|
+
const symbols = await this.storage.findSymbolByName(request.query);
|
|
25
|
+
const items = symbols.slice(0, limit).map(symbol => ({
|
|
26
|
+
id: symbol.id,
|
|
27
|
+
name: symbol.name,
|
|
28
|
+
kind: symbol.kind,
|
|
29
|
+
visibility: symbol.visibility,
|
|
30
|
+
location: symbol.location,
|
|
31
|
+
module: {
|
|
32
|
+
id: symbol.moduleId,
|
|
33
|
+
path: symbol.location.file,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
return {
|
|
37
|
+
items,
|
|
38
|
+
total: symbols.length,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 搜索模块
|
|
43
|
+
*/
|
|
44
|
+
async searchModules(request) {
|
|
45
|
+
const limit = request.limit ?? 50;
|
|
46
|
+
const modules = await this.storage.findModulesByPath(request.query);
|
|
47
|
+
const items = [];
|
|
48
|
+
for (const module of modules.slice(0, limit)) {
|
|
49
|
+
const detail = await this.getModuleDetail(module.id);
|
|
50
|
+
if (detail) {
|
|
51
|
+
items.push(detail);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
items,
|
|
56
|
+
total: modules.length,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 获取模块详情
|
|
61
|
+
*/
|
|
62
|
+
async getModuleDetail(moduleId) {
|
|
63
|
+
const module = await this.storage.findModuleById(moduleId);
|
|
64
|
+
if (!module)
|
|
65
|
+
return null;
|
|
66
|
+
const dependencies = await this.storage.findDependencies(moduleId);
|
|
67
|
+
const dependents = await this.storage.findDependents(moduleId);
|
|
68
|
+
// 获取模块的所有符号
|
|
69
|
+
const graph = await this.storage.loadCodeGraph();
|
|
70
|
+
const symbols = graph.symbols
|
|
71
|
+
.filter(s => s.moduleId === moduleId)
|
|
72
|
+
.map(s => ({
|
|
73
|
+
id: s.id,
|
|
74
|
+
name: s.name,
|
|
75
|
+
kind: s.kind,
|
|
76
|
+
visibility: s.visibility,
|
|
77
|
+
}));
|
|
78
|
+
return {
|
|
79
|
+
id: module.id,
|
|
80
|
+
path: module.path,
|
|
81
|
+
language: module.language,
|
|
82
|
+
stats: module.stats,
|
|
83
|
+
symbols,
|
|
84
|
+
dependencies: dependencies.map(d => ({
|
|
85
|
+
id: d.id,
|
|
86
|
+
targetPath: this.findModulePath(graph, d.targetId) ?? d.targetId,
|
|
87
|
+
type: d.type,
|
|
88
|
+
})),
|
|
89
|
+
dependents: dependents.map(d => ({
|
|
90
|
+
id: d.id,
|
|
91
|
+
sourcePath: this.findModulePath(graph, d.sourceId) ?? d.sourceId,
|
|
92
|
+
type: d.type,
|
|
93
|
+
})),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 获取符号详情
|
|
98
|
+
*/
|
|
99
|
+
async getSymbolDetail(symbolId) {
|
|
100
|
+
const symbol = await this.storage.findSymbolById(symbolId);
|
|
101
|
+
if (!symbol)
|
|
102
|
+
return null;
|
|
103
|
+
const module = await this.storage.findModuleById(symbol.moduleId);
|
|
104
|
+
return {
|
|
105
|
+
id: symbol.id,
|
|
106
|
+
name: symbol.name,
|
|
107
|
+
kind: symbol.kind,
|
|
108
|
+
visibility: symbol.visibility,
|
|
109
|
+
location: symbol.location,
|
|
110
|
+
module: {
|
|
111
|
+
id: symbol.moduleId,
|
|
112
|
+
path: module?.path ?? symbol.location.file,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 影响分析
|
|
118
|
+
*/
|
|
119
|
+
async analyzeImpact(request) {
|
|
120
|
+
const depth = request.depth ?? Infinity;
|
|
121
|
+
const result = await this.storage.calculateImpact(request.moduleId, depth);
|
|
122
|
+
const graph = await this.storage.loadCodeGraph();
|
|
123
|
+
// 构建受影响模块的层级信息
|
|
124
|
+
const affectedWithDepth = [];
|
|
125
|
+
const visited = new Set();
|
|
126
|
+
const queue = [{ id: request.moduleId, level: 0 }];
|
|
127
|
+
while (queue.length > 0) {
|
|
128
|
+
const { id, level } = queue.shift();
|
|
129
|
+
if (visited.has(id) || level > depth)
|
|
130
|
+
continue;
|
|
131
|
+
visited.add(id);
|
|
132
|
+
if (level > 0) {
|
|
133
|
+
const module = graph.modules.find(m => m.id === id);
|
|
134
|
+
if (module) {
|
|
135
|
+
affectedWithDepth.push({
|
|
136
|
+
id: module.id,
|
|
137
|
+
path: module.path,
|
|
138
|
+
depth: level,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 查找依赖此模块的其他模块
|
|
143
|
+
for (const dep of graph.dependencies) {
|
|
144
|
+
if (dep.targetId === id && !visited.has(dep.sourceId)) {
|
|
145
|
+
queue.push({ id: dep.sourceId, level: level + 1 });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
rootModule: result.rootModule,
|
|
151
|
+
affectedModules: affectedWithDepth,
|
|
152
|
+
totalAffected: affectedWithDepth.length,
|
|
153
|
+
maxDepth: Math.max(...affectedWithDepth.map(m => m.depth), 0),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 检测循环依赖
|
|
158
|
+
*/
|
|
159
|
+
async detectCycles() {
|
|
160
|
+
const cycles = await this.storage.detectCycles();
|
|
161
|
+
return {
|
|
162
|
+
cycles: cycles.map(cycle => ({
|
|
163
|
+
modules: cycle.modules,
|
|
164
|
+
length: cycle.length,
|
|
165
|
+
})),
|
|
166
|
+
totalCycles: cycles.length,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 获取项目统计
|
|
171
|
+
*/
|
|
172
|
+
async getProjectStats() {
|
|
173
|
+
const stats = await this.storage.getStatistics();
|
|
174
|
+
const graph = await this.storage.loadCodeGraph();
|
|
175
|
+
// 计算语言分布
|
|
176
|
+
const languageDistribution = {};
|
|
177
|
+
for (const module of graph.modules) {
|
|
178
|
+
languageDistribution[module.language] =
|
|
179
|
+
(languageDistribution[module.language] ?? 0) + 1;
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
totalModules: stats.totalModules,
|
|
183
|
+
totalSymbols: stats.totalSymbols,
|
|
184
|
+
totalDependencies: stats.totalDependencies,
|
|
185
|
+
totalLines: stats.totalLines,
|
|
186
|
+
averageComplexity: stats.averageComplexity,
|
|
187
|
+
languageDistribution,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* 获取依赖图数据(用于可视化)
|
|
192
|
+
*/
|
|
193
|
+
async getDependencyGraph(params = {}) {
|
|
194
|
+
const graph = await this.storage.loadCodeGraph();
|
|
195
|
+
const nodes = graph.modules.map(module => ({
|
|
196
|
+
id: module.id,
|
|
197
|
+
label: module.path.split('/').pop() ?? module.path,
|
|
198
|
+
type: 'module',
|
|
199
|
+
category: this.categorizeModule(module.path),
|
|
200
|
+
}));
|
|
201
|
+
const edges = graph.dependencies.map(dep => ({
|
|
202
|
+
from: dep.sourceId,
|
|
203
|
+
to: dep.targetId,
|
|
204
|
+
type: dep.type,
|
|
205
|
+
}));
|
|
206
|
+
return { nodes, edges };
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* 获取调用关系
|
|
210
|
+
*/
|
|
211
|
+
async getCallers(functionId) {
|
|
212
|
+
const callers = await this.storage.findCallers(functionId);
|
|
213
|
+
return callers.map(symbol => ({
|
|
214
|
+
id: symbol.id,
|
|
215
|
+
name: symbol.name,
|
|
216
|
+
kind: symbol.kind,
|
|
217
|
+
visibility: symbol.visibility,
|
|
218
|
+
location: symbol.location,
|
|
219
|
+
module: {
|
|
220
|
+
id: symbol.moduleId,
|
|
221
|
+
path: symbol.location.file,
|
|
222
|
+
},
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* 获取被调用关系
|
|
227
|
+
*/
|
|
228
|
+
async getCallees(functionId) {
|
|
229
|
+
const callees = await this.storage.findCallees(functionId);
|
|
230
|
+
return callees.map(symbol => ({
|
|
231
|
+
id: symbol.id,
|
|
232
|
+
name: symbol.name,
|
|
233
|
+
kind: symbol.kind,
|
|
234
|
+
visibility: symbol.visibility,
|
|
235
|
+
location: symbol.location,
|
|
236
|
+
module: {
|
|
237
|
+
id: symbol.moduleId,
|
|
238
|
+
path: symbol.location.file,
|
|
239
|
+
},
|
|
240
|
+
}));
|
|
241
|
+
}
|
|
242
|
+
// ============================================
|
|
243
|
+
// 私有方法
|
|
244
|
+
// ============================================
|
|
245
|
+
findModulePath(graph, moduleId) {
|
|
246
|
+
return graph.modules.find(m => m.id === moduleId)?.path;
|
|
247
|
+
}
|
|
248
|
+
categorizeModule(path) {
|
|
249
|
+
if (path.includes('test') || path.includes('spec'))
|
|
250
|
+
return 'test';
|
|
251
|
+
if (path.includes('config'))
|
|
252
|
+
return 'config';
|
|
253
|
+
if (path.includes('util') || path.includes('helper'))
|
|
254
|
+
return 'utility';
|
|
255
|
+
if (path.includes('type') || path.includes('interface'))
|
|
256
|
+
return 'type';
|
|
257
|
+
return 'source';
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=QueryHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryHandler.js","sourceRoot":"","sources":["../../../src/server/handlers/QueryHandler.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,yEAAyE;AACzE,+CAA+C;AAC/C,uBAAuB;AACvB,+CAA+C;AAgB/C;;;;;;;GAOG;AACH,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;IAEzC;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAsB;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEnE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACnD,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE;gBACN,EAAE,EAAE,MAAM,CAAC,QAAQ;gBACnB,IAAI,EAAE,MAAM,CAAC,QAAQ,C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,CAAC,QAAQ;gBACnB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI;aAC3B;SACF,CAAC,CAAC,CAAC;IACN,CAAC;IAED,+CAA+C;IAC/C,OAAO;IACP,+CAA+C;IAEvC,cAAc,CAAC,KAAuD,EAAE,QAAgB;QAC9F,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,EAAE,IAAI,CAAC;IAC1D,CAAC;IAEO,gBAAgB,CAAC,IAAY;QACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;QAClE,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,QAAQ,CAAC;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,SAAS,CAAC;QACvE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,MAAM,CAAC;QACvE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CodeMapServer } from './CodeMapServer.js';
|
|
2
|
+
export { QueryHandler } from './handlers/QueryHandler.js';
|
|
3
|
+
export { AnalysisHandler } from './handlers/AnalysisHandler.js';
|
|
4
|
+
export { createApiRoutes } from './routes/api.js';
|
|
5
|
+
export type { ServerConfig, ApiResponse, SearchRequest, SearchResponse, ImpactAnalysisRequest, ImpactAnalysisResponse, CycleDetectionResponse, ProjectStatsResponse, ModuleDetailResponse, SymbolDetailResponse, DependencyGraphResponse, PaginationParams, } from './types/index.js';
|
|
6
|
+
export type { AnalyzeRequest, AnalyzeResponse, IncrementalUpdateRequest, } from './handlers/AnalysisHandler.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,YAAY,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,cAAc,EACd,eAAe,EACf,wBAAwB,GACzB,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// [META] since:2026-03 | owner:architecture-team | stable:true
|
|
2
|
+
// [WHY] Server layer exports - central entry point for HTTP API server
|
|
3
|
+
// ============================================
|
|
4
|
+
// Server 层导出 - HTTP API 服务器的中央入口点
|
|
5
|
+
// ============================================
|
|
6
|
+
// 主服务器类
|
|
7
|
+
export { CodeMapServer } from './CodeMapServer.js';
|
|
8
|
+
// 处理器
|
|
9
|
+
export { QueryHandler } from './handlers/QueryHandler.js';
|
|
10
|
+
export { AnalysisHandler } from './handlers/AnalysisHandler.js';
|
|
11
|
+
// 路由
|
|
12
|
+
export { createApiRoutes } from './routes/api.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,uEAAuE;AACvE,+CAA+C;AAC/C,kCAAkC;AAClC,+CAA+C;AAE/C,QAAQ;AACR,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM;AACN,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,KAAK;AACL,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import type { QueryHandler } from '../handlers/QueryHandler.js';
|
|
3
|
+
import type { AnalysisHandler } from '../handlers/AnalysisHandler.js';
|
|
4
|
+
/**
|
|
5
|
+
* 创建 API 路由
|
|
6
|
+
*/
|
|
7
|
+
export declare function createApiRoutes(queryHandler: QueryHandler, analysisHandler: AnalysisHandler): Hono;
|
|
8
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/server/routes/api.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQtE;;GAEG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAC/B,IAAI,CAmXN"}
|