@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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// [META] since:2026-05-01 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] 把 bootstrap profile 应用建模为 InitAsset,复用 reconciler 的 preview/apply 流程
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { createDefaultCodemapConfigFile } from '../config-loader.js';
|
|
7
|
+
const ASSET_KEY = 'bootstrap-profile';
|
|
8
|
+
const ASSET_LABEL = 'bootstrap profile';
|
|
9
|
+
const ASSET_ORIGIN = 'project-detection';
|
|
10
|
+
function fileHash(text) {
|
|
11
|
+
return createHash('sha256').update(text).digest('hex').slice(0, 12);
|
|
12
|
+
}
|
|
13
|
+
function mapAnalysisDepth(depth) {
|
|
14
|
+
switch (depth) {
|
|
15
|
+
case 'shallow':
|
|
16
|
+
return 'fast';
|
|
17
|
+
case 'standard':
|
|
18
|
+
return 'hybrid';
|
|
19
|
+
case 'deep':
|
|
20
|
+
return 'smart';
|
|
21
|
+
default:
|
|
22
|
+
return 'hybrid';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function buildMergedConfigText(profile) {
|
|
26
|
+
const defaults = createDefaultCodemapConfigFile();
|
|
27
|
+
const merged = {
|
|
28
|
+
...defaults,
|
|
29
|
+
mode: mapAnalysisDepth(profile.analysis_depth),
|
|
30
|
+
include: [...profile.parser.include],
|
|
31
|
+
exclude: [...defaults.exclude, ...profile.ignore],
|
|
32
|
+
};
|
|
33
|
+
return JSON.stringify(merged, null, 2);
|
|
34
|
+
}
|
|
35
|
+
function buildAsset(status, details, options = {}) {
|
|
36
|
+
return {
|
|
37
|
+
key: ASSET_KEY,
|
|
38
|
+
label: ASSET_LABEL,
|
|
39
|
+
status,
|
|
40
|
+
ownership: 'tool-owned',
|
|
41
|
+
origin: ASSET_ORIGIN,
|
|
42
|
+
path: options.path,
|
|
43
|
+
details,
|
|
44
|
+
hash: options.hash,
|
|
45
|
+
rollbackHint: options.rollbackHint,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Build a ProfilePlan describing the bootstrap profile decision.
|
|
50
|
+
*
|
|
51
|
+
* - profile === null → skipped (no marker detected, or detection bypassed)
|
|
52
|
+
* - scan.hasCanonicalConfig → already-synced (D-16: respect existing config)
|
|
53
|
+
* - mode === 'preview' → skipped with merged-config preview text
|
|
54
|
+
* - mode === 'apply' → installed; queues canonical config write
|
|
55
|
+
*/
|
|
56
|
+
export function createProfilePlan(_rootDir, profile, scan, mode, profileName) {
|
|
57
|
+
if (scan.hasCanonicalConfig) {
|
|
58
|
+
return {
|
|
59
|
+
assets: [
|
|
60
|
+
buildAsset('already-synced', [
|
|
61
|
+
'检测到已存在的 .mycodemap/config.json;跳过 profile 应用。如需重新检测,请使用 --re-detect',
|
|
62
|
+
], { path: scan.paths.canonicalConfigPath }),
|
|
63
|
+
],
|
|
64
|
+
writes: [],
|
|
65
|
+
profileName,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (profile === null) {
|
|
69
|
+
return {
|
|
70
|
+
assets: [
|
|
71
|
+
buildAsset('skipped', [
|
|
72
|
+
'未检测到项目类型标记;跳过 bootstrap profile 推荐',
|
|
73
|
+
]),
|
|
74
|
+
],
|
|
75
|
+
writes: [],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const mergedConfigText = buildMergedConfigText(profile);
|
|
79
|
+
const displayName = profileName ?? 'profile';
|
|
80
|
+
if (mode === 'preview') {
|
|
81
|
+
return {
|
|
82
|
+
assets: [
|
|
83
|
+
buildAsset('skipped', [
|
|
84
|
+
`推荐 profile: ${displayName}`,
|
|
85
|
+
'预览模式不会写入配置;使用 --yes 应用',
|
|
86
|
+
]),
|
|
87
|
+
],
|
|
88
|
+
writes: [],
|
|
89
|
+
mergedConfigText,
|
|
90
|
+
profileName,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
assets: [
|
|
95
|
+
buildAsset('installed', [
|
|
96
|
+
`应用 profile: ${displayName}`,
|
|
97
|
+
'已将推荐配置合并到 .mycodemap/config.json',
|
|
98
|
+
], {
|
|
99
|
+
path: scan.paths.canonicalConfigPath,
|
|
100
|
+
hash: fileHash(mergedConfigText),
|
|
101
|
+
rollbackHint: '如需回退本次 profile 应用,可删除 `.mycodemap/config.json`',
|
|
102
|
+
}),
|
|
103
|
+
],
|
|
104
|
+
writes: [
|
|
105
|
+
{
|
|
106
|
+
targetPath: scan.paths.canonicalConfigPath,
|
|
107
|
+
content: mergedConfigText,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
mergedConfigText,
|
|
111
|
+
profileName,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export async function applyProfilePlan(plan) {
|
|
115
|
+
for (const write of plan.writes) {
|
|
116
|
+
await mkdir(path.dirname(write.targetPath), { recursive: true });
|
|
117
|
+
await writeFile(write.targetPath, write.content, 'utf8');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=profile-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-plan.js","sourceRoot":"","sources":["../../../src/cli/init/profile-plan.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,6EAA6E;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AA+BrE,MAAM,SAAS,GAAG,mBAAmB,CAAC;AACtC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AACxC,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,gBAAgB,CACvB,KAAyC;IAEzC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,QAAQ,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAS,q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**/*.{ts,js,py,go,rs}"],
|
|
4
|
+
"extensions": ["ts", "js", "py", "go", "rs"]
|
|
5
|
+
},
|
|
6
|
+
"ignore": [
|
|
7
|
+
"node_modules/**",
|
|
8
|
+
"dist/**",
|
|
9
|
+
"build/**",
|
|
10
|
+
"coverage/**",
|
|
11
|
+
"target/**",
|
|
12
|
+
".venv/**",
|
|
13
|
+
"venv/**"
|
|
14
|
+
],
|
|
15
|
+
"analysis_depth": "shallow"
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": {
|
|
3
|
+
"include": ["src/**/*.{ts,tsx,js,jsx,mjs,cjs}"],
|
|
4
|
+
"extensions": ["ts", "tsx", "js", "jsx", "mjs", "cjs"]
|
|
5
|
+
},
|
|
6
|
+
"ignore": [
|
|
7
|
+
"node_modules/**",
|
|
8
|
+
"dist/**",
|
|
9
|
+
"build/**",
|
|
10
|
+
"coverage/**",
|
|
11
|
+
"**/*.test.{ts,tsx,js,jsx}",
|
|
12
|
+
"**/*.spec.{ts,tsx,js,jsx}",
|
|
13
|
+
"**/*.d.ts"
|
|
14
|
+
],
|
|
15
|
+
"analysis_depth": "standard"
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": {
|
|
3
|
+
"include": ["src/**/*.py", "**/*.py"],
|
|
4
|
+
"extensions": ["py"]
|
|
5
|
+
},
|
|
6
|
+
"ignore": [
|
|
7
|
+
"__pycache__/**",
|
|
8
|
+
".venv/**",
|
|
9
|
+
"venv/**",
|
|
10
|
+
"*.egg-info/**",
|
|
11
|
+
"dist/**",
|
|
12
|
+
"build/**",
|
|
13
|
+
"**/*_test.py",
|
|
14
|
+
"**/test_*.py"
|
|
15
|
+
],
|
|
16
|
+
"analysis_depth": "standard"
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../../src/cli/init/receipt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../../src/cli/init/receipt.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAkK9D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CA0C5D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CA6C5D"}
|
package/dist/cli/init/receipt.js
CHANGED
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
// [META] since:2026-04-21 | owner:cli-team | stable:false
|
|
2
2
|
// [WHY] 统一 init 预览与执行后 receipt 的终端呈现,确保状态解释一致
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
4
|
import chalk from 'chalk';
|
|
4
5
|
import path from 'node:path';
|
|
6
|
+
function detectTeamFileSync(rootDir, fileName) {
|
|
7
|
+
const filePath = path.join(rootDir, fileName);
|
|
8
|
+
if (!existsSync(filePath))
|
|
9
|
+
return 'manual-action-needed';
|
|
10
|
+
const content = readFileSync(filePath, 'utf8');
|
|
11
|
+
return /\.mycodemap\//i.test(content) ? 'already-synced' : 'manual-action-needed';
|
|
12
|
+
}
|
|
13
|
+
function getTeamFileStatuses(rootDir) {
|
|
14
|
+
const files = ['CLAUDE.md', 'AGENTS.md'];
|
|
15
|
+
return files.map((fileName) => {
|
|
16
|
+
const status = detectTeamFileSync(rootDir, fileName);
|
|
17
|
+
const snippet = status === 'manual-action-needed'
|
|
18
|
+
? `将 .mycodemap/assistants/${fileName === 'CLAUDE.md' ? 'claude-context' : 'agents-context'}.md 中的内容复制到项目根目录的 ${fileName}`
|
|
19
|
+
: undefined;
|
|
20
|
+
return { fileName, status, snippet };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function classifyAsset(asset) {
|
|
24
|
+
if (asset.origin === 'assistant-bootstrap') {
|
|
25
|
+
if (/context/i.test(asset.label))
|
|
26
|
+
return 'main-agent';
|
|
27
|
+
if (/hook|agent-example/i.test(asset.label))
|
|
28
|
+
return 'subagent';
|
|
29
|
+
}
|
|
30
|
+
if (asset.origin === 'rules')
|
|
31
|
+
return 'main-agent';
|
|
32
|
+
return 'infrastructure';
|
|
33
|
+
}
|
|
34
|
+
function mainAgentAssets(receipt) {
|
|
35
|
+
return receipt.assets.filter((a) => classifyAsset(a) === 'main-agent');
|
|
36
|
+
}
|
|
37
|
+
function subagentAssets(receipt) {
|
|
38
|
+
return receipt.assets.filter((a) => classifyAsset(a) === 'subagent');
|
|
39
|
+
}
|
|
40
|
+
function infrastructureAssets(receipt) {
|
|
41
|
+
return receipt.assets.filter((a) => classifyAsset(a) === 'infrastructure');
|
|
42
|
+
}
|
|
5
43
|
function relativePath(rootDir, targetPath) {
|
|
6
44
|
if (!targetPath) {
|
|
7
45
|
return undefined;
|
|
@@ -98,19 +136,81 @@ function skippedAssets(receipt) {
|
|
|
98
136
|
export function renderInitPreview(receipt) {
|
|
99
137
|
console.log(chalk.blue('🔎 CodeMap init 预览(未写入)'));
|
|
100
138
|
console.log(chalk.gray('当前 CLI 尚未内置交互选择器;请确认以下收敛计划后使用 `mycodemap init --yes` 应用默认动作。'));
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
139
|
+
const mainAgent = mainAgentAssets(receipt);
|
|
140
|
+
if (mainAgent.length > 0) {
|
|
141
|
+
console.log('');
|
|
142
|
+
console.log(chalk.white('Main Agent(主 Agent 上下文)'));
|
|
143
|
+
for (const asset of mainAgent) {
|
|
144
|
+
renderAsset(receipt, asset);
|
|
145
|
+
}
|
|
146
|
+
const teamStatuses = getTeamFileStatuses(receipt.rootDir);
|
|
147
|
+
for (const ts of teamStatuses) {
|
|
148
|
+
const icon = ts.status === 'already-synced' ? '✅' : '⚠️';
|
|
149
|
+
const label = ts.status === 'already-synced' ? 'already-synced' : 'manual action';
|
|
150
|
+
console.log(`${icon} ${ts.fileName} [${label}]`);
|
|
151
|
+
if (ts.snippet) {
|
|
152
|
+
console.log(chalk.gray(` - ${ts.snippet}`));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const subagent = subagentAssets(receipt);
|
|
157
|
+
if (subagent.length > 0) {
|
|
158
|
+
console.log('');
|
|
159
|
+
console.log(chalk.white('Subagent(子 Agent 配置)'));
|
|
160
|
+
for (const asset of subagent) {
|
|
161
|
+
renderAsset(receipt, asset);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const infra = infrastructureAssets(receipt);
|
|
165
|
+
if (infra.length > 0) {
|
|
166
|
+
console.log('');
|
|
167
|
+
console.log(chalk.white('基础设施'));
|
|
168
|
+
for (const asset of infra) {
|
|
169
|
+
renderAsset(receipt, asset);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
104
172
|
renderNotes(receipt);
|
|
105
173
|
renderNextSteps(receipt);
|
|
106
174
|
}
|
|
107
175
|
export function renderInitReceipt(receipt) {
|
|
108
176
|
console.log(chalk.blue('🧭 CodeMap init 收敛结果'));
|
|
109
177
|
console.log(chalk.gray(`状态台账: ${relativePath(receipt.rootDir, receipt.receiptPath)}`));
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
178
|
+
// Main Agent section
|
|
179
|
+
const mainAgent = mainAgentAssets(receipt);
|
|
180
|
+
if (mainAgent.length > 0) {
|
|
181
|
+
console.log('');
|
|
182
|
+
console.log(chalk.white('Main Agent(主 Agent 上下文)'));
|
|
183
|
+
for (const asset of mainAgent) {
|
|
184
|
+
renderAsset(receipt, asset);
|
|
185
|
+
}
|
|
186
|
+
const teamStatuses = getTeamFileStatuses(receipt.rootDir);
|
|
187
|
+
for (const ts of teamStatuses) {
|
|
188
|
+
const icon = ts.status === 'already-synced' ? '✅' : '⚠️';
|
|
189
|
+
const label = ts.status === 'already-synced' ? 'already-synced' : 'manual action';
|
|
190
|
+
console.log(`${icon} ${ts.fileName} [${label}]`);
|
|
191
|
+
if (ts.snippet) {
|
|
192
|
+
console.log(chalk.gray(` - ${ts.snippet}`));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Subagent section
|
|
197
|
+
const subagent = subagentAssets(receipt);
|
|
198
|
+
if (subagent.length > 0) {
|
|
199
|
+
console.log('');
|
|
200
|
+
console.log(chalk.white('Subagent(子 Agent 配置)'));
|
|
201
|
+
for (const asset of subagent) {
|
|
202
|
+
renderAsset(receipt, asset);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Infrastructure (collapsed)
|
|
206
|
+
const infra = infrastructureAssets(receipt);
|
|
207
|
+
if (infra.length > 0) {
|
|
208
|
+
console.log('');
|
|
209
|
+
console.log(chalk.white('基础设施'));
|
|
210
|
+
for (const asset of infra) {
|
|
211
|
+
renderAsset(receipt, asset);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
114
214
|
renderNotes(receipt);
|
|
115
215
|
renderNextSteps(receipt);
|
|
116
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../../src/cli/init/receipt.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,8CAA8C;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../../src/cli/init/receipt.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,8CAA8C;AAE9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAK7B,SAAS,kBAAkB,CAAC,OAAe,EAAE,QAAgB;IAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,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AM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;QACjD,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;YAC1B,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,WAAW,CAAC,OAAO,CAAC,CAAC;IACrB,eAAe,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { type AssistantPlan } from './assistant-plan.js';
|
|
2
|
+
import { type EnvContractPlan } from './env-contract-plan.js';
|
|
1
3
|
import { type HookPlan } from './hooks.js';
|
|
4
|
+
import { type ProfilePlan } from './profile-plan.js';
|
|
5
|
+
import type { BootstrapProfile } from './profile-loader.js';
|
|
2
6
|
import { type RulesPlan } from './rules.js';
|
|
3
7
|
export type InitAssetStatus = 'missing' | 'already-synced' | 'migrated' | 'installed' | 'conflict' | 'manual-action-needed' | 'skipped';
|
|
4
8
|
export type InitAssetOwnership = 'tool-owned' | 'team-owned' | 'user-owned';
|
|
@@ -22,6 +26,7 @@ export interface InitReceipt {
|
|
|
22
26
|
rootDir: string;
|
|
23
27
|
receiptPath: string;
|
|
24
28
|
canonicalConfigPath: string;
|
|
29
|
+
profileName?: string;
|
|
25
30
|
assets: InitAsset[];
|
|
26
31
|
summary: Record<InitAssetStatus, number>;
|
|
27
32
|
notes: string[];
|
|
@@ -33,12 +38,16 @@ export interface InitPlan {
|
|
|
33
38
|
ensureWorkspace: boolean;
|
|
34
39
|
writeCanonicalConfig: boolean;
|
|
35
40
|
canonicalConfigText?: string;
|
|
41
|
+
assistantPlan: AssistantPlan;
|
|
42
|
+
envContractPlan: EnvContractPlan;
|
|
36
43
|
hookPlan: HookPlan;
|
|
37
44
|
rulesPlan: RulesPlan;
|
|
45
|
+
profilePlan: ProfilePlan;
|
|
38
46
|
};
|
|
39
47
|
}
|
|
40
|
-
export declare function createInitPlan(rootDir: string, mode: 'preview' | 'apply'): InitPlan;
|
|
48
|
+
export declare function createInitPlan(rootDir: string, mode: 'preview' | 'apply', profile?: BootstrapProfile | null, profileName?: string): InitPlan;
|
|
41
49
|
export declare function applyInitPlan(plan: InitPlan): Promise<InitReceipt>;
|
|
42
50
|
export declare function writeInitReceipt(receipt: InitReceipt): Promise<void>;
|
|
43
51
|
export declare function readReceiptConfigPath(receiptPath: string): string | undefined;
|
|
52
|
+
export declare function readReceiptProfileName(receiptPath: string): string | undefined;
|
|
44
53
|
//# sourceMappingURL=reconciler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconciler.d.ts","sourceRoot":"","sources":["../../../src/cli/init/reconciler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAS7E,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,WAAW,GACX,UAAU,GACV,sBAAsB,GACtB,SAAS,CAAC;AAEd,MA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C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE;QACP,eAAe,EAAE,OAAO,CAAC;QACzB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,aAAa,EAAE,aAAa,CAAC;QAC7B,eAAe,EAAE,eAAe,CAAC;QACjC,QAAQ,EAAE,QAAQ,CAAC;QACnB,SAAS,EAAE,SAAS,CAAC;QACrB,WAAW,EAAE,WAAW,CAAC;KAC1B,CAAC;CACH;AAoeD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,GAAG,OAAO,EACzB,OAAO,GAAE,gBAAgB,GAAG,IAAW,EACvC,WAAW,CAAC,EAAE,MAAM,GACnB,QAAQ,CAwDV;AAqBD,wBAAsB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAUxE;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI7E;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4C9E"}
|
|
@@ -5,7 +5,10 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
5
5
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { createDefaultCodemapConfigFile } from '../config-loader.js';
|
|
8
|
+
import { applyAssistantPlan, createAssistantPlan } from './assistant-plan.js';
|
|
9
|
+
import { applyEnvContractPlan, createEnvContractPlan } from './env-contract-plan.js';
|
|
8
10
|
import { applyHookPlan, createHookPlan } from './hooks.js';
|
|
11
|
+
import { applyProfilePlan, createProfilePlan } from './profile-plan.js';
|
|
9
12
|
import { applyRulesPlan, createRulesPlan } from './rules.js';
|
|
10
13
|
import { CONFIG_FILE_CANONICAL, CONFIG_FILE_NEW, CONFIG_FILE_OLD, DEFAULT_OUTPUT_DIR_NEW, DEFAULT_OUTPUT_DIR_OLD, } from '../paths.js';
|
|
11
14
|
const RECEIPT_VERSION_HINT = 'init-receipt-v1';
|
|
@@ -282,34 +285,57 @@ function buildReceiptNotes(scan) {
|
|
|
282
285
|
return notes;
|
|
283
286
|
}
|
|
284
287
|
function buildNextSteps(assets) {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
const steps = [];
|
|
289
|
+
// Priority 1: Conflict steps (highest)
|
|
290
|
+
const conflictAssets = assets.filter((a) => a.status === 'conflict' && a.manualAction);
|
|
291
|
+
for (const asset of conflictAssets) {
|
|
292
|
+
steps.push(asset.manualAction);
|
|
290
293
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
return conflictSteps;
|
|
294
|
+
// Priority 2: Manual action steps
|
|
295
|
+
const manualAssets = assets.filter((a) => a.status === 'manual-action-needed' && a.manualAction);
|
|
296
|
+
for (const asset of manualAssets) {
|
|
297
|
+
steps.push(asset.manualAction);
|
|
296
298
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
299
|
+
// Priority 3: Installed assistant asset usage guidance
|
|
300
|
+
const installedAssistants = assets.filter((a) => a.origin === 'assistant-bootstrap' && a.status === 'installed');
|
|
301
|
+
for (const asset of installedAssistants) {
|
|
302
|
+
if (/context/i.test(asset.label)) {
|
|
303
|
+
const target = /claude/i.test(asset.label) ? 'CLAUDE.md' : 'AGENTS.md';
|
|
304
|
+
steps.push(`审阅 .mycodemap/assistants/${asset.label} 并将相关部分复制到项目根目录的 ${target}`);
|
|
305
|
+
}
|
|
306
|
+
else if (/hook/i.test(asset.label)) {
|
|
307
|
+
steps.push(`将 .mycodemap/assistants/${asset.label} 中的配置复制到 .claude/settings.json`);
|
|
308
|
+
}
|
|
309
|
+
else if (/agent-example/i.test(asset.label)) {
|
|
310
|
+
steps.push(`将 .mycodemap/assistants/${asset.label} 中的配置复制到 .codex/agents/`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// Priority 4: Default recommended steps (lowest, max 3 total)
|
|
314
|
+
if (steps.length === 0) {
|
|
315
|
+
steps.push('运行 `mycodemap doctor` 验证项目健康状态');
|
|
316
|
+
steps.push('运行 `mycodemap generate` 生成代码地图');
|
|
317
|
+
}
|
|
318
|
+
// Cap at 3 to avoid information overload (D-08)
|
|
319
|
+
return steps.slice(0, 3);
|
|
301
320
|
}
|
|
302
|
-
export function createInitPlan(rootDir, mode) {
|
|
321
|
+
export function createInitPlan(rootDir, mode, profile = null, profileName) {
|
|
303
322
|
const scan = scanInitState(rootDir);
|
|
323
|
+
const assistantPlan = createAssistantPlan(rootDir, undefined, profileName);
|
|
324
|
+
const envContractPlan = createEnvContractPlan(rootDir, profileName, mode);
|
|
304
325
|
const hookPlan = createHookPlan(rootDir);
|
|
305
326
|
const rulesPlan = createRulesPlan(rootDir);
|
|
327
|
+
const profilePlan = createProfilePlan(rootDir, profile, scan, mode, profileName);
|
|
328
|
+
const receiptProfileName = profilePlan.profileName ?? profileName;
|
|
306
329
|
const assets = [
|
|
307
330
|
buildWorkspaceAsset(scan),
|
|
308
331
|
buildConfigAsset(scan),
|
|
309
332
|
...buildLegacyRootConfigAssets(scan),
|
|
310
333
|
buildStatusLedgerAsset(scan, mode),
|
|
334
|
+
...envContractPlan.assets,
|
|
335
|
+
...assistantPlan.assets,
|
|
311
336
|
...hookPlan.assets,
|
|
312
337
|
...rulesPlan.assets,
|
|
338
|
+
...profilePlan.assets,
|
|
313
339
|
buildFirstRunAsset(scan),
|
|
314
340
|
];
|
|
315
341
|
const legacyOutputAsset = buildLegacyOutputAsset(scan);
|
|
@@ -328,6 +354,7 @@ export function createInitPlan(rootDir, mode) {
|
|
|
328
354
|
rootDir,
|
|
329
355
|
receiptPath: scan.paths.receiptPath,
|
|
330
356
|
canonicalConfigPath: scan.paths.canonicalConfigPath,
|
|
357
|
+
profileName: receiptProfileName,
|
|
331
358
|
assets,
|
|
332
359
|
summary: summarizeAssets(assets),
|
|
333
360
|
notes: buildReceiptNotes(scan),
|
|
@@ -337,8 +364,11 @@ export function createInitPlan(rootDir, mode) {
|
|
|
337
364
|
ensureWorkspace: scan.workspaceMissingDirs.length > 0,
|
|
338
365
|
writeCanonicalConfig: !scan.hasCanonicalConfig,
|
|
339
366
|
canonicalConfigText: !scan.hasCanonicalConfig ? buildCanonicalConfigText(scan) : undefined,
|
|
367
|
+
assistantPlan,
|
|
368
|
+
envContractPlan,
|
|
340
369
|
hookPlan,
|
|
341
370
|
rulesPlan,
|
|
371
|
+
profilePlan,
|
|
342
372
|
},
|
|
343
373
|
};
|
|
344
374
|
}
|
|
@@ -361,8 +391,11 @@ export async function applyInitPlan(plan) {
|
|
|
361
391
|
const paths = receiptPaths(plan.receipt);
|
|
362
392
|
await ensureWorkspaceDirectories(paths);
|
|
363
393
|
await maybeWriteCanonicalConfig(paths, plan);
|
|
394
|
+
await applyEnvContractPlan(plan.actions.envContractPlan);
|
|
395
|
+
await applyAssistantPlan(plan.actions.assistantPlan);
|
|
364
396
|
await applyHookPlan(plan.actions.hookPlan);
|
|
365
397
|
await applyRulesPlan(plan.actions.rulesPlan);
|
|
398
|
+
await applyProfilePlan(plan.actions.profilePlan);
|
|
366
399
|
return plan.receipt;
|
|
367
400
|
}
|
|
368
401
|
export async function writeInitReceipt(receipt) {
|
|
@@ -374,4 +407,41 @@ export function readReceiptConfigPath(receiptPath) {
|
|
|
374
407
|
const value = parsed?.canonicalConfigPath;
|
|
375
408
|
return typeof value === 'string' ? value : undefined;
|
|
376
409
|
}
|
|
410
|
+
export function readReceiptProfileName(receiptPath) {
|
|
411
|
+
const parsed = safeReadJson(receiptPath);
|
|
412
|
+
if (!parsed) {
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
const directProfileName = parsed.profileName;
|
|
416
|
+
if (typeof directProfileName === 'string' && directProfileName.trim().length > 0) {
|
|
417
|
+
return directProfileName;
|
|
418
|
+
}
|
|
419
|
+
const assets = parsed.assets;
|
|
420
|
+
if (!Array.isArray(assets)) {
|
|
421
|
+
return undefined;
|
|
422
|
+
}
|
|
423
|
+
for (const asset of assets) {
|
|
424
|
+
if (!asset || typeof asset !== 'object') {
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
const record = asset;
|
|
428
|
+
if (record.key !== 'bootstrap-profile' && record.label !== 'bootstrap profile') {
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
const details = record.details;
|
|
432
|
+
if (!Array.isArray(details)) {
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
for (const detail of details) {
|
|
436
|
+
if (typeof detail !== 'string') {
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
const match = detail.match(/^(?:应用 profile|推荐 profile|Profile):\s*(.+)$/);
|
|
440
|
+
if (match) {
|
|
441
|
+
return match[1].trim();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return undefined;
|
|
446
|
+
}
|
|
377
447
|
//# sourceMappingURL=reconciler.js.map
|