@mycodemap/mycodemap 1.9.0 → 2.7.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 +38 -0
- package/README.md +63 -978
- package/README.zh-CN.md +1096 -0
- package/dist/cli/commands/agent-metrics/human.d.ts +4 -0
- package/dist/cli/commands/agent-metrics/human.d.ts.map +1 -0
- package/dist/cli/commands/agent-metrics/human.js +134 -0
- package/dist/cli/commands/agent-metrics/human.js.map +1 -0
- package/dist/cli/commands/agent-metrics/index.d.ts +15 -0
- package/dist/cli/commands/agent-metrics/index.d.ts.map +1 -0
- package/dist/cli/commands/agent-metrics/index.js +116 -0
- package/dist/cli/commands/agent-metrics/index.js.map +1 -0
- package/dist/cli/commands/analyze-options.d.ts.map +1 -1
- package/dist/cli/commands/analyze-options.js +8 -0
- package/dist/cli/commands/analyze-options.js.map +1 -1
- package/dist/cli/commands/analyze.d.ts +3 -196
- package/dist/cli/commands/analyze.d.ts.map +1 -1
- package/dist/cli/commands/analyze.js +27 -1162
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/benchmark.d.ts +8 -0
- package/dist/cli/commands/benchmark.d.ts.map +1 -0
- package/dist/cli/commands/benchmark.js +153 -0
- package/dist/cli/commands/benchmark.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -1
- package/dist/cli/commands/complexity.js +62 -95
- package/dist/cli/commands/complexity.js.map +1 -1
- package/dist/cli/commands/deps.d.ts +3 -59
- package/dist/cli/commands/deps.d.ts.map +1 -1
- package/dist/cli/commands/deps.js +25 -331
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +34 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/env-contract.d.ts +3 -0
- package/dist/cli/commands/env-contract.d.ts.map +1 -0
- package/dist/cli/commands/env-contract.js +221 -0
- package/dist/cli/commands/env-contract.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +19 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +735 -89
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/impact.d.ts +4 -38
- package/dist/cli/commands/impact.d.ts.map +1 -1
- package/dist/cli/commands/impact.js +133 -375
- package/dist/cli/commands/impact.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +61 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/preview.d.ts +3 -0
- package/dist/cli/commands/preview.d.ts.map +1 -0
- package/dist/cli/commands/preview.js +216 -0
- package/dist/cli/commands/preview.js.map +1 -0
- package/dist/cli/commands/query.d.ts +2 -20
- package/dist/cli/commands/query.d.ts.map +1 -1
- package/dist/cli/commands/query.js +23 -708
- package/dist/cli/commands/query.js.map +1 -1
- package/dist/cli/commands/watch-foreground.d.ts.map +1 -1
- package/dist/cli/commands/watch-foreground.js +5 -1
- package/dist/cli/commands/watch-foreground.js.map +1 -1
- package/dist/cli/config-loader.d.ts.map +1 -1
- package/dist/cli/config-loader.js +51 -13
- package/dist/cli/config-loader.js.map +1 -1
- package/dist/cli/doctor/check-agent.d.ts +3 -0
- package/dist/cli/doctor/check-agent.d.ts.map +1 -0
- package/dist/cli/doctor/check-agent.js +60 -0
- package/dist/cli/doctor/check-agent.js.map +1 -0
- package/dist/cli/doctor/check-env-contract.d.ts +3 -0
- package/dist/cli/doctor/check-env-contract.d.ts.map +1 -0
- package/dist/cli/doctor/check-env-contract.js +96 -0
- package/dist/cli/doctor/check-env-contract.js.map +1 -0
- package/dist/cli/doctor/check-ghost-commands.d.ts +3 -0
- package/dist/cli/doctor/check-ghost-commands.d.ts.map +1 -0
- package/dist/cli/doctor/check-ghost-commands.js +86 -0
- package/dist/cli/doctor/check-ghost-commands.js.map +1 -0
- package/dist/cli/doctor/check-native-deps.d.ts +3 -0
- package/dist/cli/doctor/check-native-deps.d.ts.map +1 -0
- package/dist/cli/doctor/check-native-deps.js +70 -0
- package/dist/cli/doctor/check-native-deps.js.map +1 -0
- package/dist/cli/doctor/check-workspace-drift.d.ts +3 -0
- package/dist/cli/doctor/check-workspace-drift.d.ts.map +1 -0
- package/dist/cli/doctor/check-workspace-drift.js +83 -0
- package/dist/cli/doctor/check-workspace-drift.js.map +1 -0
- package/dist/cli/doctor/formatter.d.ts +20 -0
- package/dist/cli/doctor/formatter.d.ts.map +1 -0
- package/dist/cli/doctor/formatter.js +91 -0
- package/dist/cli/doctor/formatter.js.map +1 -0
- package/dist/cli/doctor/index.d.ts +8 -0
- package/dist/cli/doctor/index.d.ts.map +1 -0
- package/dist/cli/doctor/index.js +9 -0
- package/dist/cli/doctor/index.js.map +1 -0
- package/dist/cli/doctor/orchestrator.d.ts +3 -0
- package/dist/cli/doctor/orchestrator.d.ts.map +1 -0
- package/dist/cli/doctor/orchestrator.js +40 -0
- package/dist/cli/doctor/orchestrator.js.map +1 -0
- package/dist/cli/doctor/types.d.ts +19 -0
- package/dist/cli/doctor/types.d.ts.map +1 -0
- package/dist/cli/doctor/types.js +4 -0
- package/dist/cli/doctor/types.js.map +1 -0
- package/dist/cli/env-contract/check.d.ts +18 -0
- package/dist/cli/env-contract/check.d.ts.map +1 -0
- package/dist/cli/env-contract/check.js +118 -0
- package/dist/cli/env-contract/check.js.map +1 -0
- package/dist/cli/env-contract/discovery.d.ts +12 -0
- package/dist/cli/env-contract/discovery.d.ts.map +1 -0
- package/dist/cli/env-contract/discovery.js +249 -0
- package/dist/cli/env-contract/discovery.js.map +1 -0
- package/dist/cli/env-contract/filters.d.ts +10 -0
- package/dist/cli/env-contract/filters.d.ts.map +1 -0
- package/dist/cli/env-contract/filters.js +23 -0
- package/dist/cli/env-contract/filters.js.map +1 -0
- package/dist/cli/env-contract/index.d.ts +6 -0
- package/dist/cli/env-contract/index.d.ts.map +1 -0
- package/dist/cli/env-contract/index.js +8 -0
- package/dist/cli/env-contract/index.js.map +1 -0
- package/dist/cli/env-contract/reminder-engine.d.ts +34 -0
- package/dist/cli/env-contract/reminder-engine.d.ts.map +1 -0
- package/dist/cli/env-contract/reminder-engine.js +51 -0
- package/dist/cli/env-contract/reminder-engine.js.map +1 -0
- package/dist/cli/env-contract/reminder-hook-runner.d.ts +45 -0
- package/dist/cli/env-contract/reminder-hook-runner.d.ts.map +1 -0
- package/dist/cli/env-contract/reminder-hook-runner.js +273 -0
- package/dist/cli/env-contract/reminder-hook-runner.js.map +1 -0
- package/dist/cli/env-contract/reminder-ledger.d.ts +11 -0
- package/dist/cli/env-contract/reminder-ledger.d.ts.map +1 -0
- package/dist/cli/env-contract/reminder-ledger.js +37 -0
- package/dist/cli/env-contract/reminder-ledger.js.map +1 -0
- package/dist/cli/env-contract/types.d.ts +48 -0
- package/dist/cli/env-contract/types.d.ts.map +1 -0
- package/dist/cli/env-contract/types.js +22 -0
- package/dist/cli/env-contract/types.js.map +1 -0
- package/dist/cli/env-contract/validation.d.ts +10 -0
- package/dist/cli/env-contract/validation.d.ts.map +1 -0
- package/dist/cli/env-contract/validation.js +116 -0
- package/dist/cli/env-contract/validation.js.map +1 -0
- package/dist/cli/first-run-guide.d.ts.map +1 -1
- package/dist/cli/first-run-guide.js +8 -3
- package/dist/cli/first-run-guide.js.map +1 -1
- package/dist/cli/index.js +94 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/assistant-plan.d.ts +14 -0
- package/dist/cli/init/assistant-plan.d.ts.map +1 -0
- package/dist/cli/init/assistant-plan.js +208 -0
- package/dist/cli/init/assistant-plan.js.map +1 -0
- package/dist/cli/init/detect.d.ts +28 -0
- package/dist/cli/init/detect.d.ts.map +1 -0
- package/dist/cli/init/detect.js +63 -0
- package/dist/cli/init/detect.js.map +1 -0
- package/dist/cli/init/env-contract-plan.d.ts +28 -0
- package/dist/cli/init/env-contract-plan.d.ts.map +1 -0
- package/dist/cli/init/env-contract-plan.js +184 -0
- package/dist/cli/init/env-contract-plan.js.map +1 -0
- package/dist/cli/init/manifest-extractors.d.ts +22 -0
- package/dist/cli/init/manifest-extractors.d.ts.map +1 -0
- package/dist/cli/init/manifest-extractors.js +185 -0
- package/dist/cli/init/manifest-extractors.js.map +1 -0
- package/dist/cli/init/profile-loader.d.ts +49 -0
- package/dist/cli/init/profile-loader.d.ts.map +1 -0
- package/dist/cli/init/profile-loader.js +107 -0
- package/dist/cli/init/profile-loader.js.map +1 -0
- package/dist/cli/init/profile-plan.d.ts +38 -0
- package/dist/cli/init/profile-plan.d.ts.map +1 -0
- package/dist/cli/init/profile-plan.js +120 -0
- package/dist/cli/init/profile-plan.js.map +1 -0
- package/dist/cli/init/profiles/generic.json +16 -0
- package/dist/cli/init/profiles/go.json +12 -0
- package/dist/cli/init/profiles/nodejs.json +16 -0
- package/dist/cli/init/profiles/python.json +17 -0
- package/dist/cli/init/profiles/rust.json +12 -0
- package/dist/cli/init/receipt.d.ts.map +1 -1
- package/dist/cli/init/receipt.js +107 -7
- package/dist/cli/init/receipt.js.map +1 -1
- package/dist/cli/init/reconciler.d.ts +10 -1
- package/dist/cli/init/reconciler.d.ts.map +1 -1
- package/dist/cli/init/reconciler.js +85 -15
- package/dist/cli/init/reconciler.js.map +1 -1
- package/dist/cli/interface-contract/commands/agent-metrics.d.ts +3 -0
- package/dist/cli/interface-contract/commands/agent-metrics.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/agent-metrics.js +217 -0
- package/dist/cli/interface-contract/commands/agent-metrics.js.map +1 -0
- package/dist/cli/interface-contract/commands/analyze.d.ts +3 -0
- package/dist/cli/interface-contract/commands/analyze.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/analyze.js +139 -0
- package/dist/cli/interface-contract/commands/analyze.js.map +1 -0
- package/dist/cli/interface-contract/commands/benchmark.d.ts +3 -0
- package/dist/cli/interface-contract/commands/benchmark.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/benchmark.js +108 -0
- package/dist/cli/interface-contract/commands/benchmark.js.map +1 -0
- package/dist/cli/interface-contract/commands/deps.d.ts +3 -0
- package/dist/cli/interface-contract/commands/deps.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/deps.js +130 -0
- package/dist/cli/interface-contract/commands/deps.js.map +1 -0
- package/dist/cli/interface-contract/commands/doctor.d.ts +3 -0
- package/dist/cli/interface-contract/commands/doctor.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/doctor.js +60 -0
- package/dist/cli/interface-contract/commands/doctor.js.map +1 -0
- package/dist/cli/interface-contract/commands/env-contract.d.ts +3 -0
- package/dist/cli/interface-contract/commands/env-contract.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/env-contract.js +168 -0
- package/dist/cli/interface-contract/commands/env-contract.js.map +1 -0
- package/dist/cli/interface-contract/commands/index.d.ts +12 -0
- package/dist/cli/interface-contract/commands/index.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/index.js +24 -0
- package/dist/cli/interface-contract/commands/index.js.map +1 -0
- package/dist/cli/interface-contract/commands/init.d.ts +3 -0
- package/dist/cli/interface-contract/commands/init.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/init.js +96 -0
- package/dist/cli/interface-contract/commands/init.js.map +1 -0
- package/dist/cli/interface-contract/commands/preview.d.ts +3 -0
- package/dist/cli/interface-contract/commands/preview.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/preview.js +118 -0
- package/dist/cli/interface-contract/commands/preview.js.map +1 -0
- package/dist/cli/interface-contract/commands/query.d.ts +3 -0
- package/dist/cli/interface-contract/commands/query.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/query.js +186 -0
- package/dist/cli/interface-contract/commands/query.js.map +1 -0
- package/dist/cli/interface-contract/index.d.ts +22 -0
- package/dist/cli/interface-contract/index.d.ts.map +1 -0
- package/dist/cli/interface-contract/index.js +41 -0
- package/dist/cli/interface-contract/index.js.map +1 -0
- package/dist/cli/interface-contract/schema.d.ts +30 -0
- package/dist/cli/interface-contract/schema.d.ts.map +1 -0
- package/dist/cli/interface-contract/schema.js +73 -0
- package/dist/cli/interface-contract/schema.js.map +1 -0
- package/dist/cli/interface-contract/types.d.ts +77 -0
- package/dist/cli/interface-contract/types.d.ts.map +1 -0
- package/dist/cli/interface-contract/types.js +4 -0
- package/dist/cli/interface-contract/types.js.map +1 -0
- package/dist/cli/output/apply-suggestion.d.ts +12 -0
- package/dist/cli/output/apply-suggestion.d.ts.map +1 -0
- package/dist/cli/output/apply-suggestion.js +29 -0
- package/dist/cli/output/apply-suggestion.js.map +1 -0
- package/dist/cli/output/error-codes.d.ts +24 -0
- package/dist/cli/output/error-codes.d.ts.map +1 -0
- package/dist/cli/output/error-codes.js +94 -0
- package/dist/cli/output/error-codes.js.map +1 -0
- package/dist/cli/output/errors.d.ts +14 -0
- package/dist/cli/output/errors.d.ts.map +1 -0
- package/dist/cli/output/errors.js +182 -0
- package/dist/cli/output/errors.js.map +1 -0
- package/dist/cli/output/index.d.ts +13 -0
- package/dist/cli/output/index.d.ts.map +1 -0
- package/dist/cli/output/index.js +11 -0
- package/dist/cli/output/index.js.map +1 -0
- package/dist/cli/output/mode.d.ts +12 -0
- package/dist/cli/output/mode.d.ts.map +1 -0
- package/dist/cli/output/mode.js +23 -0
- package/dist/cli/output/mode.js.map +1 -0
- package/dist/cli/output/progress.d.ts +9 -0
- package/dist/cli/output/progress.d.ts.map +1 -0
- package/dist/cli/output/progress.js +65 -0
- package/dist/cli/output/progress.js.map +1 -0
- package/dist/cli/output/render.d.ts +11 -0
- package/dist/cli/output/render.d.ts.map +1 -0
- package/dist/cli/output/render.js +18 -0
- package/dist/cli/output/render.js.map +1 -0
- package/dist/cli/output/types.d.ts +53 -0
- package/dist/cli/output/types.d.ts.map +1 -0
- package/dist/cli/output/types.js +14 -0
- package/dist/cli/output/types.js.map +1 -0
- package/dist/cli/output/wasm-fallback.d.ts +14 -0
- package/dist/cli/output/wasm-fallback.d.ts.map +1 -0
- package/dist/cli/output/wasm-fallback.js +92 -0
- package/dist/cli/output/wasm-fallback.js.map +1 -0
- package/dist/cli/preview/complexity-scanner.d.ts +21 -0
- package/dist/cli/preview/complexity-scanner.d.ts.map +1 -0
- package/dist/cli/preview/complexity-scanner.js +52 -0
- package/dist/cli/preview/complexity-scanner.js.map +1 -0
- package/dist/cli/preview/dependency-extractor.d.ts +38 -0
- package/dist/cli/preview/dependency-extractor.d.ts.map +1 -0
- package/dist/cli/preview/dependency-extractor.js +140 -0
- package/dist/cli/preview/dependency-extractor.js.map +1 -0
- package/dist/cli/preview/preview-renderer.d.ts +32 -0
- package/dist/cli/preview/preview-renderer.d.ts.map +1 -0
- package/dist/cli/preview/preview-renderer.js +54 -0
- package/dist/cli/preview/preview-renderer.js.map +1 -0
- package/dist/cli/storage-runtime.d.ts +7 -0
- package/dist/cli/storage-runtime.d.ts.map +1 -1
- package/dist/cli/storage-runtime.js +22 -0
- package/dist/cli/storage-runtime.js.map +1 -1
- package/dist/cli/tree-sitter-check.d.ts +6 -1
- package/dist/cli/tree-sitter-check.d.ts.map +1 -1
- package/dist/cli/tree-sitter-check.js +23 -1
- package/dist/cli/tree-sitter-check.js.map +1 -1
- package/dist/cli-new/index.js +1 -1
- package/dist/cli-new/index.js.map +1 -1
- package/dist/composition/parser-composition.d.ts +7 -0
- package/dist/composition/parser-composition.d.ts.map +1 -0
- package/dist/composition/parser-composition.js +15 -0
- package/dist/composition/parser-composition.js.map +1 -0
- package/dist/core/analyzer.d.ts.map +1 -1
- package/dist/core/analyzer.js +83 -67
- package/dist/core/analyzer.js.map +1 -1
- package/dist/core/ast-complexity-analyzer.d.ts +12 -6
- package/dist/core/ast-complexity-analyzer.d.ts.map +1 -1
- package/dist/core/ast-complexity-analyzer.js +368 -209
- package/dist/core/ast-complexity-analyzer.js.map +1 -1
- package/dist/core/file-discovery.d.ts +1 -1
- package/dist/core/file-discovery.d.ts.map +1 -1
- package/dist/core/file-discovery.js +3 -0
- package/dist/core/file-discovery.js.map +1 -1
- package/dist/core/global-index.d.ts +3 -1
- package/dist/core/global-index.d.ts.map +1 -1
- package/dist/core/global-index.js +69 -4
- package/dist/core/global-index.js.map +1 -1
- package/dist/domain/entities/CodeGraph.d.ts +3 -0
- package/dist/domain/entities/CodeGraph.d.ts.map +1 -1
- package/dist/domain/entities/CodeGraph.js +19 -2
- package/dist/domain/entities/CodeGraph.js.map +1 -1
- package/dist/domain/entities/Dependency.d.ts +5 -2
- package/dist/domain/entities/Dependency.d.ts.map +1 -1
- package/dist/domain/entities/Dependency.js +49 -3
- package/dist/domain/entities/Dependency.js.map +1 -1
- package/dist/domain/repositories/CodeGraphRepository.d.ts +5 -0
- package/dist/domain/repositories/CodeGraphRepository.d.ts.map +1 -1
- package/dist/domain/repositories/CodeGraphRepository.js.map +1 -1
- package/dist/execution/contract-tools/analyze.d.ts +205 -0
- package/dist/execution/contract-tools/analyze.d.ts.map +1 -0
- package/dist/execution/contract-tools/analyze.js +1215 -0
- package/dist/execution/contract-tools/analyze.js.map +1 -0
- package/dist/execution/contract-tools/deps.d.ts +62 -0
- package/dist/execution/contract-tools/deps.d.ts.map +1 -0
- package/dist/execution/contract-tools/deps.js +234 -0
- package/dist/execution/contract-tools/deps.js.map +1 -0
- package/dist/execution/contract-tools/index.d.ts +5 -0
- package/dist/execution/contract-tools/index.d.ts.map +1 -0
- package/dist/execution/contract-tools/index.js +7 -0
- package/dist/execution/contract-tools/index.js.map +1 -0
- package/dist/execution/contract-tools/query.d.ts +60 -0
- package/dist/execution/contract-tools/query.d.ts.map +1 -0
- package/dist/execution/contract-tools/query.js +532 -0
- package/dist/execution/contract-tools/query.js.map +1 -0
- package/dist/execution/contract-tools/types.d.ts +26 -0
- package/dist/execution/contract-tools/types.d.ts.map +1 -0
- package/dist/execution/contract-tools/types.js +32 -0
- package/dist/execution/contract-tools/types.js.map +1 -0
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +0 -3
- package/dist/generator/index.js.map +1 -1
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.d.ts +12 -0
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.d.ts.map +1 -0
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.js +55 -0
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.js.map +1 -0
- package/dist/infrastructure/parser/implementations/GoParser.d.ts +2 -1
- package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/GoParser.js +13 -1
- package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -1
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.d.ts +114 -0
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.js +1022 -0
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.js.map +1 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.d.ts +78 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.js +648 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.js.map +1 -0
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +3 -55
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js +4 -411
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -1
- package/dist/infrastructure/parser/index.d.ts +2 -0
- package/dist/infrastructure/parser/index.d.ts.map +1 -1
- package/dist/infrastructure/parser/index.js +9 -6
- package/dist/infrastructure/parser/index.js.map +1 -1
- package/dist/infrastructure/parser/interfaces/ParserBase.d.ts.map +1 -1
- package/dist/infrastructure/parser/interfaces/ParserBase.js +1 -0
- package/dist/infrastructure/parser/interfaces/ParserBase.js.map +1 -1
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts +2 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts.map +1 -1
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js +4 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.d.ts +5 -18
- package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.js +30 -98
- package/dist/infrastructure/storage/StorageFactory.js.map +1 -1
- package/dist/infrastructure/storage/adapters/SQLiteStorage.d.ts +13 -1
- package/dist/infrastructure/storage/adapters/SQLiteStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/SQLiteStorage.js +322 -76
- package/dist/infrastructure/storage/adapters/SQLiteStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/sqlite-loader.d.ts +45 -0
- package/dist/infrastructure/storage/adapters/sqlite-loader.d.ts.map +1 -0
- package/dist/infrastructure/storage/adapters/sqlite-loader.js +266 -0
- package/dist/infrastructure/storage/adapters/sqlite-loader.js.map +1 -0
- package/dist/infrastructure/storage/community-helpers.d.ts +4 -0
- package/dist/infrastructure/storage/community-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/community-helpers.js +392 -0
- package/dist/infrastructure/storage/community-helpers.js.map +1 -0
- package/dist/infrastructure/storage/graph-helpers.d.ts +22 -5
- package/dist/infrastructure/storage/graph-helpers.d.ts.map +1 -1
- package/dist/infrastructure/storage/graph-helpers.js +496 -91
- package/dist/infrastructure/storage/graph-helpers.js.map +1 -1
- package/dist/infrastructure/storage/index.d.ts +1 -1
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/infrastructure/storage/index.js +1 -1
- package/dist/infrastructure/storage/index.js.map +1 -1
- package/dist/infrastructure/storage/interfaces/StorageBase.d.ts +2 -2
- package/dist/infrastructure/storage/interfaces/StorageBase.d.ts.map +1 -1
- package/dist/infrastructure/storage/interfaces/StorageBase.js.map +1 -1
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.d.ts +2 -0
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.js +52 -12
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.js.map +1 -1
- package/dist/infrastructure/storage/sqlite/schema.d.ts +2 -2
- package/dist/infrastructure/storage/sqlite/schema.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite/schema.js +49 -1
- package/dist/infrastructure/storage/sqlite/schema.js.map +1 -1
- package/dist/interface/config/index.d.ts +5 -3
- package/dist/interface/config/index.d.ts.map +1 -1
- package/dist/interface/types/index.d.ts +37 -6
- package/dist/interface/types/index.d.ts.map +1 -1
- package/dist/interface/types/parser.d.ts +85 -0
- package/dist/interface/types/parser.d.ts.map +1 -1
- package/dist/interface/types/storage.d.ts +227 -10
- package/dist/interface/types/storage.d.ts.map +1 -1
- package/dist/orchestrator/agent-metrics-service.d.ts +126 -0
- package/dist/orchestrator/agent-metrics-service.d.ts.map +1 -0
- package/dist/orchestrator/agent-metrics-service.js +444 -0
- package/dist/orchestrator/agent-metrics-service.js.map +1 -0
- package/dist/orchestrator/types.d.ts +2 -0
- package/dist/orchestrator/types.d.ts.map +1 -1
- package/dist/orchestrator/types.js.map +1 -1
- package/dist/parser/enhancers/PythonTypeEnhancer.d.ts +26 -0
- package/dist/parser/enhancers/PythonTypeEnhancer.d.ts.map +1 -0
- package/dist/parser/enhancers/PythonTypeEnhancer.js +440 -0
- package/dist/parser/enhancers/PythonTypeEnhancer.js.map +1 -0
- package/dist/parser/implementations/smart-parser.d.ts.map +1 -1
- package/dist/parser/implementations/smart-parser.js +7 -69
- package/dist/parser/implementations/smart-parser.js.map +1 -1
- package/dist/parser/implementations/tree-sitter-loader.d.ts +18 -0
- package/dist/parser/implementations/tree-sitter-loader.d.ts.map +1 -0
- package/dist/parser/implementations/tree-sitter-loader.js +136 -0
- package/dist/parser/implementations/tree-sitter-loader.js.map +1 -0
- package/dist/parser/index.d.ts +5 -3
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +68 -6
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/interfaces/IParser.d.ts +19 -6
- package/dist/parser/interfaces/IParser.d.ts.map +1 -1
- package/dist/parser/interfaces/IParser.js +2 -3
- package/dist/parser/interfaces/IParser.js.map +1 -1
- package/dist/server/handlers/AnalysisHandler.d.ts +13 -2
- package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -1
- package/dist/server/handlers/AnalysisHandler.js +24 -0
- package/dist/server/handlers/AnalysisHandler.js.map +1 -1
- package/dist/server/handlers/QueryHandler.d.ts.map +1 -1
- package/dist/server/handlers/QueryHandler.js +11 -30
- package/dist/server/handlers/QueryHandler.js.map +1 -1
- package/dist/server/mcp/context-tool.d.ts +9 -0
- package/dist/server/mcp/context-tool.d.ts.map +1 -0
- package/dist/server/mcp/context-tool.js +257 -0
- package/dist/server/mcp/context-tool.js.map +1 -0
- package/dist/server/mcp/schema-adapter.d.ts +55 -0
- package/dist/server/mcp/schema-adapter.d.ts.map +1 -0
- package/dist/server/mcp/schema-adapter.js +409 -0
- package/dist/server/mcp/schema-adapter.js.map +1 -0
- package/dist/server/mcp/server.d.ts +3 -3
- package/dist/server/mcp/server.d.ts.map +1 -1
- package/dist/server/mcp/server.js +134 -20
- package/dist/server/mcp/server.js.map +1 -1
- package/dist/server/mcp/service.d.ts +6 -2
- package/dist/server/mcp/service.d.ts.map +1 -1
- package/dist/server/mcp/service.js +138 -36
- package/dist/server/mcp/service.js.map +1 -1
- package/dist/server/mcp/stdio-transport.d.ts +23 -0
- package/dist/server/mcp/stdio-transport.d.ts.map +1 -0
- package/dist/server/mcp/stdio-transport.js +101 -0
- package/dist/server/mcp/stdio-transport.js.map +1 -0
- package/dist/server/mcp/types.d.ts +133 -8
- package/dist/server/mcp/types.d.ts.map +1 -1
- package/dist/server/routes/api.d.ts.map +1 -1
- package/dist/server/routes/api.js +11 -2
- package/dist/server/routes/api.js.map +1 -1
- package/docs/AI_ASSISTANT_SETUP.md +281 -12
- package/docs/API.md +170 -0
- package/docs/CONFIGURATION.md +141 -0
- package/docs/DEVELOPMENT.md +96 -0
- package/docs/GETTING-STARTED.md +114 -0
- package/docs/README.md +40 -1
- package/docs/SETUP_GUIDE.md +60 -14
- package/docs/TESTING.md +81 -0
- package/docs/ai-guide/COMMANDS.md +68 -10
- package/docs/ai-guide/INTEGRATION.md +77 -10
- package/docs/ai-guide/OUTPUT.md +345 -9
- package/docs/ai-guide/PROMPTS.md +2 -2
- package/docs/ai-guide/QUICKSTART.md +28 -1
- package/docs/ai-guide/README.md +2 -2
- package/docs/archive/ideation/2026-04-15-executable-architecture-constitution-ideation-archive.md +70 -0
- package/docs/archive/ideation/2026-04-20-mycodemap-init-enhancements-ideation-archive.md +109 -0
- package/docs/archive/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation-archive.md +54 -0
- package/docs/backlog.md +232 -144
- package/docs/brainstorms/2026-05-10-agent-effectiveness-validation-requirements.md +112 -0
- package/docs/generated/phase-58/subagent-evidence/claude-hook-example.json +15 -0
- package/docs/generated/phase-58/subagent-evidence/claude-session.md +146 -0
- package/docs/generated/phase-58/subagent-evidence/claude-subagent.json +28 -0
- package/docs/generated/phase-58/subagent-evidence/codex-agent-example.toml +19 -0
- package/docs/generated/phase-58/subagent-evidence/codex-session.md +150 -0
- package/docs/generated/phase-58/subagent-evidence/codex-subagent.json +20 -0
- package/docs/generated/phase-58/subagent-evidence/negative-no-retrieval.json +12 -0
- package/docs/generated/phase-58/subagent-evidence/verification-manifest.json +19 -0
- package/docs/ideation/2026-04-15-executable-architecture-constitution-ideation.md +10 -22
- package/docs/ideation/2026-04-20-mycodemap-init-enhancements-ideation.md +15 -60
- package/docs/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation.md +47 -52
- package/docs/ideation/2026-04-29-ux-install-agent-experience-ideation.md +256 -0
- package/docs/ideation/2026-05-02-subagent-environment-contract-injection-ideation.md +183 -0
- package/docs/ideation/2026-05-04-subagent-hooks-deep-dive-ideation.md +133 -0
- package/docs/ideation/2026-05-10-agent-effectiveness-validation-ideation.md +219 -0
- package/docs/plans/2026-04-30-install-guide-and-repo-analyzer-design.md +394 -0
- package/docs/rules/README.md +1 -0
- package/docs/rules/architecture-guardrails.md +2 -1
- package/docs/rules/engineering-with-codex-openai.md +1 -1
- package/docs/rules/harness.md +106 -0
- package/docs/rules/pre-release-checklist.md +28 -0
- package/docs/rules/testing.md +51 -0
- package/examples/claude/skills/mycodemap-repo-analyzer/SKILL.md +294 -0
- package/examples/claude/skills/mycodemap-repo-analyzer/references/analysis-guide.md +166 -0
- package/examples/claude/skills/mycodemap-repo-analyzer/references/module-analysis-guide.md +150 -0
- package/package.json +12 -4
- package/scripts/copy-build-assets.mjs +23 -0
- package/scripts/hooks/templates/pre-commit +33 -2
- package/scripts/sync-analyze-docs.js +2 -2
- package/scripts/tests/test_rule_control_workflow.py +15 -1
- package/scripts/validate-docs.js +113 -16
- package/scripts/verify-subagent-env-contract.mjs +279 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts +0 -57
- package/dist/parser/implementations/tree-sitter-parser.d.ts.map +0 -1
- package/dist/parser/implementations/tree-sitter-parser.js +0 -375
- package/dist/parser/implementations/tree-sitter-parser.js.map +0 -1
- package/docs/references/tmp.md +0 -527
package/docs/TESTING.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
3
|
+
# Testing
|
|
4
|
+
|
|
5
|
+
## Test Stack
|
|
6
|
+
|
|
7
|
+
CodeMap uses Vitest (`^1.1.0`) for unit, integration, and workflow tests. Coverage reporting is provided by `@vitest/coverage-v8` (`^1.6.1`).
|
|
8
|
+
|
|
9
|
+
The default configuration (`vitest.config.ts`) runs tests in `src/**/*.test.ts` with a Node environment, `globals: true`, and a `threads` pool (max 2 threads). The E2E suite uses a separate configuration (`vitest.e2e.config.ts`) that runs `tests/e2e/**/*.test.ts` with up to 4 threads. Both configs enforce a 10-second timeout per test and hook.
|
|
10
|
+
|
|
11
|
+
No global setup file is required; install dependencies with `npm ci` (or `npm install`) and run tests directly.
|
|
12
|
+
|
|
13
|
+
## Main Test Commands
|
|
14
|
+
|
|
15
|
+
| Command | Purpose |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `npm test` | Run the default Vitest suite (all `src/**/*.test.ts` files) |
|
|
18
|
+
| `npm run test:e2e` | Run the end-to-end workflow suite (`tests/e2e/**/*.test.ts`) |
|
|
19
|
+
| `npx vitest` | Start Vitest in watch mode |
|
|
20
|
+
| `npm run benchmark` | Run benchmark validation |
|
|
21
|
+
| `npm run test:all` | Run tests followed by benchmarks |
|
|
22
|
+
| `npm run check:all` | Run typecheck, lint, tests, and docs validation |
|
|
23
|
+
|
|
24
|
+
## What the Tests Cover
|
|
25
|
+
|
|
26
|
+
- CLI command behavior and output formatting
|
|
27
|
+
- parser and analyzer logic
|
|
28
|
+
- storage backends and fallback behavior
|
|
29
|
+
- HTTP API route handling
|
|
30
|
+
- MCP and env-contract plumbing
|
|
31
|
+
- release, workflow, and guardrail commands
|
|
32
|
+
|
|
33
|
+
## Practical Guidance
|
|
34
|
+
|
|
35
|
+
- Prefer real filesystem and subprocess behavior for workflow and integration tests.
|
|
36
|
+
- Use mocks for small units, but do not substitute mocks for end-to-end behavior that the repository already exercises with real I/O.
|
|
37
|
+
- When a test changes command output, update the docs if the user-facing behavior changed.
|
|
38
|
+
|
|
39
|
+
## Running a Single File
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx vitest run src/core/__tests__/analyzer.test.ts
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Writing New Tests
|
|
46
|
+
|
|
47
|
+
Unit and integration tests live next to source code in `src/**/__tests__/*.test.ts`. End-to-end tests live in `tests/e2e/*.e2e.test.ts`. There is no dedicated global setup or shared helper file; tests import Vitest's `describe`, `it`, and `expect` directly.
|
|
48
|
+
|
|
49
|
+
When adding a new test:
|
|
50
|
+
- Place unit tests in `src/<module>/__tests__/<name>.test.ts`
|
|
51
|
+
- Place E2E tests in `tests/e2e/<name>.e2e.test.ts`
|
|
52
|
+
- Use `tests/fixtures/` for sample project data and `tests/golden/` for expected output snapshots
|
|
53
|
+
|
|
54
|
+
## Coverage Requirements
|
|
55
|
+
|
|
56
|
+
No minimum coverage threshold is configured in `vitest.config.ts`. Coverage is generated on demand with:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx vitest run --coverage
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The default reporter outputs text, lcov, and HTML to `./coverage`.
|
|
63
|
+
|
|
64
|
+
## CI Integration
|
|
65
|
+
|
|
66
|
+
Tests run in the **CI Gateway** workflow (`.github/workflows/ci-gateway.yml`), which triggers on pushes and pull requests to `main` and `develop`.
|
|
67
|
+
|
|
68
|
+
Relevant CI steps:
|
|
69
|
+
1. `npm test` — runs the default Vitest suite
|
|
70
|
+
2. `npm run test:e2e` — runs the E2E workflow guardrail
|
|
71
|
+
|
|
72
|
+
The same workflow also runs typecheck, lint, docs validation, contract gate checks, and CLI guardrails before considering the build green.
|
|
73
|
+
|
|
74
|
+
## Before Release
|
|
75
|
+
|
|
76
|
+
Run the validation gates that protect the repo:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm run docs:check
|
|
80
|
+
npm run docs:check:pre-release
|
|
81
|
+
```
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> 完整的 CLI 命令详解
|
|
4
4
|
>
|
|
5
|
-
> CodeMap 是 AI-
|
|
6
|
-
>
|
|
5
|
+
> CodeMap 是 AI-Native 优先、人类友好的代码架构治理基础设施。以下文档记录当前公开命令,并补充已移除命令的迁移提示。
|
|
6
|
+
> 命名规范:公开命令示例统一使用 `mycodemap`;`codemap` 只作为兼容别名保留,不作为新示例首选。
|
|
7
|
+
> v2.0 AI-First Default Output:默认输出 JSON/NDJSON(非 TTY 或显式 `--json`),人类阅读使用 `--human` 或 TTY 自动检测。
|
|
7
8
|
|
|
8
9
|
---
|
|
9
10
|
|
|
@@ -124,7 +125,9 @@ mycodemap impact -f "src/cli/index.ts" -j # JSON 输出
|
|
|
124
125
|
|
|
125
126
|
---
|
|
126
127
|
|
|
127
|
-
### mcp -
|
|
128
|
+
### mcp - MCP 集成 (CLI-as-MCP Automatic Gateway)
|
|
129
|
+
|
|
130
|
+
> v2.0 升级为 CLI-as-MCP Automatic Gateway。所有 20+ schema 定义的 CLI 命令自动暴露为 MCP tools;动态 tool 注册。
|
|
128
131
|
|
|
129
132
|
```bash
|
|
130
133
|
mycodemap mcp install # 把当前仓库写入 .mcp.json
|
|
@@ -134,14 +137,14 @@ mycodemap generate --symbol-level # 使用前必须先生成 symbol-leve
|
|
|
134
137
|
|
|
135
138
|
| 子命令 | 说明 |
|
|
136
139
|
|--------|------|
|
|
137
|
-
| `install` | 更新当前仓库根目录 `.mcp.json`,追加 `mycodemap
|
|
138
|
-
| `start` | 启动 local-only / read-only / stdio-first
|
|
140
|
+
| `install` | 更新当前仓库根目录 `.mcp.json`,追加 `mycodemap` server entry |
|
|
141
|
+
| `start` | 启动 local-only / read-only / stdio-first MCP server |
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
-
|
|
143
|
+
**v2.0 行为**:
|
|
144
|
+
- CLI-as-MCP Automatic Gateway:所有 schema 定义的命令(`generate`、`query`、`deps`、`impact`、`analyze`、`doctor`、`benchmark`、`design`、`check`、`ci`、`history`、`workflow` 等)自动映射为 MCP tools。
|
|
145
|
+
- 动态 tool 注册:新增命令无需手动更新 MCP server,schema 变更后自动生效。
|
|
142
146
|
- `mcp start` 的 `stdout` 只能承载 MCP 协议帧;欢迎信息、迁移提示与 runtime log 不会走这条流。
|
|
143
|
-
-
|
|
144
|
-
- `codemap_query` / `codemap_impact` 都会返回 `graph_status`、`generated_at` 与显式 `error.code`。
|
|
147
|
+
- 所有 MCP tools 返回 `graph_status`、`generated_at` 与显式 `error.code`。
|
|
145
148
|
- 若图尚未生成,会返回 `GRAPH_NOT_FOUND`;若符号不存在,返回 `SYMBOL_NOT_FOUND`;若同名符号无法消歧,返回 `AMBIGUOUS_EDGE`。
|
|
146
149
|
- 详细安装步骤见 `docs/ai-guide/INTEGRATION.md`;完整 output contract 见 `docs/ai-guide/OUTPUT.md`。
|
|
147
150
|
|
|
@@ -248,6 +251,7 @@ mycodemap analyze -i show -t "src/index.ts" --output-mode human
|
|
|
248
251
|
| `--include-tests` | 包含测试文件关联 | - |
|
|
249
252
|
| `--include-git-history` | 包含 Git 历史分析 | - |
|
|
250
253
|
| `--json` | JSON 格式输出 | - |
|
|
254
|
+
| `--human` | 强制人类可读输出(覆盖非 TTY 默认 JSON 行为) | - |
|
|
251
255
|
| `--structured` | 纯结构化输出(移除自然语言字段,配合 `--json` 使用) | - |
|
|
252
256
|
| `--output-mode <mode>` | 输出模式:`machine`/`human` | `human` |
|
|
253
257
|
<!-- END GENERATED: analyze-commands-options -->
|
|
@@ -515,6 +519,60 @@ mycodemap workflow template recommend "任务" # 推荐模板
|
|
|
515
519
|
|
|
516
520
|
---
|
|
517
521
|
|
|
522
|
+
## doctor - 持续健康诊断
|
|
523
|
+
|
|
524
|
+
> v2.0 新增。检测 ghost 命令、native 依赖问题、workspace drift、agent 连通性。
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
mycodemap doctor # 人类可读摘要
|
|
528
|
+
mycodemap doctor --json # 机器可读完整诊断
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
| 类别 | 检查项 | 说明 |
|
|
532
|
+
|------|--------|------|
|
|
533
|
+
| `install` | native 依赖完整性 | 检查 `better-sqlite3` 等 native 模块是否可加载 |
|
|
534
|
+
| `config` | workspace 完整性 | 检查 `.mycodemap/config.json`、图存储后端配置 |
|
|
535
|
+
| `runtime` | ghost 命令检测 | 检测已注册但无实际实现的命令 |
|
|
536
|
+
| `agent` | MCP 连通性 | 检查 MCP server 注册与工具发现是否正常 |
|
|
537
|
+
|
|
538
|
+
- 每个类别独立返回 `ok` / `warn` / `error` 状态
|
|
539
|
+
- `--json` 输出纯结构化 diagnostics,包含 `categories[]`、`summary`、`recommendations`
|
|
540
|
+
- `error` 级别诊断会设置非零 exit code
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## benchmark - WASM vs Native 性能对比
|
|
545
|
+
|
|
546
|
+
> v2.0 新增。对比 WASM fallback 与 Native 实现的性能差异。
|
|
547
|
+
|
|
548
|
+
```bash
|
|
549
|
+
mycodemap benchmark # 完整对比(WASM + Native)
|
|
550
|
+
mycodemap benchmark --wasm # 仅 WASM 性能
|
|
551
|
+
mycodemap benchmark --native # 仅 Native 性能
|
|
552
|
+
mycodemap benchmark --json # JSON 输出
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
- 输出包含各分析阶段的耗时对比(generate、query、deps、impact 等)
|
|
556
|
+
- `--json` 输出结构化 benchmark 结果,便于 CI 集成与回归检测
|
|
557
|
+
- 用于决定是否启用 WASM fallback 或排查性能退化
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## --schema - 接口契约输出
|
|
562
|
+
|
|
563
|
+
> v2.0 新增。输出完整的 Interface Contract Schema JSON,供 agent 自省与动态 tool 注册。
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
mycodemap --schema # 输出完整 schema JSON
|
|
567
|
+
mycodemap --schema | jq '.' # 格式化查看
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
- 单一 schema 同时生成:parser、MCP tools、`--help-json`、shell completions
|
|
571
|
+
- Agent 可通过读取 schema 动态发现所有可用命令及其参数契约
|
|
572
|
+
- 输出包含所有 20+ 命令的完整接口定义(参数、类型、返回值结构)
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
518
576
|
## 已移除的公共命令
|
|
519
577
|
|
|
520
578
|
以下命令已从 public CLI 移除;直接调用时,CLI 会显式失败并给出迁移提示,而不是继续执行旧功能。
|
|
@@ -544,7 +602,7 @@ mycodemap export json -o ./output.json # 指定输出
|
|
|
544
602
|
|
|
545
603
|
### ship - 一键智能发布(非代码地图首屏能力)
|
|
546
604
|
|
|
547
|
-
> `ship` 负责发布整合,不是
|
|
605
|
+
> `ship` 负责发布整合,不是 CodeMap 代码分析的首屏入口;首次接触项目时优先使用分析命令而非发布命令。
|
|
548
606
|
|
|
549
607
|
```bash
|
|
550
608
|
mycodemap ship # 完整发布流程
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI Guide - MCP / Agent 集成
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> v2.0 更新:CLI-as-MCP Automatic Gateway。所有 schema 定义的 CLI 命令自动暴露为 MCP tools。
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -11,11 +11,16 @@
|
|
|
11
11
|
| transport | 本地 `stdio` |
|
|
12
12
|
| 读写权限 | **只读** |
|
|
13
13
|
| public surface | `mycodemap mcp install`、`mycodemap mcp start` |
|
|
14
|
-
| MCP tools |
|
|
14
|
+
| MCP tools | **ALL 20+ schema 定义的 CLI 命令** |
|
|
15
15
|
| 图前置条件 | 先执行 `mycodemap generate --symbol-level` |
|
|
16
|
-
| 稳定性 | **
|
|
16
|
+
| 稳定性 | **stable (v2.0)** |
|
|
17
17
|
| 非目标 | HTTP MCP、远程 transport、写操作、全局 host lifecycle |
|
|
18
18
|
|
|
19
|
+
### 动态 Tool 注册
|
|
20
|
+
|
|
21
|
+
- 向 `Interface Contract Schema` 添加新命令 → 重启 MCP server → 新 tool 自动出现在 host 中
|
|
22
|
+
- 无需手写 tool 定义、无需修改 MCP server 代码、无需重新安装
|
|
23
|
+
|
|
19
24
|
---
|
|
20
25
|
|
|
21
26
|
## 1.1 速查表
|
|
@@ -44,7 +49,7 @@ mycodemap generate --symbol-level
|
|
|
44
49
|
mycodemap mcp install
|
|
45
50
|
```
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
该命令在当前仓库根目录的 `.mcp.json` 里写入一个 v2.0 server entry。
|
|
48
53
|
|
|
49
54
|
### Step 3: 让 MCP host 启动 stdio server
|
|
50
55
|
|
|
@@ -57,6 +62,8 @@ mycodemap mcp start
|
|
|
57
62
|
- `stdout` 只承载 MCP 协议帧
|
|
58
63
|
- 欢迎信息、迁移提示、runtime log 不会混入 `stdout`
|
|
59
64
|
|
|
65
|
+
> **v2.0 关键变更**:所有在 `Interface Contract Schema` 中定义的命令自动作为 MCP tools 可用。无需手写 tool 定义,无需逐个注册。
|
|
66
|
+
|
|
60
67
|
---
|
|
61
68
|
|
|
62
69
|
## 3. `.mcp.json` 参考配置
|
|
@@ -66,7 +73,7 @@ mycodemap mcp start
|
|
|
66
73
|
```json
|
|
67
74
|
{
|
|
68
75
|
"mcpServers": {
|
|
69
|
-
"mycodemap
|
|
76
|
+
"mycodemap": {
|
|
70
77
|
"command": "node",
|
|
71
78
|
"args": ["dist/cli/index.js", "mcp", "start"],
|
|
72
79
|
"cwd": "/absolute/path/to/repo",
|
|
@@ -80,7 +87,7 @@ mycodemap mcp start
|
|
|
80
87
|
|
|
81
88
|
### 当前宿主支持边界
|
|
82
89
|
|
|
83
|
-
-
|
|
90
|
+
- 当前文档只保证 **repo-local `.mcp.json`** 这一路径
|
|
84
91
|
- 不承诺全局安装、升级覆盖策略或卸载命令
|
|
85
92
|
- 若你的 host 不读取 `.mcp.json`,请手动拷贝上面的 server entry 到宿主自己的 MCP 配置文件
|
|
86
93
|
|
|
@@ -88,7 +95,25 @@ mycodemap mcp start
|
|
|
88
95
|
|
|
89
96
|
## 4. MCP tool contract
|
|
90
97
|
|
|
91
|
-
###
|
|
98
|
+
### Gateway 模式
|
|
99
|
+
|
|
100
|
+
CLI-as-MCP Automatic Gateway 将所有 CLI 命令统一映射为 MCP tools:
|
|
101
|
+
|
|
102
|
+
| CLI 命令 | MCP tool 名 | 输入参数 |
|
|
103
|
+
|----------|-------------|----------|
|
|
104
|
+
| `mycodemap query -s X` | `codemap_query` | `{ symbol: string, filePath?: string }` |
|
|
105
|
+
| `mycodemap impact -f X` | `codemap_impact` | `{ symbol: string, filePath?: string, depth?: number, limit?: number }` |
|
|
106
|
+
| `mycodemap doctor` | `codemap_doctor` | `{ category?: string, json?: boolean }` |
|
|
107
|
+
| `mycodemap benchmark` | `codemap_benchmark` | `{ command?: string, json?: boolean }` |
|
|
108
|
+
| `mycodemap analyze -i find -k X` | `codemap_analyze` | `{ intent: string, keyword: string, ... }` |
|
|
109
|
+
| ... | ... | ... |
|
|
110
|
+
|
|
111
|
+
映射规则:
|
|
112
|
+
- CLI 命令名 → MCP tool 名前缀为 `codemap_`
|
|
113
|
+
- CLI 短选项(`-s`)和长选项(`--symbol`)→ MCP tool 参数名使用长选项名
|
|
114
|
+
- CLI 输出结构 → MCP tool 返回结构完全一致
|
|
115
|
+
|
|
116
|
+
### `codemap_query`(示例之一)
|
|
92
117
|
|
|
93
118
|
输入:
|
|
94
119
|
|
|
@@ -107,7 +132,7 @@ interface CodemapQueryInput {
|
|
|
107
132
|
- `generated_at`
|
|
108
133
|
- `error.code`(若失败)
|
|
109
134
|
|
|
110
|
-
### `codemap_impact
|
|
135
|
+
### `codemap_impact`(示例之一)
|
|
111
136
|
|
|
112
137
|
输入:
|
|
113
138
|
|
|
@@ -128,7 +153,7 @@ interface CodemapImpactInput {
|
|
|
128
153
|
- `generated_at`
|
|
129
154
|
- `error.code`(若失败)
|
|
130
155
|
|
|
131
|
-
> 完整输出类型见 `docs/ai-guide/OUTPUT.md
|
|
156
|
+
> 完整输出类型见 `docs/ai-guide/OUTPUT.md`。以上仅为 20+ tools 中的两个示例。
|
|
132
157
|
|
|
133
158
|
---
|
|
134
159
|
|
|
@@ -140,6 +165,40 @@ interface CodemapImpactInput {
|
|
|
140
165
|
| `SYMBOL_NOT_FOUND` | 请求的 symbol 不存在 | 检查拼写,或先用 `query -S` / `analyze -i find` 搜索 |
|
|
141
166
|
| `AMBIGUOUS_EDGE` | 同名 symbol 无法仅靠 `symbol` / `filePath` 消歧 | 补充更具体的 `filePath` |
|
|
142
167
|
|
|
168
|
+
### Failure-to-Action Protocol
|
|
169
|
+
|
|
170
|
+
v2.0 错误响应包含可执行的修复指引:
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
interface McpError {
|
|
174
|
+
code: string;
|
|
175
|
+
message: string;
|
|
176
|
+
details?: Record<string, unknown>;
|
|
177
|
+
// Failure-to-Action Protocol 字段
|
|
178
|
+
rootCause?: string; // 根因分析
|
|
179
|
+
remediationPlan?: string[]; // 修复步骤(按优先级)
|
|
180
|
+
confidence: "high" | "medium" | "low";
|
|
181
|
+
nextCommand?: string; // 建议执行的下一步命令
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
示例:
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"code": "GRAPH_NOT_FOUND",
|
|
190
|
+
"message": "symbol-level 图不存在",
|
|
191
|
+
"rootCause": "未执行 mycodemap generate --symbol-level",
|
|
192
|
+
"remediationPlan": [
|
|
193
|
+
"mycodemap generate --symbol-level",
|
|
194
|
+
"mycodemap mcp install",
|
|
195
|
+
"重启 MCP host"
|
|
196
|
+
],
|
|
197
|
+
"confidence": "high",
|
|
198
|
+
"nextCommand": "mycodemap generate --symbol-level"
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
143
202
|
### `graph_status` 解读
|
|
144
203
|
|
|
145
204
|
| 值 | 含义 |
|
|
@@ -158,6 +217,8 @@ interface CodemapImpactInput {
|
|
|
158
217
|
mycodemap query -s "SymbolName" -j
|
|
159
218
|
mycodemap impact -f "src/file.ts" -j
|
|
160
219
|
mycodemap analyze -i find -k "SymbolName" --json --structured
|
|
220
|
+
mycodemap doctor --json
|
|
221
|
+
mycodemap benchmark --json
|
|
161
222
|
```
|
|
162
223
|
|
|
163
224
|
但要注意:
|
|
@@ -178,7 +239,7 @@ mycodemap generate --symbol-level
|
|
|
178
239
|
### `mcp install` 后看不到 server
|
|
179
240
|
|
|
180
241
|
- 确认 host 会读取当前仓库根目录的 `.mcp.json`
|
|
181
|
-
- 不会读取的话,手动复制 `mycodemap
|
|
242
|
+
- 不会读取的话,手动复制 `mycodemap` entry 到宿主配置
|
|
182
243
|
|
|
183
244
|
### `mcp start` 无法启动
|
|
184
245
|
|
|
@@ -200,6 +261,12 @@ npm ls better-sqlite3
|
|
|
200
261
|
- 先检查 `graph_status` 是否为 `partial`
|
|
201
262
|
- 再检查 symbol 是否真的唯一;必要时补 `filePath`
|
|
202
263
|
|
|
264
|
+
### 新增命令后 MCP host 看不到新 tool
|
|
265
|
+
|
|
266
|
+
- 确认新命令已注册到 `Interface Contract Schema`(`mycodemap --schema` 检查)
|
|
267
|
+
- 重启 MCP server(host 侧或 `mycodemap mcp start`)
|
|
268
|
+
- 不需要重新运行 `mcp install`,除非 server entry 本身有变更
|
|
269
|
+
|
|
203
270
|
### storage 运行时错误速查表
|
|
204
271
|
|
|
205
272
|
| 错误 / 信号 | 含义 | 处理方式 |
|