@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/API.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
3
|
+
# API Reference
|
|
4
|
+
|
|
5
|
+
CodeMap exposes two runtime surfaces:
|
|
6
|
+
|
|
7
|
+
- a REST API mounted under `/api/v1`
|
|
8
|
+
- an experimental MCP server for stdio-based agent integrations
|
|
9
|
+
|
|
10
|
+
## Server Configuration
|
|
11
|
+
|
|
12
|
+
`CodeMapServer` defaults to:
|
|
13
|
+
|
|
14
|
+
- `host: 0.0.0.0`
|
|
15
|
+
- `port: 3000`
|
|
16
|
+
|
|
17
|
+
Optional server config includes:
|
|
18
|
+
|
|
19
|
+
- `cors.origin`
|
|
20
|
+
- `cors.credentials`
|
|
21
|
+
- `auth.type` with `none`, `bearer`, or `api-key`
|
|
22
|
+
|
|
23
|
+
## Authentication
|
|
24
|
+
|
|
25
|
+
The server configuration accepts an optional `auth` field, but authentication is **not enforced by middleware** in the current implementation. All endpoints are publicly accessible when the server is started with default settings.
|
|
26
|
+
|
|
27
|
+
When `auth.type` is set to `bearer` or `api-key`, consumers should include the credential in the `Authorization` header. <!-- VERIFY: actual header format and secret rotation are not implemented in route middleware -->
|
|
28
|
+
|
|
29
|
+
## Endpoints Overview
|
|
30
|
+
|
|
31
|
+
All endpoints are mounted under `/api/v1`.
|
|
32
|
+
|
|
33
|
+
| Method | Path | Description | Auth Required |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| GET | `/health` | Basic health check | No |
|
|
36
|
+
| GET | `/search/symbols` | Search symbols by query string | No |
|
|
37
|
+
| GET | `/search/modules` | Search modules by query string | No |
|
|
38
|
+
| GET | `/modules/:id` | Module detail | No |
|
|
39
|
+
| GET | `/symbols/:id` | Symbol detail | No |
|
|
40
|
+
| GET | `/symbols/:id/callers` | Incoming callers for a symbol | No |
|
|
41
|
+
| GET | `/symbols/:id/callees` | Outgoing callees for a symbol | No |
|
|
42
|
+
| POST | `/analysis` | Run analysis for a project path | No |
|
|
43
|
+
| POST | `/analysis/refresh` | Refresh an existing project | No |
|
|
44
|
+
| POST | `/analysis/impact` | Analyze the impact of a module change | No |
|
|
45
|
+
| GET | `/analysis/cycles` | Detect circular dependencies | No |
|
|
46
|
+
| GET | `/analysis/validate` | Validate the current code graph | No |
|
|
47
|
+
| GET | `/stats` | Project statistics | No |
|
|
48
|
+
| GET | `/graph` | Dependency graph data for visualization | No |
|
|
49
|
+
| GET | `/export/:format` | Export graph data | No |
|
|
50
|
+
|
|
51
|
+
### Query Parameters
|
|
52
|
+
|
|
53
|
+
Search endpoints accept:
|
|
54
|
+
|
|
55
|
+
- `q` — string, default empty
|
|
56
|
+
- `limit` — number, default `50`
|
|
57
|
+
|
|
58
|
+
The graph endpoint accepts:
|
|
59
|
+
|
|
60
|
+
- `page` — number, default `1`
|
|
61
|
+
- `limit` — number, default `100`
|
|
62
|
+
|
|
63
|
+
### Export Formats
|
|
64
|
+
|
|
65
|
+
`export/:format` accepts `json`, `graphml`, and `dot`. The response is returned as a file download with the appropriate `Content-Type` and `Content-Disposition` headers.
|
|
66
|
+
|
|
67
|
+
## Request/Response Formats
|
|
68
|
+
|
|
69
|
+
### Response Envelope
|
|
70
|
+
|
|
71
|
+
Every JSON endpoint returns an `ApiResponse<T>` envelope:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"success": true,
|
|
76
|
+
"data": { ... },
|
|
77
|
+
"meta": {
|
|
78
|
+
"timestamp": "2026-05-11T08:49:11.768Z",
|
|
79
|
+
"requestId": "req_1746989351768_abc1234"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
On failure:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"success": false,
|
|
89
|
+
"error": {
|
|
90
|
+
"code": "NOT_FOUND",
|
|
91
|
+
"message": "Module xyz not found"
|
|
92
|
+
},
|
|
93
|
+
"meta": {
|
|
94
|
+
"timestamp": "2026-05-11T08:49:11.768Z",
|
|
95
|
+
"requestId": "req_1746989351768_abc1234"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Request Bodies
|
|
101
|
+
|
|
102
|
+
**POST `/analysis`**
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"projectPath": "/path/to/project",
|
|
107
|
+
"options": {
|
|
108
|
+
"mode": "tree-sitter"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**POST `/analysis/refresh`**
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"projectPath": "/path/to/project"
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**POST `/analysis/impact`**
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"moduleId": "module-uuid",
|
|
126
|
+
"depth": 3
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For deprecated parser modes, the API returns the same actionable error shape used by the CLI, including `nextCommand` when available.
|
|
131
|
+
|
|
132
|
+
## Error Codes
|
|
133
|
+
|
|
134
|
+
Standard HTTP status codes and their meanings in this API:
|
|
135
|
+
|
|
136
|
+
| Status | Code | Meaning |
|
|
137
|
+
|---|---|---|
|
|
138
|
+
| 200 | — | Success |
|
|
139
|
+
| 400 | `INVALID_FORMAT` | Unsupported export format or bad request parameter |
|
|
140
|
+
| 400 | `DEPRECATED_PARSER_MODE` | Requested parser mode is no longer supported |
|
|
141
|
+
| 404 | `NOT_FOUND` | Requested module or symbol does not exist |
|
|
142
|
+
| 500 | `INTERNAL_ERROR` | Unhandled server exception |
|
|
143
|
+
| 500 | `SEARCH_ERROR` | Search operation failed |
|
|
144
|
+
| 500 | `QUERY_ERROR` | Query operation failed |
|
|
145
|
+
| 500 | `ANALYSIS_ERROR` | Analysis operation failed |
|
|
146
|
+
| 500 | `EXPORT_ERROR` | Export operation failed |
|
|
147
|
+
| 500 | `VALIDATION_ERROR` | Validation operation failed |
|
|
148
|
+
| 501 | `ANALYSIS_NOT_SUPPORTED` | Analysis operation is not supported by the server layer |
|
|
149
|
+
| 501 | `INCREMENTAL_UPDATE_NOT_SUPPORTED` | Incremental update is not supported |
|
|
150
|
+
| 501 | `REFRESH_NOT_SUPPORTED` | Refresh operation is not supported by the server layer |
|
|
151
|
+
|
|
152
|
+
The 404 handler also returns a standard error envelope for unmatched routes:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"success": false,
|
|
157
|
+
"error": {
|
|
158
|
+
"code": "NOT_FOUND",
|
|
159
|
+
"message": "Route /api/v1/unknown not found"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Rate Limits
|
|
165
|
+
|
|
166
|
+
No rate limiting is currently configured for the API.
|
|
167
|
+
|
|
168
|
+
## MCP
|
|
169
|
+
|
|
170
|
+
The MCP server lives under `src/server/mcp/` and is started via the `mcp start` CLI path. It is intentionally experimental and uses the process' stdio transport rather than the REST API transport.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
3
|
+
# Configuration
|
|
4
|
+
|
|
5
|
+
## Config File Resolution
|
|
6
|
+
|
|
7
|
+
CodeMap reads config files in this order:
|
|
8
|
+
|
|
9
|
+
1. `.mycodemap/config.json`
|
|
10
|
+
2. `mycodemap.config.json`
|
|
11
|
+
3. `codemap.config.json`
|
|
12
|
+
|
|
13
|
+
`mycodemap init` writes the canonical config under `.mycodemap/config.json` unless you are explicitly using a legacy path.
|
|
14
|
+
|
|
15
|
+
## Config File Format
|
|
16
|
+
|
|
17
|
+
The configuration file is JSON-based. The canonical location is `.mycodemap/config.json`, with fallback to `mycodemap.config.json` or `codemap.config.json` in the project root.
|
|
18
|
+
|
|
19
|
+
Top-level keys:
|
|
20
|
+
|
|
21
|
+
| Key | Type | Default | Description |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| `$schema` | string | `https://mycodemap.dev/schema/config.json` | JSON Schema reference for editor tooling |
|
|
24
|
+
| `mode` | string | `"tree-sitter"` | Parser mode. Only `"tree-sitter"` is valid; legacy values (`fast`, `smart`, `hybrid`) are rejected. |
|
|
25
|
+
| `include` | string[] | `["src/**/*.ts"]` | Glob patterns to include in analysis |
|
|
26
|
+
| `exclude` | string[] | See defaults below | Glob patterns to exclude from analysis |
|
|
27
|
+
| `output` | string | `".mycodemap"` | Output directory for generated files |
|
|
28
|
+
| `watch` | boolean | `false` | Enable watch mode for file changes |
|
|
29
|
+
| `storage` | object | See below | Storage backend configuration |
|
|
30
|
+
| `plugins` | object | See below | Plugin loading options |
|
|
31
|
+
|
|
32
|
+
Example:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"$schema": "https://mycodemap.dev/schema/config.json",
|
|
37
|
+
"mode": "tree-sitter",
|
|
38
|
+
"include": ["src/**/*.ts"],
|
|
39
|
+
"exclude": [
|
|
40
|
+
"node_modules/**",
|
|
41
|
+
"dist/**",
|
|
42
|
+
"build/**",
|
|
43
|
+
"coverage/**",
|
|
44
|
+
".venv/**",
|
|
45
|
+
"**/__pycache__/**",
|
|
46
|
+
"vendor/**",
|
|
47
|
+
"**/*.test.ts",
|
|
48
|
+
"**/*.spec.ts",
|
|
49
|
+
"**/*.d.ts"
|
|
50
|
+
],
|
|
51
|
+
"output": ".mycodemap",
|
|
52
|
+
"watch": false,
|
|
53
|
+
"storage": {
|
|
54
|
+
"type": "sqlite",
|
|
55
|
+
"databasePath": ".mycodemap/governance.sqlite"
|
|
56
|
+
},
|
|
57
|
+
"plugins": {
|
|
58
|
+
"builtInPlugins": true,
|
|
59
|
+
"plugins": [],
|
|
60
|
+
"debug": false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Defaults
|
|
66
|
+
|
|
67
|
+
The following defaults are applied when a key is omitted from the config file or no config file exists:
|
|
68
|
+
|
|
69
|
+
| Key | Default | Source |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `mode` | `"tree-sitter"` | `src/cli/config-loader.ts:42` |
|
|
72
|
+
| `include` | `["src/**/*.ts"]` | `src/cli/config-loader.ts:43` |
|
|
73
|
+
| `exclude` | `["node_modules/**", "dist/**", "build/**", "coverage/**", ".venv/**", "**/__pycache__/**", "vendor/**", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]` | `src/core/file-discovery.ts:8` |
|
|
74
|
+
| `output` | `".mycodemap"` | `src/cli/config-loader.ts:44` |
|
|
75
|
+
| `watch` | `false` | `src/cli/config-loader.ts:254` |
|
|
76
|
+
| `storage.type` | `"sqlite"` | `src/cli/config-loader.ts:243` |
|
|
77
|
+
| `storage.databasePath` | `".mycodemap/governance.sqlite"` | `src/cli/config-loader.ts:244` |
|
|
78
|
+
| `plugins.builtInPlugins` | `true` | `src/cli/config-loader.ts:235` |
|
|
79
|
+
| `plugins.plugins` | `[]` | `src/cli/config-loader.ts:236` |
|
|
80
|
+
| `plugins.debug` | `false` | `src/cli/config-loader.ts:237` |
|
|
81
|
+
|
|
82
|
+
## Storage
|
|
83
|
+
|
|
84
|
+
Supported storage types:
|
|
85
|
+
|
|
86
|
+
- `sqlite` default persistent backend
|
|
87
|
+
- `memory` for tests and ephemeral runs
|
|
88
|
+
- `auto` as a SQLite-family alias
|
|
89
|
+
|
|
90
|
+
Unsupported legacy backends are rejected:
|
|
91
|
+
|
|
92
|
+
- `filesystem`
|
|
93
|
+
- `kuzudb`
|
|
94
|
+
- `neo4j`
|
|
95
|
+
|
|
96
|
+
The storage factory now routes persistent storage through the SQLite family only.
|
|
97
|
+
|
|
98
|
+
## Parser Mode
|
|
99
|
+
|
|
100
|
+
The active parser mode is `tree-sitter`. Deprecated inputs `fast`, `smart`, and `hybrid` are rejected by the CLI and server entry points.
|
|
101
|
+
|
|
102
|
+
## Environment Variables
|
|
103
|
+
|
|
104
|
+
| Variable | Required | Default | Description |
|
|
105
|
+
|---|---|---|---|
|
|
106
|
+
| `MYCODEMAP_RUNTIME_LOG_ENABLED` | Optional | `true` | Enable or disable runtime logs |
|
|
107
|
+
| `MYCODEMAP_RUNTIME_LOG_DIR` | Optional | `.mycodemap/logs` | Set the runtime log directory |
|
|
108
|
+
| `MYCODEMAP_RUNTIME_LOG_RETENTION_DAYS` | Optional | `14` | Retain logs for this many days |
|
|
109
|
+
| `MYCODEMAP_RUNTIME_LOG_MAX_FILES` | Optional | `30` | Cap the number of runtime log files |
|
|
110
|
+
| `MYCODEMAP_RUNTIME_LOG_MAX_SIZE_MB` | Optional | `10` | Cap the size of a single runtime log file |
|
|
111
|
+
| `CODEMAP_USE_WASM_TREE_SITTER` | Optional | — | Force the tree-sitter loader to use WASM when set to `1` |
|
|
112
|
+
| `CODEMAP_USE_WASM_BETTER_SQLITE3` | Optional | — | Force SQLite fallback behavior when set to `1` |
|
|
113
|
+
| `GITHUB_TOKEN` | Optional | — | Preferred token for release monitoring and GitHub API access |
|
|
114
|
+
| `GH_TOKEN` | Optional | — | Fallback token for release monitoring |
|
|
115
|
+
| `SHIP_IN_CI` | Optional | — | Skip local release checks inside CI when set to `1` |
|
|
116
|
+
|
|
117
|
+
The runtime logger accepts the `CODEMAP_*` legacy variables as fallbacks for the newer `MYCODEMAP_*` names:
|
|
118
|
+
|
|
119
|
+
- `CODEMAP_RUNTIME_LOG_ENABLED` → fallback for `MYCODEMAP_RUNTIME_LOG_ENABLED`
|
|
120
|
+
- `CODEMAP_RUNTIME_LOG_DIR` → fallback for `MYCODEMAP_RUNTIME_LOG_DIR`
|
|
121
|
+
- `CODEMAP_RUNTIME_LOG_RETENTION_DAYS` → fallback for `MYCODEMAP_RUNTIME_LOG_RETENTION_DAYS`
|
|
122
|
+
- `CODEMAP_RUNTIME_LOG_MAX_FILES` → fallback for `MYCODEMAP_RUNTIME_LOG_MAX_FILES`
|
|
123
|
+
- `CODEMAP_RUNTIME_LOG_MAX_SIZE_MB` → fallback for `MYCODEMAP_RUNTIME_LOG_MAX_SIZE_MB`
|
|
124
|
+
|
|
125
|
+
## Required vs Optional Settings
|
|
126
|
+
|
|
127
|
+
All configuration settings are optional. CodeMap starts successfully with no configuration file and no environment variables set. If a config file is present, any omitted keys use the built-in defaults listed above. Invalid values (such as deprecated parser modes or unsupported storage types) cause the CLI to exit with an error rather than falling back silently.
|
|
128
|
+
|
|
129
|
+
## Per-Environment Overrides
|
|
130
|
+
|
|
131
|
+
No per-environment config files (`.env.development`, `.env.production`, `.env.test`) are built into CodeMap. Environment-specific behavior is controlled through:
|
|
132
|
+
|
|
133
|
+
- **Environment variables** — set `MYCODEMAP_RUNTIME_LOG_ENABLED=false` in CI to disable log noise, or `SHIP_IN_CI=1` to skip local release checks.
|
|
134
|
+
- **WASM toggles** — `CODEMAP_USE_WASM_TREE_SITTER` and `CODEMAP_USE_WASM_BETTER_SQLITE3` can be set per environment to force fallback behavior.
|
|
135
|
+
- **Separate config files** — you can maintain distinct config files and point to them by placing the appropriate file in the project root, since CodeMap resolves `.mycodemap/config.json` → `mycodemap.config.json` → `codemap.config.json` in that order.
|
|
136
|
+
|
|
137
|
+
## Operational Notes
|
|
138
|
+
|
|
139
|
+
- `mycodemap generate` writes to `.mycodemap/` unless the config overrides `output`.
|
|
140
|
+
- `mycodemap benchmark` toggles the WASM environment variables internally for each measurement.
|
|
141
|
+
- `mycodemap ship` and release monitoring use GitHub token settings from the environment.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
3
|
+
# Development Guide
|
|
4
|
+
|
|
5
|
+
## Local setup
|
|
6
|
+
|
|
7
|
+
Fork and clone the repository, then install dependencies and build:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/yuanyuanyuan/mycodemap.git
|
|
11
|
+
cd mycodemap
|
|
12
|
+
npm install
|
|
13
|
+
npm run build
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- **Node.js:** `>= 20.0.0` (required by `package.json` `engines`)
|
|
17
|
+
- No `.env` file is required for local development.
|
|
18
|
+
|
|
19
|
+
The build emits compiled output into `dist/`, and the package ships the CLI from `dist/cli/index.js`.
|
|
20
|
+
|
|
21
|
+
## Build commands
|
|
22
|
+
|
|
23
|
+
| Command | Description |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `npm run dev` | Watch TypeScript compilation |
|
|
26
|
+
| `npm run build` | Compile the project |
|
|
27
|
+
| `npm run postbuild` | Copy static build assets after compilation |
|
|
28
|
+
| `npm run typecheck` | Type-check without emitting files |
|
|
29
|
+
| `npm run lint` | Run ESLint on `src/` |
|
|
30
|
+
| `npm run fix:all` | Auto-fix lint issues |
|
|
31
|
+
| `npm test` | Run the Vitest suite |
|
|
32
|
+
| `npm run test:all` | Run tests and benchmarks together |
|
|
33
|
+
| `npm run test:e2e` | Run workflow and integration-style tests |
|
|
34
|
+
| `npm run benchmark` | Run benchmark checks |
|
|
35
|
+
| `npm run docs:check` | Validate human and AI documentation |
|
|
36
|
+
| `npm run docs:check:human` | Validate human-facing docs only |
|
|
37
|
+
| `npm run docs:check:ai` | Validate AI-facing docs only |
|
|
38
|
+
| `npm run docs:check:pre-release` | Pre-release docs validation |
|
|
39
|
+
| `npm run check:all` | Full local gate (typecheck + lint + test + docs) |
|
|
40
|
+
| `npm run check:security` | Run `npm audit` for security issues |
|
|
41
|
+
| `npm run validate-pack` | Validate the package before publish |
|
|
42
|
+
| `npm run release` | Run the release script |
|
|
43
|
+
| `npm run ai:pre-task` | Pre-task validation gate (same as `check:all`) |
|
|
44
|
+
| `npm run ai:post-task` | Auto-fix and re-run full validation gate |
|
|
45
|
+
|
|
46
|
+
## Code style
|
|
47
|
+
|
|
48
|
+
The project uses **ESLint** with the TypeScript plugin for linting. Configuration lives in `eslint.config.js`.
|
|
49
|
+
|
|
50
|
+
- **Lint target:** `src/**/*.ts` (test files use relaxed rules)
|
|
51
|
+
- **Run lint:** `npm run lint`
|
|
52
|
+
- **Auto-fix:** `npm run fix:all`
|
|
53
|
+
- **Key rules:** duplicate enum values are errors; unused vars, `any`, and non-null assertions are warnings
|
|
54
|
+
|
|
55
|
+
There is no Prettier, Biome, or `.editorconfig` configured.
|
|
56
|
+
|
|
57
|
+
## Branch conventions
|
|
58
|
+
|
|
59
|
+
No explicit branch naming convention is documented. The CI pipeline runs against `main` and `develop`:
|
|
60
|
+
|
|
61
|
+
- `main` — stable branch
|
|
62
|
+
- `develop` — integration branch
|
|
63
|
+
|
|
64
|
+
## PR process
|
|
65
|
+
|
|
66
|
+
Follow these guidelines when opening a pull request:
|
|
67
|
+
|
|
68
|
+
- Keep each PR focused on a single concern.
|
|
69
|
+
- Include tests for any behavior changes.
|
|
70
|
+
- Run `npm run check:all` before opening the PR.
|
|
71
|
+
- Use the commit format `[TAG] scope: message`. Valid tags: `BUGFIX`, `FEATURE`, `REFACTOR`, `CONFIG`, `DOCS`, `DELETE`.
|
|
72
|
+
- For `FEATURE` or `BUGFIX` commits, include a `[证据]` trail (path references or command output) in the commit message or PR description when you have real-world validation evidence.
|
|
73
|
+
- Mention any remaining risks or skipped verification explicitly in the PR description.
|
|
74
|
+
|
|
75
|
+
## Working Rules
|
|
76
|
+
|
|
77
|
+
- Keep TypeScript files in ESM style with explicit exports.
|
|
78
|
+
- Preserve the file headers that carry `[META]` and `[WHY]` annotations in source files.
|
|
79
|
+
- Prefer small, surgical changes that match the surrounding code.
|
|
80
|
+
- If a change touches CLI behavior, configuration, or public APIs, update the corresponding docs in the same change.
|
|
81
|
+
|
|
82
|
+
## Local Feedback Loop
|
|
83
|
+
|
|
84
|
+
Recommended loop for most changes:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run typecheck
|
|
88
|
+
npm test
|
|
89
|
+
npm run docs:check
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For agent-driven work, `npm run ai:pre-task` and `npm run ai:post-task` wrap the same validation gates used in CI.
|
|
93
|
+
|
|
94
|
+
## Release Notes
|
|
95
|
+
|
|
96
|
+
`npm run release` invokes the release script, and `prepublishOnly` runs the pre-release docs check, build, and tests before publish. Treat those flows as gated operations, not casual dev commands.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
3
|
+
# Getting Started
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js `>= 20.0.0`
|
|
8
|
+
- npm, pnpm, or yarn
|
|
9
|
+
- A repository with source files to analyze
|
|
10
|
+
|
|
11
|
+
The tool can run without native build toolchains. When native dependencies are unavailable, the runtime falls back to WASM paths.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Install from npm (recommended for users)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @mycodemap/mycodemap
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`mycodemap` is the primary binary. `codemap` is kept as an alias.
|
|
22
|
+
|
|
23
|
+
### Build from source (for contributors)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git clone https://github.com/yuanyuanyuan/mycodemap.git
|
|
27
|
+
cd mycodemap
|
|
28
|
+
npm install
|
|
29
|
+
npm run build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After building, run the CLI locally via `node dist/cli/index.js` or link it:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm link
|
|
36
|
+
mycodemap --help
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## First Run
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mycodemap init
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
By default, `init` prints a reconciliation preview. Use `--yes` to apply the plan immediately.
|
|
46
|
+
|
|
47
|
+
If the repository has a recognizable project marker, `init` can auto-detect a profile. Use `--profile <name>` to override that detection.
|
|
48
|
+
|
|
49
|
+
Next:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
mycodemap generate
|
|
53
|
+
mycodemap doctor
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`generate` writes analysis artifacts to `.mycodemap/`. `doctor` checks the runtime, workspace, and agent integrations.
|
|
57
|
+
|
|
58
|
+
## What Gets Written
|
|
59
|
+
|
|
60
|
+
- `.mycodemap/config.json` as the canonical config file
|
|
61
|
+
- `.mycodemap/codemap.json` as the persisted graph data
|
|
62
|
+
- `.mycodemap/logs/` for runtime logs when enabled
|
|
63
|
+
- additional generated reports depending on the command you run
|
|
64
|
+
|
|
65
|
+
## Minimal Workflow
|
|
66
|
+
|
|
67
|
+
1. Install the package.
|
|
68
|
+
2. Run `mycodemap init` or `mycodemap init --yes`.
|
|
69
|
+
3. Run `mycodemap generate`.
|
|
70
|
+
4. Inspect the output in `.mycodemap/`.
|
|
71
|
+
5. Run `mycodemap doctor` if something looks off.
|
|
72
|
+
|
|
73
|
+
## Common Setup Issues
|
|
74
|
+
|
|
75
|
+
### Command not found after global install
|
|
76
|
+
|
|
77
|
+
If `mycodemap` is not recognized after `npm install -g`, refresh the shell hash or use `npx`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
hash -r
|
|
81
|
+
npx mycodemap --help
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Native dependency build failures
|
|
85
|
+
|
|
86
|
+
Packages like `tree-sitter` and `better-sqlite3` may require a C++ compiler on your system. If the install fails:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Ubuntu/Debian
|
|
90
|
+
sudo apt-get install build-essential
|
|
91
|
+
|
|
92
|
+
# macOS
|
|
93
|
+
xcode-select --install
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
When native modules are unavailable, CodeMap falls back to WASM equivalents automatically.
|
|
97
|
+
|
|
98
|
+
### Node.js version mismatch
|
|
99
|
+
|
|
100
|
+
CodeMap requires Node.js `>= 20.0.0`. If you see an engine-unsupported error, upgrade Node.js or use a version manager such as `nvm`.
|
|
101
|
+
|
|
102
|
+
## Common Follow-Up Commands
|
|
103
|
+
|
|
104
|
+
- `mycodemap query` to search symbols and modules
|
|
105
|
+
- `mycodemap deps` to inspect dependencies
|
|
106
|
+
- `mycodemap impact -f <file>` to estimate change impact
|
|
107
|
+
- `mycodemap benchmark` to compare native and WASM startup paths
|
|
108
|
+
- `mycodemap --schema` to inspect the CLI contract
|
|
109
|
+
|
|
110
|
+
## Next Steps
|
|
111
|
+
|
|
112
|
+
- See [DEVELOPMENT.md](DEVELOPMENT.md) for local development setup, build commands, and contribution workflow.
|
|
113
|
+
- See [TESTING.md](TESTING.md) for how to run the test suite and write new tests.
|
|
114
|
+
- See [CONFIGURATION.md](CONFIGURATION.md) for the full config file format, environment variables, and per-environment overrides.
|
package/docs/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# docs/ - 文档信息架构
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **v2.0 里程碑上下文**:当前文档体系对应 CodeMap v2.0(”agent-native-foundation”)。v2.0 引入了 CLI-as-MCP 自动网关、接口契约 Schema、WASM-first 构建基础等核心能力。详见下方 [v2.0 文档索引](#v20-文档索引)。
|
|
4
|
+
|
|
5
|
+
本目录采用”入口文档短、细节文档分层”的结构。
|
|
4
6
|
|
|
5
7
|
## 目录职责
|
|
6
8
|
|
|
@@ -11,6 +13,8 @@
|
|
|
11
13
|
- `docs/product-specs/`:当前仍有效的产品规格与验收边界。
|
|
12
14
|
- `docs/references/`:外部参考、设计系统、工具链资料。
|
|
13
15
|
- `docs/archive/`:历史方案、迁移遗留、过期文档索引。
|
|
16
|
+
- `docs/ai-guide/`:AI / Agent 集成指南(v2.0 新增)。
|
|
17
|
+
- `src/cli/interface-contract/`:接口契约 Schema 定义(单一 Schema 生成 parser、MCP tool 定义、`--help-json`、shell 补全)。
|
|
14
18
|
|
|
15
19
|
## 当前状态
|
|
16
20
|
|
|
@@ -19,6 +23,20 @@
|
|
|
19
23
|
- `docs/design-docs/` 与 `docs/product-specs/` 当前不再保留旧稿;历史内容请从 `docs/archive/README.md` 进入。
|
|
20
24
|
- 新增内容优先写入分层目录,不再把新设计或新计划继续堆到根层。
|
|
21
25
|
|
|
26
|
+
### v2.0 功能状态
|
|
27
|
+
|
|
28
|
+
v2.0("agent-native-foundation")已引入以下核心能力,相关文档已就位:
|
|
29
|
+
|
|
30
|
+
| 功能 | 状态 | 文档位置 |
|
|
31
|
+
|------|------|----------|
|
|
32
|
+
| **CLI-as-MCP 自动网关** | 已交付 | `docs/ai-guide/INTEGRATION.md` |
|
|
33
|
+
| `codemap doctor` 持续健康诊断 | 已交付 | `AI_GUIDE.md` + `src/cli/doctor/` |
|
|
34
|
+
| `codemap benchmark` WASM/Native 性能对比 | 已交付 | `AI_GUIDE.md` |
|
|
35
|
+
| `--schema` 接口契约输出 | 已交付 | `AI_GUIDE.md` + `src/cli/interface-contract/` |
|
|
36
|
+
| WASM-first 构建基础 | 已交付 | `AI_GUIDE.md` + `src/cli/loaders/` |
|
|
37
|
+
| AI-First 默认输出(JSON/NDJSON) | 已交付 | `AI_GUIDE.md` |
|
|
38
|
+
| Failure-to-Action 协议 | 已交付 | `docs/rules/harness.md` |
|
|
39
|
+
|
|
22
40
|
## 建议阅读顺序
|
|
23
41
|
|
|
24
42
|
1. `../AGENTS.md`
|
|
@@ -28,6 +46,27 @@
|
|
|
28
46
|
5. 与任务最相关的现行文档;如需历史背景,再看 `docs/archive/README.md`
|
|
29
47
|
6. 如需过程信息,再看 `docs/exec-plans/*`
|
|
30
48
|
|
|
49
|
+
## v2.0 文档索引
|
|
50
|
+
|
|
51
|
+
以下文档涵盖 v2.0 核心功能,按主题分类:
|
|
52
|
+
|
|
53
|
+
### AI / Agent 集成
|
|
54
|
+
- `docs/ai-guide/INTEGRATION.md` — CLI-as-MCP 自动网关配置指南(动态 tool 注册、20+ 命令自动暴露)
|
|
55
|
+
- `docs/ai-guide/AI_ASSISTANT_SETUP.md` — AI 助手(Kimi、Claude、Codex、Cursor、Copilot)集成配置
|
|
56
|
+
- `AI_GUIDE.md` — CodeMap CLI / MCP / AI 使用总览(含 `doctor`、`benchmark`、`--schema` 用法)
|
|
57
|
+
|
|
58
|
+
### 接口契约与 Schema
|
|
59
|
+
- `src/cli/interface-contract/` — 单一 Schema 源文件(生成 parser、MCP tool 定义、`--help-json`、shell 补全)
|
|
60
|
+
- 运行 `codemap --schema` 可输出完整契约 JSON,供 Agent 自省
|
|
61
|
+
|
|
62
|
+
### Harness 与 Agent 控制
|
|
63
|
+
- `docs/rules/harness.md` — Harness 设计、Agent 控制、上下文分层、权限升级策略
|
|
64
|
+
- `docs/rules/harness.md` — Failure-to-Action 协议(每个错误返回 `rootCause` + `remediationPlan` + `confidence` + `nextCommand`)
|
|
65
|
+
|
|
66
|
+
### 架构与构建
|
|
67
|
+
- `ARCHITECTURE.md` — 架构分层、依赖方向、模块边界
|
|
68
|
+
- `src/cli/loaders/` — WASM-first 构建基础(`tree-sitter` → `web-tree-sitter`;`better-sqlite3` → `node:sqlite` / `sql.js`)
|
|
69
|
+
|
|
31
70
|
## 维护规则
|
|
32
71
|
|
|
33
72
|
- 入口文档只做导航,不复述大段细节。
|
package/docs/SETUP_GUIDE.md
CHANGED
|
@@ -96,6 +96,55 @@ mycodemap init -y
|
|
|
96
96
|
|
|
97
97
|
`init` 会同步 `.mycodemap/hooks/` 与 `.mycodemap/rules/`,但不会自动改写 `CLAUDE.md` / `AGENTS.md`;相关引用片段会通过 receipt 提示你手动加入。
|
|
98
98
|
|
|
99
|
+
#### 理解 Init 收据
|
|
100
|
+
|
|
101
|
+
`mycodemap init` 完成后会输出一份收据,分为两个部分:
|
|
102
|
+
|
|
103
|
+
**Main Agent(主 Agent 上下文)**
|
|
104
|
+
- 报告已生成的上下文文件路径(如 `claude-context.md`、`agents-context.md`)
|
|
105
|
+
- 指导你将相关内容手动合并到项目根目录的 `CLAUDE.md` / `AGENTS.md`
|
|
106
|
+
- 检测已同步状态:如果 `CLAUDE.md` 已包含 `.mycodemap/` 引用,标记为 `already-synced`
|
|
107
|
+
|
|
108
|
+
**Subagent(子 Agent 配置)**
|
|
109
|
+
- 报告平台配置示例文件(如 `claude-hook-example.json`、`codex-agent-example.toml`)
|
|
110
|
+
- 指导你将配置复制到对应平台设置目录
|
|
111
|
+
|
|
112
|
+
收据还会显示**个性化下一步**,基于实际安装的资产生成,而非固定的三步欢迎信息。
|
|
113
|
+
|
|
114
|
+
> 注意:`init` 不会自动改写 `CLAUDE.md`、`AGENTS.md` 等团队共管文件。所有需要手动操作的步骤都会在收据中明确标注。
|
|
115
|
+
|
|
116
|
+
#### 环境契约(Environment Contract)
|
|
117
|
+
|
|
118
|
+
`mycodemap init` 还会生成 `.mycodemap/env-contract.json`,这是一个结构化的项目规则索引,包含:
|
|
119
|
+
|
|
120
|
+
- **执行规则**:shell 命令包装(rtk)、测试入口命令(vitest run)
|
|
121
|
+
- **提交规则**:commit message 格式(`[TAG] scope: message`)、有效标签列表
|
|
122
|
+
- **验证规则**:真实场景验证要求、代码质量标准
|
|
123
|
+
- **来源追踪**:每条规则的源文件和 hash,用于漂移检测
|
|
124
|
+
|
|
125
|
+
子代理(Claude Code / Codex CLI 的委托代理)通过以下方式检索契约:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# CLI 检索(按代理类型过滤)
|
|
129
|
+
mycodemap env-contract --for worker --json
|
|
130
|
+
mycodemap env-contract --for explore --json
|
|
131
|
+
|
|
132
|
+
# MCP 检索
|
|
133
|
+
codemap_env_contract(agentType="worker")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
检查契约一致性和源文件漂移:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# 检查契约是否过期或缺失关键项
|
|
140
|
+
mycodemap env-contract --check
|
|
141
|
+
|
|
142
|
+
# 全面健康诊断(包含 env-contract 状态)
|
|
143
|
+
mycodemap doctor
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> 冲突(如 hook 要求大写标签但文档示例写小写)会被报告为警告,不会阻断。源文件漂移会导致 `--check` 返回非零退出码,需要运行 `mycodemap env-contract --update` 重新生成。
|
|
147
|
+
|
|
99
148
|
生成的 canonical 配置文件 `.mycodemap/config.json`:
|
|
100
149
|
|
|
101
150
|
```json
|
|
@@ -210,24 +259,21 @@ mycodemap impact -f src/cli/index.ts --transitive
|
|
|
210
259
|
### 统一分析(analyze)
|
|
211
260
|
|
|
212
261
|
```bash
|
|
213
|
-
#
|
|
214
|
-
mycodemap analyze -i
|
|
215
|
-
mycodemap analyze -i impact -t src/cli/index.ts --scope transitive --include-tests
|
|
262
|
+
# 搜索符号或文件
|
|
263
|
+
mycodemap analyze -i find -k "UnifiedResult" --topK 10
|
|
216
264
|
|
|
217
|
-
#
|
|
218
|
-
mycodemap analyze -i
|
|
265
|
+
# 读取代码范围
|
|
266
|
+
mycodemap analyze -i read -t src/cli/index.ts
|
|
267
|
+
mycodemap analyze -i read -t src/cli/index.ts --scope transitive --include-tests
|
|
219
268
|
|
|
220
|
-
#
|
|
221
|
-
mycodemap analyze -i
|
|
269
|
+
# 查看模块依赖关系
|
|
270
|
+
mycodemap analyze -i link -t src/orchestrator
|
|
222
271
|
|
|
223
|
-
#
|
|
224
|
-
mycodemap analyze -i
|
|
272
|
+
# 展示项目概览或复杂度
|
|
273
|
+
mycodemap analyze -i show -t src/
|
|
225
274
|
|
|
226
|
-
#
|
|
227
|
-
mycodemap analyze -i
|
|
228
|
-
|
|
229
|
-
# JSON 输出
|
|
230
|
-
mycodemap analyze -i impact -t src/index.ts --json
|
|
275
|
+
# JSON 结构化输出
|
|
276
|
+
mycodemap analyze -i find -k "UnifiedResult" --json --structured
|
|
231
277
|
```
|
|
232
278
|
|
|
233
279
|
### 工作流编排(workflow)
|