@mycodemap/mycodemap 0.1.1 → 0.3.4
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 +163 -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/commands/ship/analyzer.d.ts +26 -0
- package/dist/cli/commands/ship/analyzer.d.ts.map +1 -0
- package/dist/cli/commands/ship/analyzer.js +143 -0
- package/dist/cli/commands/ship/analyzer.js.map +1 -0
- package/dist/cli/commands/ship/checker.d.ts +20 -0
- package/dist/cli/commands/ship/checker.d.ts.map +1 -0
- package/dist/cli/commands/ship/checker.js +86 -0
- package/dist/cli/commands/ship/checker.js.map +1 -0
- package/dist/cli/commands/ship/index.d.ts +17 -0
- package/dist/cli/commands/ship/index.d.ts.map +1 -0
- package/dist/cli/commands/ship/index.js +51 -0
- package/dist/cli/commands/ship/index.js.map +1 -0
- package/dist/cli/commands/ship/monitor.d.ts +19 -0
- package/dist/cli/commands/ship/monitor.d.ts.map +1 -0
- package/dist/cli/commands/ship/monitor.js +105 -0
- package/dist/cli/commands/ship/monitor.js.map +1 -0
- package/dist/cli/commands/ship/pipeline.d.ts +23 -0
- package/dist/cli/commands/ship/pipeline.d.ts.map +1 -0
- package/dist/cli/commands/ship/pipeline.js +146 -0
- package/dist/cli/commands/ship/pipeline.js.map +1 -0
- package/dist/cli/commands/ship/publisher.d.ts +11 -0
- package/dist/cli/commands/ship/publisher.d.ts.map +1 -0
- package/dist/cli/commands/ship/publisher.js +75 -0
- package/dist/cli/commands/ship/publisher.js.map +1 -0
- package/dist/cli/commands/ship/rules/confidence-rules.d.ts +48 -0
- package/dist/cli/commands/ship/rules/confidence-rules.d.ts.map +1 -0
- package/dist/cli/commands/ship/rules/confidence-rules.js +122 -0
- package/dist/cli/commands/ship/rules/confidence-rules.js.map +1 -0
- package/dist/cli/commands/ship/rules/quality-rules.d.ts +25 -0
- package/dist/cli/commands/ship/rules/quality-rules.d.ts.map +1 -0
- package/dist/cli/commands/ship/rules/quality-rules.js +134 -0
- package/dist/cli/commands/ship/rules/quality-rules.js.map +1 -0
- package/dist/cli/commands/ship/rules/version-rules.d.ts +24 -0
- package/dist/cli/commands/ship/rules/version-rules.d.ts.map +1 -0
- package/dist/cli/commands/ship/rules/version-rules.js +75 -0
- package/dist/cli/commands/ship/rules/version-rules.js.map +1 -0
- package/dist/cli/commands/ship/versioner.d.ts +12 -0
- package/dist/cli/commands/ship/versioner.d.ts.map +1 -0
- package/dist/cli/commands/ship/versioner.js +92 -0
- package/dist/cli/commands/ship/versioner.js.map +1 -0
- package/dist/cli/index.js +31 -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 +472 -0
- package/docs/README.md +37 -0
- package/docs/SETUP_GUIDE.md +91 -5
- package/docs/ai-guide/COMMANDS.md +403 -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/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/pre-release-checklist.md +426 -0
- package/docs/rules/testing.md +73 -0
- package/docs/rules/validation.md +39 -0
- package/package.json +26 -7
- package/scripts/.githooks/commit-msg +31 -0
- package/scripts/.githooks/pre-commit +55 -0
- package/scripts/benchmark.ts +209 -0
- package/scripts/hooks/commit-msg +24 -0
- package/scripts/hooks/install-hooks.sh +29 -0
- package/scripts/hooks/pre-commit +60 -0
- package/scripts/pre-release-check.js +717 -0
- package/scripts/release.sh +142 -0
- package/scripts/run-benchmark.sh +29 -0
- package/scripts/validate-ai-docs.js +294 -0
- package/scripts/validate-docs.js +238 -0
- package/scripts/validate-pack.js +86 -0
- package/dist/ai/claude.d.ts +0 -38
- package/dist/ai/claude.d.ts.map +0 -1
- package/dist/ai/claude.js +0 -169
- package/dist/ai/claude.js.map +0 -1
- package/dist/ai/codex.d.ts +0 -38
- package/dist/ai/codex.d.ts.map +0 -1
- package/dist/ai/codex.js +0 -169
- package/dist/ai/codex.js.map +0 -1
- package/dist/ai/factory.d.ts +0 -48
- package/dist/ai/factory.d.ts.map +0 -1
- package/dist/ai/factory.js +0 -95
- package/dist/ai/factory.js.map +0 -1
- package/dist/ai/index.d.ts +0 -12
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -29
- package/dist/ai/index.js.map +0 -1
- package/dist/ai/provider.d.ts +0 -70
- package/dist/ai/provider.d.ts.map +0 -1
- package/dist/ai/provider.js +0 -31
- package/dist/ai/provider.js.map +0 -1
- package/dist/ai/subagent-caller.d.ts +0 -90
- package/dist/ai/subagent-caller.d.ts.map +0 -1
- package/dist/ai/subagent-caller.js +0 -280
- package/dist/ai/subagent-caller.js.map +0 -1
- package/dist/ai/types.d.ts +0 -70
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/ai/types.js +0 -5
- package/dist/ai/types.js.map +0 -1
- package/dist/generator/ai-overview.d.ts +0 -51
- package/dist/generator/ai-overview.d.ts.map +0 -1
- package/dist/generator/ai-overview.js +0 -160
- package/dist/generator/ai-overview.js.map +0 -1
- package/dist/orchestrator/ai-feed-generator.d.ts +0 -210
- package/dist/orchestrator/ai-feed-generator.d.ts.map +0 -1
- package/dist/orchestrator/ai-feed-generator.js +0 -377
- package/dist/orchestrator/ai-feed-generator.js.map +0 -1
- 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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,169 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.3.4] - 2026-03-23 - CI Pipeline Fixes
|
|
6
|
+
|
|
7
|
+
### 🔧 Configuration
|
|
8
|
+
|
|
9
|
+
- **CI**: 修复 `.gitignore` 规则,允许 `scripts/*.js` 用于 CI 验证
|
|
10
|
+
- **CI**: 添加 `docs/rules/testing.md` 到 git 跟踪
|
|
11
|
+
- **CI**: 移除无效的 `ai-feed.txt` git diff 检查
|
|
12
|
+
- **package**: 添加 `package-lock.json` 到 git 解决 CI 依赖问题
|
|
13
|
+
|
|
14
|
+
## [0.3.3] - 2026-03-23 - Ship Command Improvements
|
|
15
|
+
|
|
16
|
+
### 🐛 Bug Fixes
|
|
17
|
+
|
|
18
|
+
- **ship**: 修复 commit 解析支持 `[TYPE]` 格式
|
|
19
|
+
- **ship**: 修复 conventional commits 校验正则表达式
|
|
20
|
+
- **ship**: 添加 CONFIG/INFRA 类型支持
|
|
21
|
+
- **ship**: 修复版本 commit message 格式 (使用 CONFIG 标签)
|
|
22
|
+
|
|
23
|
+
### 🔧 Configuration
|
|
24
|
+
|
|
25
|
+
- **ship**: 同步 package.json 与 CHANGELOG 版本
|
|
26
|
+
|
|
27
|
+
## [0.3.0] - 2026-03-23 - One-Click Ship Command
|
|
28
|
+
|
|
29
|
+
### 🚀 New Features
|
|
30
|
+
|
|
31
|
+
- **ship**: 新增 `codemap ship` 一键智能发布命令
|
|
32
|
+
- 自动分析 commits 并检测变更类型
|
|
33
|
+
- 基于 conventional commits 规范计算版本号
|
|
34
|
+
- mustPass/shouldPass 质量检查 + 置信度评分
|
|
35
|
+
- npm 发布(支持 OIDC 认证)+ git tag
|
|
36
|
+
- GitHub Actions CI 状态轮询监控
|
|
37
|
+
|
|
38
|
+
### 📦 CLI Enhancements
|
|
39
|
+
|
|
40
|
+
- **新增命令**: `codemap ship [--dry-run] [--verbose] [--yes]`
|
|
41
|
+
- `--dry-run`: 仅分析不发布
|
|
42
|
+
- `--verbose`: 显示详细输出
|
|
43
|
+
- `--yes`: 置信度 60-75 时自动确认
|
|
44
|
+
|
|
45
|
+
## [0.2.1] - 2026-03-23 - AI Documentation & Quality Improvements
|
|
46
|
+
|
|
47
|
+
### 🐛 Bug Fixes
|
|
48
|
+
|
|
49
|
+
- **export**: 修复 Mermaid 导出空输出问题,正确保存到 MVP3 存储
|
|
50
|
+
- **cli**: 修复 export 命令 Mermaid 格式输出为空的问题
|
|
51
|
+
- **orchestrator**: 修复 test-linker 中 glob ESM 导入问题
|
|
52
|
+
|
|
53
|
+
### 📚 Documentation Enhancements
|
|
54
|
+
|
|
55
|
+
#### AI 友好文档系统
|
|
56
|
+
- 新增 `AI_GUIDE.md` - AI 专属快速参考文档
|
|
57
|
+
- 新增 `docs/ai-guide/` 目录结构,包含:
|
|
58
|
+
- `QUICKSTART.md` - 快速开始与场景映射
|
|
59
|
+
- `COMMANDS.md` - 完整 CLI 命令参数参考
|
|
60
|
+
- `OUTPUT.md` - JSON 输出结构与 TypeScript 类型定义
|
|
61
|
+
- `PATTERNS.md` - 标准工作流模式
|
|
62
|
+
- `PROMPTS.md` - 即用型提示词模板
|
|
63
|
+
- `INTEGRATION.md` - 错误处理与 MCP 集成
|
|
64
|
+
|
|
65
|
+
#### 文档质量保障
|
|
66
|
+
- 新增 `docs/AI_ASSISTANT_SETUP.md` - AI 助手配置指南
|
|
67
|
+
- 新增 `docs/SETUP_GUIDE.md` - 完整安装设置指南
|
|
68
|
+
- 更新 `docs/rules/architecture-guardrails.md` - 架构约束规则增强
|
|
69
|
+
- 更新 `docs/rules/engineering-with-codex-openai.md` - 工程规范更新
|
|
70
|
+
|
|
71
|
+
### 🔧 Developer Experience
|
|
72
|
+
|
|
73
|
+
#### CLI 改进
|
|
74
|
+
- `docs:check` 脚本升级,同步验证人类文档和 AI 文档
|
|
75
|
+
- 新增独立验证命令:
|
|
76
|
+
- `npm run docs:check:human` - 仅验证人类文档
|
|
77
|
+
- `npm run docs:check:ai` - 仅验证 AI 文档
|
|
78
|
+
- 新增 `npm run release` - 标准化发布流程
|
|
79
|
+
|
|
80
|
+
#### 验证流程
|
|
81
|
+
- `check:all` 整合文档检查,更严格的质量门禁
|
|
82
|
+
- 发布工作流 (`.github/workflows/publish.yml`) 优化
|
|
83
|
+
|
|
84
|
+
### 📦 Dependencies
|
|
85
|
+
|
|
86
|
+
- 新增 `scripts/validate-ai-docs.js` - AI 文档验证脚本
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## [0.2.0] - 2026-03-17 - MVP3 Architecture Release
|
|
91
|
+
|
|
92
|
+
### 🏗️ MVP3 分层架构重构
|
|
93
|
+
|
|
94
|
+
CodeMap 完成重大架构升级,采用清晰的分层架构设计:Interface → Infrastructure → Domain → Server → CLI
|
|
95
|
+
|
|
96
|
+
#### Interface Layer
|
|
97
|
+
- 核心类型定义中心 (`src/interface/types/`)
|
|
98
|
+
- 存储接口契约 (`IStorage`, `IStorageFactory`)
|
|
99
|
+
- 解析器接口契约 (`ILanguageParser`, `IParserRegistry`)
|
|
100
|
+
|
|
101
|
+
#### Infrastructure Layer
|
|
102
|
+
- **存储抽象**: 支持多种存储后端
|
|
103
|
+
- `FileSystemStorage` - 文件系统存储(默认)
|
|
104
|
+
- `MemoryStorage` - 内存存储(测试用)
|
|
105
|
+
- `KuzuDBStorage` - KùzuDB 图数据库(可选)
|
|
106
|
+
- `Neo4jStorage` - Neo4j 图数据库(可选)
|
|
107
|
+
- `StorageFactory` - 自动选择存储后端
|
|
108
|
+
- **解析器抽象**: 多语言支持架构
|
|
109
|
+
- `ParserBase` - 解析器抽象基类
|
|
110
|
+
- `ParserRegistry` - 解析器注册表
|
|
111
|
+
- `TypeScriptParser` - TypeScript/JavaScript 解析
|
|
112
|
+
- `GoParser` - Go 语言解析
|
|
113
|
+
- `PythonParser` - Python 解析
|
|
114
|
+
- **仓库实现**: `CodeGraphRepositoryImpl` 连接 Domain 和 Infrastructure
|
|
115
|
+
|
|
116
|
+
#### Domain Layer
|
|
117
|
+
- 领域实体: `Project`, `Module`, `Symbol`, `Dependency`
|
|
118
|
+
- 聚合根: `CodeGraph`
|
|
119
|
+
- 领域服务: `CodeGraphBuilder`
|
|
120
|
+
- 领域事件: `DomainEvent` 及其子类
|
|
121
|
+
- 仓库接口: `CodeGraphRepository`
|
|
122
|
+
|
|
123
|
+
#### Server Layer
|
|
124
|
+
- HTTP API 服务器 (`CodeMapServer`)
|
|
125
|
+
- RESTful 端点设计
|
|
126
|
+
- `QueryHandler` - 查询处理
|
|
127
|
+
- `AnalysisHandler` - 分析处理
|
|
128
|
+
- 支持 CORS、健康检查、错误处理
|
|
129
|
+
|
|
130
|
+
#### CLI Layer (MVP3 集成)
|
|
131
|
+
- 新增 `server` 命令 - 启动 HTTP API 服务器
|
|
132
|
+
- 新增 `export` 命令 - 导出代码图到多种格式
|
|
133
|
+
|
|
134
|
+
### Added
|
|
135
|
+
|
|
136
|
+
#### New CLI Commands
|
|
137
|
+
- `mycodemap server` - 启动 HTTP API 服务器 (`-p`, `--host`, `--cors`, `--open`)
|
|
138
|
+
- `mycodemap export` - 导出代码图 (`json`, `graphml`, `dot`, `mermaid`)
|
|
139
|
+
|
|
140
|
+
#### HTTP API Endpoints
|
|
141
|
+
- `GET /api/v1/health` - 健康检查
|
|
142
|
+
- `GET /api/v1/stats` - 项目统计
|
|
143
|
+
- `GET /api/v1/search/symbols?q=` - 符号搜索
|
|
144
|
+
- `GET /api/v1/modules/:id` - 模块详情
|
|
145
|
+
- `GET /api/v1/symbols/:id` - 符号详情
|
|
146
|
+
- `POST /api/v1/analysis/impact` - 影响分析
|
|
147
|
+
- `GET /api/v1/analysis/cycles` - 循环依赖检测
|
|
148
|
+
- `GET /api/v1/graph` - 依赖图数据
|
|
149
|
+
- `GET /api/v1/export/:format` - 数据导出
|
|
150
|
+
|
|
151
|
+
#### Dependencies
|
|
152
|
+
- `hono` - 轻量级 HTTP 框架
|
|
153
|
+
- `@hono/node-server` - Node.js 服务器适配器
|
|
154
|
+
|
|
155
|
+
### Test Coverage
|
|
156
|
+
- 新增 37 个单元测试,总计 **742 个测试全部通过**
|
|
157
|
+
- Domain 实体测试 (Project, Module)
|
|
158
|
+
- Parser 测试 (ParserRegistry, TypeScriptParser)
|
|
159
|
+
- Repository 测试 (CodeGraphRepositoryImpl)
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## [0.1.2] - 2026-03-20
|
|
164
|
+
|
|
165
|
+
### Changed
|
|
166
|
+
- 文档同步更新:CLI 命令列表、MVP3 架构描述、代码示例全面刷新
|
|
167
|
+
|
|
5
168
|
## [0.1.1] - 2026-03-07
|
|
6
169
|
|
|
7
170
|
### Added
|
package/README.md
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
> TypeScript 代码地图工具 - 为 AI 辅助开发提供结构化上下文
|
|
4
4
|
|
|
5
|
-
CodeMap 是一个专为 TypeScript/JavaScript 项目设计的代码分析工具。它通过静态分析自动生成项目的结构化代码地图,帮助 AI 编程助手(如 Claude、Copilot)快速理解项目架构、模块关系和代码上下文。
|
|
5
|
+
CodeMap 是一个专为 TypeScript/JavaScript/Go 项目设计的代码分析工具。它通过静态分析自动生成项目的结构化代码地图,帮助 AI 编程助手(如 Claude、Copilot)快速理解项目架构、模块关系和代码上下文。
|
|
6
6
|
|
|
7
7
|
## 特性
|
|
8
8
|
|
|
9
|
+
- **分层架构 (MVP3)** - 清晰的分层设计:Interface → Infrastructure → Domain → Server → CLI
|
|
9
10
|
- **双层解析模式** - 提供 `fast`(快速正则)和 `smart`(TypeScript AST)两种解析模式,按需平衡速度与精度
|
|
11
|
+
- **多语言支持** - 支持 TypeScript/JavaScript、Go、Python(可扩展架构)
|
|
12
|
+
- **HTTP API 服务器** - 内置 REST API 服务器,支持查询、分析、导出
|
|
10
13
|
- **多格式输出** - 自动生成 `AI_MAP.md`(全局概览)、`CONTEXT.md` + `context/`(模块上下文)、`codemap.json`(结构化数据)
|
|
11
14
|
- **依赖图可视化** - 生成 Mermaid 格式的模块依赖关系图
|
|
12
15
|
- **增量缓存** - 基于文件哈希的 LRU 缓存机制,仅重新分析变更文件
|
|
@@ -17,6 +20,7 @@ CodeMap 是一个专为 TypeScript/JavaScript 项目设计的代码分析工具
|
|
|
17
20
|
- **工作流编排** - v2.5 新增:6 阶段智能工作流 (reference → impact → risk → implementation → commit → ci)
|
|
18
21
|
- **CI 门禁** - v2.5 新增:提交格式检查、风险评估、输出契约验证
|
|
19
22
|
- **插件系统** - 可扩展的插件架构,支持自定义分析和输出
|
|
23
|
+
- **存储抽象** - 支持文件系统、内存、KùzuDB、Neo4j 多种存储后端
|
|
20
24
|
|
|
21
25
|
## 安装
|
|
22
26
|
|
|
@@ -36,6 +40,10 @@ npm install -g @mycodemap/mycodemap
|
|
|
36
40
|
|
|
37
41
|
**环境要求**: Node.js >= 18.0.0
|
|
38
42
|
|
|
43
|
+
**MVP3 新依赖**:
|
|
44
|
+
- `hono` - HTTP 服务器框架
|
|
45
|
+
- `@hono/node-server` - Node.js 适配器
|
|
46
|
+
|
|
39
47
|
## 快速开始
|
|
40
48
|
|
|
41
49
|
```bash
|
|
@@ -58,12 +66,36 @@ ls .mycodemap/
|
|
|
58
66
|
|
|
59
67
|
## 文档导航
|
|
60
68
|
|
|
69
|
+
### 人类用户
|
|
70
|
+
|
|
61
71
|
| 文档 | 目标读者 | 内容 |
|
|
62
72
|
|------|----------|------|
|
|
73
|
+
| [🧭 文档索引](docs/README.md) | 所有读者 | 文档分层、阅读顺序与迁移状态 |
|
|
74
|
+
| [🏗️ 架构总图](ARCHITECTURE.md) | 开发者 | 系统地图、模块边界、主执行流 |
|
|
75
|
+
| [📋 MVP3 实施路线图](docs/exec-plans/MVP3-IMPLEMENTATION-ROADMAP.md) | 开发者 | 分层架构重构完整计划与状态 |
|
|
63
76
|
| [📖 安装配置指南](docs/SETUP_GUIDE.md) | 人类开发者 | 完整的安装、配置和使用指南 |
|
|
64
|
-
| [🤖 AI 助手集成指南](docs/AI_ASSISTANT_SETUP.md) | AI 用户 | Kimi/Claude/Codex/Copilot 配置指引 |
|
|
65
77
|
| [📁 配置示例](examples/) | 所有用户 | 各平台的现成配置文件 |
|
|
66
78
|
|
|
79
|
+
### 🤖 AI / Agent 专属文档
|
|
80
|
+
|
|
81
|
+
> 如果你是 AI 助手或 Agent,**请优先阅读以下文档**:
|
|
82
|
+
|
|
83
|
+
| 文档 | 说明 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| **[📘 AI_GUIDE.md](AI_GUIDE.md)** | **AI 主指南** - 快速参考、命令选择决策树、提示词模板速用 |
|
|
86
|
+
| **[🚀 docs/ai-guide/QUICKSTART.md](docs/ai-guide/QUICKSTART.md)** | 快速开始、场景-命令映射表 |
|
|
87
|
+
| **[📚 docs/ai-guide/COMMANDS.md](docs/ai-guide/COMMANDS.md)** | 完整 CLI 命令参考 |
|
|
88
|
+
| **[📊 docs/ai-guide/OUTPUT.md](docs/ai-guide/OUTPUT.md)** | JSON 输出结构解析 |
|
|
89
|
+
| **[🔄 docs/ai-guide/PATTERNS.md](docs/ai-guide/PATTERNS.md)** | 标准工作流模式 |
|
|
90
|
+
| **[💬 docs/ai-guide/PROMPTS.md](docs/ai-guide/PROMPTS.md)** | 即用型提示词模板 |
|
|
91
|
+
| **[🔧 docs/ai-guide/INTEGRATION.md](docs/ai-guide/INTEGRATION.md)** | 集成指南、错误处理 |
|
|
92
|
+
| **[🛡️ AGENTS.md](AGENTS.md)** | 仓库级强约束、任务分级、代码红线 |
|
|
93
|
+
| **[⚡ CLAUDE.md](CLAUDE.md)** | AI 执行手册、验收清单 |
|
|
94
|
+
| **[🤖 docs/AI_ASSISTANT_SETUP.md](docs/AI_ASSISTANT_SETUP.md)** | AI 助手配置指引 |
|
|
95
|
+
| **[🛠️ docs/rules/engineering-with-codex-openai.md](docs/rules/engineering-with-codex-openai.md) | 面向 agent 的工程约束 |
|
|
96
|
+
|
|
97
|
+
**AI 快速入口**: `.cursorrules` | `.github/copilot-instructions.md`
|
|
98
|
+
|
|
67
99
|
## CLI 命令
|
|
68
100
|
|
|
69
101
|
### `mycodemap init`
|
|
@@ -150,7 +182,7 @@ mycodemap query -S "plugin" -l 5 # 限制结果数量
|
|
|
150
182
|
| `-m, --module <path>` | 查询模块信息 | - |
|
|
151
183
|
| `-d, --deps <name>` | 查询依赖关系 | - |
|
|
152
184
|
| `-S, --search <word>` | 模糊搜索 | - |
|
|
153
|
-
| `-l, --limit <number>` | 限制结果数量 | `
|
|
185
|
+
| `-l, --limit <number>` | 限制结果数量 | `50` |
|
|
154
186
|
| `-j, --json` | 以 JSON 格式输出 | - |
|
|
155
187
|
|
|
156
188
|
### `mycodemap deps`
|
|
@@ -256,6 +288,48 @@ mycodemap logs clear -d 30 --confirm # 清理 30 天前的日志
|
|
|
256
288
|
| `--format <format>` | 导出格式 (`json`/`txt`) | `json` |
|
|
257
289
|
| `-c, --confirm` | 确认清理操作 | - |
|
|
258
290
|
|
|
291
|
+
### `mycodemap server` (MVP3)
|
|
292
|
+
|
|
293
|
+
启动 CodeMap HTTP API 服务器。
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
mycodemap server # 启动服务器 (默认端口 3000)
|
|
297
|
+
mycodemap server -p 8080 # 指定端口
|
|
298
|
+
mycodemap server -p 3000 --open # 自动打开浏览器
|
|
299
|
+
mycodemap server --cors # 启用 CORS
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
| 选项 | 说明 | 默认值 |
|
|
303
|
+
|------|------|--------|
|
|
304
|
+
| `-p, --port <number>` | 服务器端口 | `3000` |
|
|
305
|
+
| `-h, --host <string>` | 服务器主机 | `0.0.0.0` |
|
|
306
|
+
| `--cors` | 启用 CORS | `false` |
|
|
307
|
+
| `--open` | 自动打开浏览器 | `false` |
|
|
308
|
+
|
|
309
|
+
**API 端点:**
|
|
310
|
+
- `GET /api/v1/health` - 健康检查
|
|
311
|
+
- `GET /api/v1/stats` - 项目统计
|
|
312
|
+
- `GET /api/v1/search/symbols?q=` - 符号搜索
|
|
313
|
+
- `GET /api/v1/modules/:id` - 模块详情
|
|
314
|
+
- `POST /api/v1/analysis/impact` - 影响分析
|
|
315
|
+
- `GET /api/v1/export/:format` - 导出数据
|
|
316
|
+
|
|
317
|
+
### `mycodemap export` (MVP3)
|
|
318
|
+
|
|
319
|
+
导出代码图到各种格式。
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
mycodemap export json # 导出为 JSON
|
|
323
|
+
mycodemap export graphml # 导出为 GraphML (Gephi 兼容)
|
|
324
|
+
mycodemap export dot # 导出为 DOT (Graphviz)
|
|
325
|
+
mycodemap export mermaid # 导出为 Mermaid 语法
|
|
326
|
+
mycodemap export json -o ./out # 指定输出路径
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
| 选项 | 说明 | 默认值 |
|
|
330
|
+
|------|------|--------|
|
|
331
|
+
| `-o, --output <path>` | 输出文件路径 | 自动根据格式生成 |
|
|
332
|
+
|
|
259
333
|
## 工作流编排 (v2.5)
|
|
260
334
|
|
|
261
335
|
CodeMap v2.5 引入智能工作流编排系统,将复杂任务分解为 6 个有序阶段,每个阶段自动分析并传递上下文。
|
|
@@ -375,6 +449,12 @@ Current phase: reference
|
|
|
375
449
|
CodeMap 提供 CI 阶段自动检查,确保代码质量。
|
|
376
450
|
|
|
377
451
|
```bash
|
|
452
|
+
# 检查 README / docs / CLI 示例是否与仓库事实同步
|
|
453
|
+
npm run docs:check
|
|
454
|
+
|
|
455
|
+
# 通过统一 CLI 护栏入口复用同一检查
|
|
456
|
+
mycodemap ci check-docs-sync
|
|
457
|
+
|
|
378
458
|
# 检查提交格式 ([TAG] scope: message)
|
|
379
459
|
mycodemap ci check-commits
|
|
380
460
|
|
|
@@ -460,67 +540,87 @@ mycodemap ci check-output-contract
|
|
|
460
540
|
|
|
461
541
|
独立的 Mermaid 依赖关系图文件,可在支持 Mermaid 的 Markdown 渲染器中直接预览。
|
|
462
542
|
|
|
463
|
-
##
|
|
543
|
+
## MVP3 分层架构
|
|
544
|
+
|
|
545
|
+
CodeMap 采用清晰的分层架构设计(MVP3),各层职责明确:
|
|
546
|
+
|
|
547
|
+
```
|
|
548
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
549
|
+
│ CLI Layer │
|
|
550
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
|
551
|
+
│ │ server │ │ export │ │ 原有命令(generate..)│ │
|
|
552
|
+
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
|
|
553
|
+
├─────────────────────────────────────────────────────────────┤
|
|
554
|
+
│ Server Layer │
|
|
555
|
+
│ HTTP API / QueryHandler / AnalysisHandler │
|
|
556
|
+
├─────────────────────────────────────────────────────────────┤
|
|
557
|
+
│ Domain Layer │
|
|
558
|
+
│ Project / Module / Symbol / Dependency / CodeGraph │
|
|
559
|
+
├─────────────────────────────────────────────────────────────┤
|
|
560
|
+
│ Infrastructure Layer │
|
|
561
|
+
│ ┌──────────────────┐ ┌──────────────────┐ │
|
|
562
|
+
│ │ Storage │ │ Parser │ │
|
|
563
|
+
│ │ - FileSystem │ │ - TypeScript │ │
|
|
564
|
+
│ │ - Memory │ │ - Go │ │
|
|
565
|
+
│ │ - KùzuDB │ │ - Python │ │
|
|
566
|
+
│ │ - Neo4j │ │ - Registry │ │
|
|
567
|
+
│ └──────────────────┘ └──────────────────┘ │
|
|
568
|
+
│ ┌──────────────────┐ │
|
|
569
|
+
│ │ Repository │ CodeGraphRepositoryImpl │
|
|
570
|
+
│ └──────────────────┘ │
|
|
571
|
+
├─────────────────────────────────────────────────────────────┤
|
|
572
|
+
│ Interface Layer │
|
|
573
|
+
│ 类型定义与契约 (Types, ILanguageParser, IStorage) │
|
|
574
|
+
└─────────────────────────────────────────────────────────────┘
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
### 架构层说明
|
|
578
|
+
|
|
579
|
+
| 层级 | 路径 | 职责 | 关键组件 |
|
|
580
|
+
|------|------|------|----------|
|
|
581
|
+
| **CLI** | `src/cli/` | 命令行接口 | `server`, `export`, `generate` 命令 |
|
|
582
|
+
| **Server** | `src/server/` | HTTP API | `CodeMapServer`, `QueryHandler` |
|
|
583
|
+
| **Domain** | `src/domain/` | 核心业务逻辑 | `Project`, `Module`, `CodeGraph` |
|
|
584
|
+
| **Infrastructure** | `src/infrastructure/` | 技术实现 | `Storage`, `Parser`, `Repository` |
|
|
585
|
+
| **Interface** | `src/interface/` | 类型契约 | `types/`, `config/` |
|
|
586
|
+
|
|
587
|
+
### 项目目录结构
|
|
464
588
|
|
|
465
589
|
```
|
|
466
590
|
src/
|
|
467
|
-
├── cli/
|
|
468
|
-
│ ├──
|
|
469
|
-
│
|
|
470
|
-
│
|
|
471
|
-
│
|
|
472
|
-
│
|
|
473
|
-
│
|
|
474
|
-
│
|
|
475
|
-
|
|
476
|
-
├──
|
|
477
|
-
│
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
│
|
|
481
|
-
│
|
|
482
|
-
│
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
│ ├──
|
|
486
|
-
│ ├──
|
|
487
|
-
│
|
|
488
|
-
│ ├──
|
|
489
|
-
│ ├──
|
|
490
|
-
│ ├──
|
|
491
|
-
│
|
|
492
|
-
│
|
|
493
|
-
|
|
494
|
-
│ ├──
|
|
495
|
-
│
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
│ ├── workflow-orchestrator.ts # 工作流编排器
|
|
501
|
-
│ ├── workflow-persistence.ts # 工作流持久化
|
|
502
|
-
│ ├── phase-checkpoint.ts # 阶段检查点
|
|
503
|
-
│ └── config.ts # 工作流配置
|
|
504
|
-
├── generator/ # 输出生成器
|
|
505
|
-
│ ├── index.ts # AI_MAP / JSON / Mermaid 生成
|
|
506
|
-
│ └── context.ts # CONTEXT.md 生成
|
|
507
|
-
├── cache/ # 缓存系统
|
|
508
|
-
│ ├── lru-cache.ts # LRU 缓存实现
|
|
509
|
-
│ ├── parse-cache.ts # 解析结果缓存
|
|
510
|
-
│ └── file-hash-cache.ts # 文件哈希缓存
|
|
511
|
-
├── watcher/ # 文件监听
|
|
512
|
-
│ ├── file-watcher.ts # 文件变更监听
|
|
513
|
-
│ ├── daemon.ts # 守护进程管理
|
|
514
|
-
│ └── watch-worker.ts # 监听工作线程
|
|
515
|
-
├── plugins/ # 插件系统
|
|
516
|
-
│ ├── types.ts # 插件接口定义
|
|
517
|
-
│ ├── plugin-registry.ts # 插件注册中心
|
|
518
|
-
│ ├── plugin-loader.ts # 插件加载器
|
|
519
|
-
│ └── built-in/ # 内置插件
|
|
520
|
-
│ ├── complexity-analyzer.ts # 复杂度分析
|
|
521
|
-
│ └── call-graph.ts # 调用图分析
|
|
522
|
-
└── types/ # 类型定义
|
|
523
|
-
└── index.ts # 核心类型
|
|
591
|
+
├── cli/ # CLI 命令入口 (原有 + MVP3 新增)
|
|
592
|
+
│ ├── commands/
|
|
593
|
+
│ │ ├── server.ts # MVP3: HTTP API 服务器
|
|
594
|
+
│ │ ├── export.ts # MVP3: 导出命令
|
|
595
|
+
│ │ ├── generate.ts # 生成代码地图
|
|
596
|
+
│ │ ├── query.ts # 查询命令
|
|
597
|
+
│ │ └── ... # 其他命令
|
|
598
|
+
│ └── index.ts
|
|
599
|
+
├── server/ # MVP3: HTTP API 服务器层
|
|
600
|
+
│ ├── CodeMapServer.ts # 主服务器类
|
|
601
|
+
│ ├── handlers/ # QueryHandler, AnalysisHandler
|
|
602
|
+
│ └── routes/ # API 路由
|
|
603
|
+
├── domain/ # MVP3: 领域层
|
|
604
|
+
│ ├── entities/ # Project, Module, Symbol, Dependency
|
|
605
|
+
│ ├── services/ # CodeGraphBuilder
|
|
606
|
+
│ ├── events/ # DomainEvent
|
|
607
|
+
│ └── repositories/ # 仓库接口
|
|
608
|
+
├── infrastructure/ # MVP3: 基础设施层
|
|
609
|
+
│ ├── storage/ # 存储适配器
|
|
610
|
+
│ │ ├── adapters/ # FileSystem, Memory, KùzuDB, Neo4j
|
|
611
|
+
│ │ └── StorageFactory.ts
|
|
612
|
+
│ ├── parser/ # 解析器
|
|
613
|
+
│ │ ├── interfaces/ # ParserBase
|
|
614
|
+
│ │ ├── implementations/# TypeScript, Go, Python
|
|
615
|
+
│ │ └── registry/ # ParserRegistry
|
|
616
|
+
│ └── repositories/ # 仓库实现
|
|
617
|
+
├── interface/ # MVP3: 接口层
|
|
618
|
+
│ ├── types/ # 核心类型定义
|
|
619
|
+
│ └── config/ # 配置类型
|
|
620
|
+
├── core/ # 核心分析引擎 (原有)
|
|
621
|
+
├── parser/ # 原有解析器 (逐步迁移到 infrastructure/parser)
|
|
622
|
+
├── orchestrator/ # 编排层 (v2.5)
|
|
623
|
+
└── ...
|
|
524
624
|
```
|
|
525
625
|
|
|
526
626
|
## AI 助手集成
|
|
@@ -550,21 +650,91 @@ mkdir -p .agents/skills/codemap
|
|
|
550
650
|
cp examples/codex/codemap-agent.md .agents/skills/codemap/SKILL.md
|
|
551
651
|
```
|
|
552
652
|
|
|
553
|
-
详细配置请参考 [AI_ASSISTANT_SETUP.md](docs/AI_ASSISTANT_SETUP.md)。
|
|
653
|
+
详细配置请参考 [AI_ASSISTANT_SETUP.md](docs/AI_ASSISTANT_SETUP.md),设计与规则入口请先看 [docs/README.md](docs/README.md)。
|
|
554
654
|
|
|
555
655
|
## 新增 CLI 命令
|
|
556
656
|
|
|
557
657
|
### `mycodemap analyze`
|
|
558
658
|
|
|
559
|
-
|
|
659
|
+
统一分析入口,支持多意图路由和结构化输出:
|
|
660
|
+
|
|
661
|
+
```bash
|
|
662
|
+
# 影响分析(查看文件变更影响范围)
|
|
663
|
+
mycodemap analyze -i impact -t src/cli/index.ts
|
|
664
|
+
mycodemap analyze -i impact -t src/cli/index.ts --scope transitive
|
|
665
|
+
mycodemap analyze -i impact -t src/cli/index.ts --include-tests
|
|
666
|
+
|
|
667
|
+
# 依赖分析
|
|
668
|
+
mycodemap analyze -i dependency -t src/cli/index.ts
|
|
669
|
+
|
|
670
|
+
# 项目概览
|
|
671
|
+
mycodemap analyze -i overview -t src/orchestrator
|
|
672
|
+
|
|
673
|
+
# 复杂度分析
|
|
674
|
+
mycodemap analyze -i complexity -t src/domain
|
|
675
|
+
|
|
676
|
+
# 搜索分析
|
|
677
|
+
mycodemap analyze -i search -k UnifiedResult
|
|
678
|
+
|
|
679
|
+
# 重构建议
|
|
680
|
+
mycodemap analyze -i refactor -t src/cache
|
|
681
|
+
|
|
682
|
+
# 引用查找
|
|
683
|
+
mycodemap analyze -i reference -t src/interface/types
|
|
684
|
+
|
|
685
|
+
# 文档生成
|
|
686
|
+
mycodemap analyze -i documentation -t src/domain/services
|
|
687
|
+
|
|
688
|
+
# 机器可读输出(JSON)
|
|
689
|
+
mycodemap analyze -i impact -t src/index.ts --json
|
|
690
|
+
mycodemap analyze -i impact -t src/index.ts --structured --json
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
| 选项 | 说明 | 默认值 |
|
|
694
|
+
|------|------|--------|
|
|
695
|
+
| `-i, --intent <type>` | 分析类型:`impact`/`dependency`/`search`/`documentation`/`complexity`/`overview`/`refactor`/`reference` | `impact` |
|
|
696
|
+
| `-t, --targets <paths...>` | 目标文件/模块路径(必填) | - |
|
|
697
|
+
| `-k, --keywords <words...>` | 搜索关键词(用于 search/documentation 意图) | - |
|
|
698
|
+
| `-s, --scope <scope>` | 范围:`direct`(直接)/`transitive`(传递) | `direct` |
|
|
699
|
+
| `-n, --topK <number>` | 返回结果数量 | `8` |
|
|
700
|
+
| `--include-tests` | 包含测试文件关联 | - |
|
|
701
|
+
| `--include-git-history` | 包含 Git 历史分析 | - |
|
|
702
|
+
| `--json` | JSON 格式输出 | - |
|
|
703
|
+
| `--structured` | 纯结构化输出(移除自然语言字段,配合 `--json` 使用) | - |
|
|
704
|
+
| `--output-mode <mode>` | 输出模式:`machine`/`human` | `human` |
|
|
705
|
+
|
|
706
|
+
### `mycodemap ci`
|
|
707
|
+
|
|
708
|
+
CI Gateway - 代码质量门禁工具:
|
|
560
709
|
|
|
561
710
|
```bash
|
|
562
|
-
|
|
563
|
-
mycodemap
|
|
564
|
-
mycodemap
|
|
565
|
-
mycodemap
|
|
711
|
+
# 验证提交格式([TAG] scope: message)
|
|
712
|
+
mycodemap ci check-commits
|
|
713
|
+
mycodemap ci check-commits -c 5
|
|
714
|
+
mycodemap ci check-commits -r origin/main..HEAD
|
|
715
|
+
|
|
716
|
+
# 验证文件头注释([META], [WHY])
|
|
717
|
+
mycodemap ci check-headers
|
|
718
|
+
mycodemap ci check-headers -d src/domain
|
|
719
|
+
mycodemap ci check-headers -f "src/index.ts,src/cli/index.ts"
|
|
720
|
+
|
|
721
|
+
# 评估变更风险
|
|
722
|
+
mycodemap ci assess-risk
|
|
723
|
+
mycodemap ci assess-risk -t 0.5
|
|
724
|
+
|
|
725
|
+
# 验证文档同步
|
|
726
|
+
mycodemap ci check-docs-sync
|
|
727
|
+
|
|
728
|
+
# 验证输出契约
|
|
729
|
+
mycodemap ci check-output-contract
|
|
730
|
+
|
|
731
|
+
# 检查提交文件数量(限制 10 个文件)
|
|
732
|
+
mycodemap ci check-commit-size
|
|
733
|
+
mycodemap ci check-commit-size -m 15
|
|
566
734
|
```
|
|
567
735
|
|
|
736
|
+
支持的提交 TAG 类型:`[REFACTOR]`, `[TEST]`, `[DOCS]`, `[FEAT]`, `[FIX]`, `[CHORE]`, `[PERF]`, `[SECURITY]`, `[BREAKING]`, `[HOTFIX]`, `[MIGRATION]`, `[WIP]`
|
|
737
|
+
|
|
568
738
|
## 贡献指南
|
|
569
739
|
|
|
570
740
|
欢迎提交 Issue 和 Pull Request!
|
|
@@ -590,6 +760,10 @@ npm test # 功能测试(src/**/*.test.ts)
|
|
|
590
760
|
npm run benchmark # 性能基准测试(refer/benchmark-quality.test.ts)
|
|
591
761
|
npm run test:all # 功能 + 基准(串联执行)
|
|
592
762
|
|
|
763
|
+
# 文档 / CLI 示例护栏
|
|
764
|
+
npm run docs:check
|
|
765
|
+
node dist/cli/index.js ci check-docs-sync
|
|
766
|
+
|
|
593
767
|
# 类型检查
|
|
594
768
|
npm run typecheck
|
|
595
769
|
|
|
@@ -11,12 +11,18 @@ export declare enum CIErrorCode {
|
|
|
11
11
|
E0008_MISSING_HEADER = "E0008",
|
|
12
12
|
E0009_MISSING_WHY = "E0009",
|
|
13
13
|
E0010_OUTPUT_CONTRACT_VIOLATION = "E0010",
|
|
14
|
-
E0011_COMMIT_TOO_LARGE = "E0011"
|
|
14
|
+
E0011_COMMIT_TOO_LARGE = "E0011",
|
|
15
|
+
E0012_DOCS_GUARDRAIL_FAILED = "E0012"
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* CI 命令错误信息
|
|
18
19
|
*/
|
|
19
20
|
export declare const CI_ERROR_MESSAGES: Record<CIErrorCode, string>;
|
|
21
|
+
export declare function resolveDocsGuardrailScriptPath(projectRoot?: string): string;
|
|
22
|
+
export declare function runDocsGuardrailCheck(options?: {
|
|
23
|
+
root?: string;
|
|
24
|
+
projectRoot?: string;
|
|
25
|
+
}): void;
|
|
20
26
|
/**
|
|
21
27
|
* 创建 CI Gateway 命令
|
|
22
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ci.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ci.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC;;GAEG;AACH,oBAAY,WAAW;IACrB,2BAA2B,UAAU;IACrC,oBAAoB,UAAU;IAC9B,iBAAiB,UAAU;IAC3B,+BAA+B,UAAU;IACzC,sBAAsB,UAAU;IAChC,2BAA2B,UAAU;CACtC;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAOzD,CAAC;AAcF,wBAAgB,8BAA8B,CAAC,WAAW,GAAE,MAAsB,GAAG,MAAM,CAE1F;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,IAAI,CAiBjG;AAydD;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAgDzC;AAED,eAAO,MAAM,SAAS,SAAoB,CAAC"}
|
package/dist/cli/commands/ci.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* [META] CI Gateway CLI 命令
|
|
3
3
|
* [WHY] 提供 CI 门禁相关的子命令
|
|
4
4
|
*/
|
|
5
|
+
import { execFileSync } from 'node:child_process';
|
|
6
|
+
import { existsSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
5
8
|
import { Command } from 'commander';
|
|
6
9
|
import { validateCommitMessage, validateRecentCommits, VALID_TAGS } from '../../orchestrator/commit-validator.js';
|
|
7
10
|
import { scanDirectory, scanFileHeader } from '../../orchestrator/file-header-scanner.js';
|
|
@@ -17,6 +20,7 @@ export var CIErrorCode;
|
|
|
17
20
|
CIErrorCode["E0009_MISSING_WHY"] = "E0009";
|
|
18
21
|
CIErrorCode["E0010_OUTPUT_CONTRACT_VIOLATION"] = "E0010";
|
|
19
22
|
CIErrorCode["E0011_COMMIT_TOO_LARGE"] = "E0011";
|
|
23
|
+
CIErrorCode["E0012_DOCS_GUARDRAIL_FAILED"] = "E0012";
|
|
20
24
|
})(CIErrorCode || (CIErrorCode = {}));
|
|
21
25
|
/**
|
|
22
26
|
* CI 命令错误信息
|
|
@@ -27,6 +31,7 @@ export const CI_ERROR_MESSAGES = {
|
|
|
27
31
|
[CIErrorCode.E0009_MISSING_WHY]: '文件头缺少 [WHY] 注释',
|
|
28
32
|
[CIErrorCode.E0010_OUTPUT_CONTRACT_VIOLATION]: '输出契约校验失败',
|
|
29
33
|
[CIErrorCode.E0011_COMMIT_TOO_LARGE]: 'Commit 包含文件数量超过限制',
|
|
34
|
+
[CIErrorCode.E0012_DOCS_GUARDRAIL_FAILED]: '文档护栏校验失败',
|
|
30
35
|
};
|
|
31
36
|
/**
|
|
32
37
|
* 单 commit 文件数量限制
|
|
@@ -38,6 +43,24 @@ function parseGitDiffFiles(command) {
|
|
|
38
43
|
.map((line) => line.trim())
|
|
39
44
|
.filter(Boolean);
|
|
40
45
|
}
|
|
46
|
+
export function resolveDocsGuardrailScriptPath(projectRoot = process.cwd()) {
|
|
47
|
+
return path.join(projectRoot, 'scripts', 'validate-docs.js');
|
|
48
|
+
}
|
|
49
|
+
export function runDocsGuardrailCheck(options = {}) {
|
|
50
|
+
const projectRoot = options.projectRoot ?? process.cwd();
|
|
51
|
+
const scriptPath = resolveDocsGuardrailScriptPath(projectRoot);
|
|
52
|
+
if (!existsSync(scriptPath)) {
|
|
53
|
+
throw new Error(`Documentation guardrail script not found: ${scriptPath}`);
|
|
54
|
+
}
|
|
55
|
+
const args = [scriptPath];
|
|
56
|
+
if (options.root) {
|
|
57
|
+
args.push('--root', options.root);
|
|
58
|
+
}
|
|
59
|
+
execFileSync(process.execPath, args, {
|
|
60
|
+
cwd: projectRoot,
|
|
61
|
+
stdio: 'inherit',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
41
64
|
async function getChangedFiles(options) {
|
|
42
65
|
if (options.files) {
|
|
43
66
|
return options.files
|
|
@@ -81,6 +104,16 @@ async function getChangedFiles(options) {
|
|
|
81
104
|
process.exit(1);
|
|
82
105
|
}
|
|
83
106
|
}
|
|
107
|
+
async function checkDocsSyncAction(options) {
|
|
108
|
+
try {
|
|
109
|
+
runDocsGuardrailCheck({ root: options.root });
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
113
|
+
console.error(`ERROR: [${CIErrorCode.E0012_DOCS_GUARDRAIL_FAILED}] ${message}`);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
84
117
|
/**
|
|
85
118
|
* check-commits 子命令 - 验证 Commit 格式
|
|
86
119
|
*/
|
|
@@ -462,6 +495,11 @@ export function createCICommand() {
|
|
|
462
495
|
.option('-f, --files <files>', '逗号分隔的变更文件列表')
|
|
463
496
|
.option('-t, --threshold <number>', '风险阈值 (0-1)', '0.7')
|
|
464
497
|
.action(assessRiskAction);
|
|
498
|
+
ci
|
|
499
|
+
.command('check-docs-sync')
|
|
500
|
+
.description('验证当前仓库高信号文档、CLI 示例与护栏配置是否保持同步')
|
|
501
|
+
.option('--root <path>', '指定要校验的仓库根目录')
|
|
502
|
+
.action(checkDocsSyncAction);
|
|
465
503
|
ci
|
|
466
504
|
.command('check-output-contract')
|
|
467
505
|
.description('验证 analyze 命令的输出契约')
|