@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mycodemap/mycodemap",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "TypeScript 代码地图工具 - 为 AI 辅助开发提供结构化上下文",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
"examples/",
|
|
23
23
|
"scripts/",
|
|
24
24
|
"README.md",
|
|
25
|
+
"README.zh-CN.md",
|
|
25
26
|
"LICENSE",
|
|
26
27
|
"CHANGELOG.md",
|
|
27
28
|
"mycodemap.config.schema.json"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsc",
|
|
32
|
+
"postbuild": "node scripts/copy-build-assets.mjs",
|
|
31
33
|
"dev": "tsc --watch",
|
|
32
34
|
"docs:check": "node scripts/validate-docs.js && node scripts/validate-ai-docs.js",
|
|
33
35
|
"docs:check:human": "node scripts/validate-docs.js",
|
|
@@ -43,9 +45,7 @@
|
|
|
43
45
|
"validate-pack": "node scripts/validate-pack.js",
|
|
44
46
|
"release": "./scripts/release.sh",
|
|
45
47
|
"check:all": "npm run typecheck && npm run lint && npm test && npm run docs:check",
|
|
46
|
-
"check:architecture": "echo 'dependency-cruiser not installed, run: npm i -D dependency-cruiser'",
|
|
47
48
|
"check:security": "npm audit",
|
|
48
|
-
"check:unused": "echo 'knip not installed, run: npm i -D knip'",
|
|
49
49
|
"fix:all": "npm run lint -- --fix",
|
|
50
50
|
"ai:pre-task": "npm run check:all",
|
|
51
51
|
"ai:post-task": "npm run fix:all && npm run check:all"
|
|
@@ -68,9 +68,13 @@
|
|
|
68
68
|
"commander": "^11.1.0",
|
|
69
69
|
"dependency-cruiser": "^17.3.10",
|
|
70
70
|
"globby": "^14.0.0",
|
|
71
|
+
"graphology": "^0.26.0",
|
|
72
|
+
"graphology-communities-louvain": "^2.0.2",
|
|
71
73
|
"hono": "^4.12.8",
|
|
72
74
|
"ora": "^8.0.1",
|
|
75
|
+
"smol-toml": "^1.6.1",
|
|
73
76
|
"tree-sitter": "^0.21.1",
|
|
77
|
+
"tree-sitter-python": "0.23.4",
|
|
74
78
|
"tree-sitter-typescript": "^0.23.2",
|
|
75
79
|
"typescript": "^5.3.3",
|
|
76
80
|
"typhonjs-escomplex": "^0.1.0",
|
|
@@ -85,8 +89,12 @@
|
|
|
85
89
|
"eslint": "^8.57.1",
|
|
86
90
|
"vitest": "^1.1.0"
|
|
87
91
|
},
|
|
92
|
+
"optionalDependencies": {
|
|
93
|
+
"sql.js": "^1.12.0",
|
|
94
|
+
"web-tree-sitter": "^0.24.0"
|
|
95
|
+
},
|
|
88
96
|
"engines": {
|
|
89
|
-
"node": ">=
|
|
97
|
+
"node": ">=20.0.0"
|
|
90
98
|
},
|
|
91
99
|
"publishConfig": {
|
|
92
100
|
"access": "public",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Post-tsc copy step: ship non-TS assets that `tsc` does not emit into `dist/`.
|
|
2
|
+
// Phase 53: built-in bootstrap profile JSONs live next to the profile-loader
|
|
3
|
+
// and must be present at runtime in published packages (`files` ships `dist/`,
|
|
4
|
+
// not `src/`).
|
|
5
|
+
|
|
6
|
+
import { cpSync, mkdirSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
|
|
10
|
+
const repoRoot = fileURLToPath(new URL('..', import.meta.url));
|
|
11
|
+
|
|
12
|
+
const copies = [
|
|
13
|
+
{
|
|
14
|
+
from: path.join(repoRoot, 'src', 'cli', 'init', 'profiles'),
|
|
15
|
+
to: path.join(repoRoot, 'dist', 'cli', 'init', 'profiles'),
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
for (const { from, to } of copies) {
|
|
20
|
+
mkdirSync(to, { recursive: true });
|
|
21
|
+
cpSync(from, to, { recursive: true });
|
|
22
|
+
console.log(`[copy-build-assets] ${path.relative(repoRoot, from)} -> ${path.relative(repoRoot, to)}`);
|
|
23
|
+
}
|
|
@@ -40,6 +40,35 @@ echo "Tests passed"
|
|
|
40
40
|
# 2. repo-local 规则校验(按 hard_gate.mode 决定 report-only / enforce)
|
|
41
41
|
RULE_CONFIG_PATH=".claude/rule-system.config.json"
|
|
42
42
|
RULE_HARD_GATE_MODE="report-only"
|
|
43
|
+
RULE_REPORT_ONLY_TIMEOUT_SECONDS="${RULE_REPORT_ONLY_TIMEOUT_SECONDS:-20}"
|
|
44
|
+
|
|
45
|
+
run_rule_validation_report_only() {
|
|
46
|
+
python3 - <<'PY'
|
|
47
|
+
import os
|
|
48
|
+
import subprocess
|
|
49
|
+
import sys
|
|
50
|
+
|
|
51
|
+
timeout_value = os.environ.get("RULE_REPORT_ONLY_TIMEOUT_SECONDS", "20")
|
|
52
|
+
|
|
53
|
+
try:
|
|
54
|
+
timeout_seconds = int(timeout_value)
|
|
55
|
+
except ValueError:
|
|
56
|
+
timeout_seconds = 20
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
completed = subprocess.run(
|
|
60
|
+
["python3", "scripts/validate-rules.py", "code", "--report-only"],
|
|
61
|
+
check=False,
|
|
62
|
+
stdout=subprocess.DEVNULL,
|
|
63
|
+
stderr=subprocess.DEVNULL,
|
|
64
|
+
timeout=timeout_seconds,
|
|
65
|
+
)
|
|
66
|
+
except subprocess.TimeoutExpired:
|
|
67
|
+
sys.exit(124)
|
|
68
|
+
|
|
69
|
+
sys.exit(completed.returncode)
|
|
70
|
+
PY
|
|
71
|
+
}
|
|
43
72
|
|
|
44
73
|
if [ -f "$RULE_CONFIG_PATH" ]; then
|
|
45
74
|
RULE_HARD_GATE_MODE=$(python3 - <<'PY'
|
|
@@ -91,9 +120,11 @@ case "$RULE_HARD_GATE_MODE" in
|
|
|
91
120
|
if [ "$RULE_HARD_GATE_MODE" != "report-only" ]; then
|
|
92
121
|
echo "WARNING: Unknown hard gate mode '$RULE_HARD_GATE_MODE', defaulting to report-only"
|
|
93
122
|
fi
|
|
94
|
-
|
|
123
|
+
run_rule_validation_report_only
|
|
95
124
|
VALIDATE_EXIT=$?
|
|
96
|
-
if [ "$VALIDATE_EXIT" -
|
|
125
|
+
if [ "$VALIDATE_EXIT" -eq 124 ]; then
|
|
126
|
+
echo "WARNING: Rule validation report-only timed out after ${RULE_REPORT_ONLY_TIMEOUT_SECONDS}s, continuing commit"
|
|
127
|
+
elif [ "$VALIDATE_EXIT" -ne 0 ]; then
|
|
97
128
|
echo "WARNING: Rule validation report-only command exited with $VALIDATE_EXIT, continuing commit"
|
|
98
129
|
else
|
|
99
130
|
echo "Rule validation report-only completed"
|
|
@@ -299,12 +299,12 @@ function renderAnalyzeOptionsTable(rootDir) {
|
|
|
299
299
|
|
|
300
300
|
const ANALYZE_DOC_BLOCKS = [
|
|
301
301
|
{
|
|
302
|
-
relativePath: 'README.md',
|
|
302
|
+
relativePath: 'README.zh-CN.md',
|
|
303
303
|
marker: 'analyze-readme-examples',
|
|
304
304
|
render: () => renderReadmeAnalyzeExamples(),
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
|
-
relativePath: 'README.md',
|
|
307
|
+
relativePath: 'README.zh-CN.md',
|
|
308
308
|
marker: 'analyze-readme-options',
|
|
309
309
|
render: rootDir => renderAnalyzeOptionsTable(rootDir),
|
|
310
310
|
},
|
|
@@ -35,8 +35,12 @@ class RuleControlWorkflowTests(unittest.TestCase):
|
|
|
35
35
|
ROOT / ".codex/get-shit-done/workflows/execute-phase.md",
|
|
36
36
|
ROOT / ".claude/get-shit-done/workflows/execute-phase.md",
|
|
37
37
|
]
|
|
38
|
+
existing_paths = [workflow_path for workflow_path in workflow_paths if workflow_path.exists()]
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
if not existing_paths:
|
|
41
|
+
self.skipTest("execute-phase workflow paths are not vendored in this checkout")
|
|
42
|
+
|
|
43
|
+
for workflow_path in existing_paths:
|
|
40
44
|
content = workflow_path.read_text(encoding="utf-8")
|
|
41
45
|
self.assertIn("rule-context.mjs --files", content)
|
|
42
46
|
self.assertIn("<rule_context>", content)
|
|
@@ -46,6 +50,16 @@ class RuleControlWorkflowTests(unittest.TestCase):
|
|
|
46
50
|
self.assertIn("Rule validation backstop", content)
|
|
47
51
|
self.assertIn("python3 scripts/validate-rules.py code", content)
|
|
48
52
|
|
|
53
|
+
def test_pre_commit_report_only_timeout_guard_exists(self):
|
|
54
|
+
for hook_path in [
|
|
55
|
+
ROOT / ".githooks" / "pre-commit",
|
|
56
|
+
ROOT / "scripts" / "hooks" / "templates" / "pre-commit",
|
|
57
|
+
]:
|
|
58
|
+
content = hook_path.read_text(encoding="utf-8")
|
|
59
|
+
self.assertIn("RULE_REPORT_ONLY_TIMEOUT_SECONDS", content)
|
|
60
|
+
self.assertIn("Rule validation report-only timed out after", content)
|
|
61
|
+
self.assertIn("subprocess.TimeoutExpired", content)
|
|
62
|
+
|
|
49
63
|
|
|
50
64
|
if __name__ == "__main__":
|
|
51
65
|
unittest.main()
|
package/scripts/validate-docs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// [META] since:2026-03 | owner:docs-team | stable:true
|
|
2
2
|
// [WHY] Validate high-signal documentation facts against the current repository guardrails
|
|
3
3
|
|
|
4
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { collectAnalyzeDocSyncFailures } from './sync-analyze-docs.js';
|
|
@@ -273,7 +273,7 @@ function validatePackageScripts(rootDir, failures) {
|
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
function validateAnalyzeDocs(rootDir, failures) {
|
|
276
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
276
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
277
277
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
278
278
|
const claudeGuide = readText(rootDir, 'CLAUDE.md', failures);
|
|
279
279
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
@@ -410,7 +410,7 @@ function validateAnalyzeDocs(rootDir, failures) {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
function validateHistoryRiskDocs(rootDir, failures) {
|
|
413
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
413
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
414
414
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
415
415
|
const claudeGuide = readText(rootDir, 'CLAUDE.md', failures);
|
|
416
416
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
@@ -513,7 +513,7 @@ function validateHistoryRiskDocs(rootDir, failures) {
|
|
|
513
513
|
}
|
|
514
514
|
|
|
515
515
|
function validateDesignContractDocs(rootDir, failures) {
|
|
516
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
516
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
517
517
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
518
518
|
const claudeGuide = readText(rootDir, 'CLAUDE.md', failures);
|
|
519
519
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
@@ -835,8 +835,104 @@ function validateDesignContractDocs(rootDir, failures) {
|
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
|
|
838
|
+
function validateNpmScriptsAreReal(rootDir, failures) {
|
|
839
|
+
const packageJsonText = readText(rootDir, 'package.json', failures);
|
|
840
|
+
if (!packageJsonText) {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
let packageJson;
|
|
845
|
+
try {
|
|
846
|
+
packageJson = JSON.parse(packageJsonText);
|
|
847
|
+
} catch {
|
|
848
|
+
failures.push('package.json is not valid JSON — cannot validate npm scripts');
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
const scripts = packageJson.scripts;
|
|
853
|
+
if (!scripts || typeof scripts !== 'object') {
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/** Pattern matching echo stubs like: echo 'dependency-cruiser not installed, run: npm i -D dependency-cruiser' */
|
|
858
|
+
const ECHO_STUB_PATTERN = /^echo\s+['"].*not installed/i;
|
|
859
|
+
|
|
860
|
+
// Check all referenced npm scripts in docs are real (not echo stubs)
|
|
861
|
+
const docsDir = path.join(rootDir, 'docs');
|
|
862
|
+
const githubDir = path.join(rootDir, '.github');
|
|
863
|
+
const npmRunPattern = /npm\s+run\s+([a-zA-Z0-9:_-]+)/g;
|
|
864
|
+
|
|
865
|
+
function scanFileForNpmRun(filePath, label) {
|
|
866
|
+
if (!existsSync(filePath)) {
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
let content;
|
|
871
|
+
try {
|
|
872
|
+
content = readFileSync(filePath, 'utf8');
|
|
873
|
+
} catch {
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
let match;
|
|
878
|
+
while ((match = npmRunPattern.exec(content)) !== null) {
|
|
879
|
+
const scriptName = match[1].replace(/[.,;:!?`'"()\[\]{}]+$/, '');
|
|
880
|
+
// Skip known npm lifecycle scripts that don't need to be in package.json
|
|
881
|
+
const npmLifecycleScripts = new Set([
|
|
882
|
+
'postinstall', 'preinstall', 'prepare', 'prepublish', 'prepublishOnly',
|
|
883
|
+
'prerestart', 'postrestart', 'prestart', 'poststart', 'prestop', 'poststop',
|
|
884
|
+
'pretest', 'posttest', 'preversion', 'postversion',
|
|
885
|
+
]);
|
|
886
|
+
if (npmLifecycleScripts.has(scriptName)) {
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// Skip if not a defined script
|
|
891
|
+
if (!(scriptName in scripts)) {
|
|
892
|
+
failures.push(`[docs-script-ghost] ${label} references undefined npm script: "npm run ${scriptName}"`);
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
const scriptValue = scripts[scriptName];
|
|
897
|
+
if (typeof scriptValue === 'string' && ECHO_STUB_PATTERN.test(scriptValue)) {
|
|
898
|
+
failures.push(`[docs-script-stub] ${label} references npm script "${scriptName}" which is an echo stub, not a real command`);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
function scanDirectory(dirPath, labelPrefix) {
|
|
904
|
+
if (!existsSync(dirPath)) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// Walk directory recursively
|
|
909
|
+
function walk(currentPath, relativePath) {
|
|
910
|
+
const items = readdirSync(currentPath, { withFileTypes: true });
|
|
911
|
+
for (const item of items) {
|
|
912
|
+
const itemPath = path.join(currentPath, item.name);
|
|
913
|
+
const itemRelPath = path.join(relativePath, item.name);
|
|
914
|
+
if (item.isDirectory()) {
|
|
915
|
+
// Skip historical artifact directories
|
|
916
|
+
if (item.name === 'exec-plans' || item.name === 'ideation' || item.name === 'references' || item.name === 'archive') {
|
|
917
|
+
continue;
|
|
918
|
+
}
|
|
919
|
+
walk(itemPath, itemRelPath);
|
|
920
|
+
} else if (item.isFile() && item.name.endsWith('.md')) {
|
|
921
|
+
scanFileForNpmRun(itemPath, `${labelPrefix}/${itemRelPath}`);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
walk(dirPath, '');
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
scanDirectory(docsDir, 'docs');
|
|
929
|
+
scanDirectory(githubDir, '.github');
|
|
930
|
+
// Note: docs/exec-plans/ and docs/ideation/ contain historical artifacts
|
|
931
|
+
// that reference scripts from their time period — skip them
|
|
932
|
+
}
|
|
933
|
+
|
|
838
934
|
function validatePositioningBaselineDocs(rootDir, failures) {
|
|
839
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
935
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
840
936
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
841
937
|
const aiGuideIndex = readText(rootDir, 'docs/ai-guide/README.md', failures);
|
|
842
938
|
const outputGuide = readText(rootDir, 'docs/ai-guide/OUTPUT.md', failures);
|
|
@@ -844,7 +940,7 @@ function validatePositioningBaselineDocs(rootDir, failures) {
|
|
|
844
940
|
|
|
845
941
|
if (readme) {
|
|
846
942
|
const requiredReadmeSnippets = [
|
|
847
|
-
'AI-
|
|
943
|
+
'AI-Native',
|
|
848
944
|
'AI/Agent 是主要消费者',
|
|
849
945
|
'`server`、`watch`、`report`、`logs` 已从 public CLI 移除,并在调用时给出迁移提示。'
|
|
850
946
|
];
|
|
@@ -863,8 +959,8 @@ function validatePositioningBaselineDocs(rootDir, failures) {
|
|
|
863
959
|
|
|
864
960
|
if (aiGuide) {
|
|
865
961
|
const requiredAiGuideSnippets = [
|
|
866
|
-
'CodeMap 是一个 AI-
|
|
867
|
-
'
|
|
962
|
+
'CodeMap 是一个 AI-Native 优先',
|
|
963
|
+
'JSON/NDJSON 默认输出',
|
|
868
964
|
'`Server Layer` 是内部架构层,不等于公共 `mycodemap server` 命令',
|
|
869
965
|
'后者已从 public CLI 移除'
|
|
870
966
|
];
|
|
@@ -876,7 +972,7 @@ function validatePositioningBaselineDocs(rootDir, failures) {
|
|
|
876
972
|
|
|
877
973
|
if (aiGuideIndex) {
|
|
878
974
|
const requiredIndexSnippets = [
|
|
879
|
-
'AI-
|
|
975
|
+
'AI-Native 优先、人类友好的代码架构治理基础设施',
|
|
880
976
|
'AI/Agent 是主要消费者',
|
|
881
977
|
'`server`、`watch`、`report`、`logs` 已从 public CLI 移除'
|
|
882
978
|
];
|
|
@@ -909,7 +1005,7 @@ function validatePositioningBaselineDocs(rootDir, failures) {
|
|
|
909
1005
|
}
|
|
910
1006
|
|
|
911
1007
|
function validateCliSurfaceDocs(rootDir, failures) {
|
|
912
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1008
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
913
1009
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
914
1010
|
const aiGuideIndex = readText(rootDir, 'docs/ai-guide/README.md', failures);
|
|
915
1011
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
@@ -997,7 +1093,7 @@ function validateCliSurfaceDocs(rootDir, failures) {
|
|
|
997
1093
|
}
|
|
998
1094
|
|
|
999
1095
|
function validateConfigDocs(rootDir, failures) {
|
|
1000
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1096
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
1001
1097
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
1002
1098
|
const setupGuide = readText(rootDir, 'docs/SETUP_GUIDE.md', failures);
|
|
1003
1099
|
const assistantGuide = readText(rootDir, 'docs/AI_ASSISTANT_SETUP.md', failures);
|
|
@@ -1109,7 +1205,7 @@ function validateConfigDocs(rootDir, failures) {
|
|
|
1109
1205
|
}
|
|
1110
1206
|
|
|
1111
1207
|
function validatePluginRuntimeDocs(rootDir, failures) {
|
|
1112
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1208
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
1113
1209
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
1114
1210
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
1115
1211
|
const outputGuide = readText(rootDir, 'docs/ai-guide/OUTPUT.md', failures);
|
|
@@ -1184,7 +1280,7 @@ function validatePluginRuntimeDocs(rootDir, failures) {
|
|
|
1184
1280
|
}
|
|
1185
1281
|
|
|
1186
1282
|
function validateGraphStorageDocs(rootDir, failures) {
|
|
1187
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1283
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
1188
1284
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
1189
1285
|
const claudeGuide = readText(rootDir, 'CLAUDE.md', failures);
|
|
1190
1286
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
@@ -1331,7 +1427,7 @@ function validateTestingDocs(rootDir, failures) {
|
|
|
1331
1427
|
}
|
|
1332
1428
|
|
|
1333
1429
|
function validateWorkflowAndDiscoveryDocs(rootDir, failures) {
|
|
1334
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1430
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
1335
1431
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
1336
1432
|
const commandsGuide = readText(rootDir, 'docs/ai-guide/COMMANDS.md', failures);
|
|
1337
1433
|
const outputGuide = readText(rootDir, 'docs/ai-guide/OUTPUT.md', failures);
|
|
@@ -1531,7 +1627,7 @@ function validateProductSpecsDocs(rootDir, failures) {
|
|
|
1531
1627
|
}
|
|
1532
1628
|
|
|
1533
1629
|
function validateGuardrailDocs(rootDir, failures) {
|
|
1534
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1630
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
1535
1631
|
const engineeringRule = readText(rootDir, 'docs/rules/engineering-with-codex-openai.md', failures);
|
|
1536
1632
|
const validationRule = readText(rootDir, 'docs/rules/validation.md', failures);
|
|
1537
1633
|
const ciWorkflow = readText(rootDir, '.github/workflows/ci-gateway.yml', failures);
|
|
@@ -1593,7 +1689,7 @@ function validateGuardrailDocs(rootDir, failures) {
|
|
|
1593
1689
|
}
|
|
1594
1690
|
|
|
1595
1691
|
function validateValidationTruthDocs(rootDir, failures) {
|
|
1596
|
-
const readme = readText(rootDir, 'README.md', failures);
|
|
1692
|
+
const readme = readText(rootDir, 'README.zh-CN.md', failures) || readText(rootDir, 'README.md', failures);
|
|
1597
1693
|
const aiGuide = readText(rootDir, 'AI_GUIDE.md', failures);
|
|
1598
1694
|
const validationRule = readText(rootDir, 'docs/rules/validation.md', failures);
|
|
1599
1695
|
const engineeringRule = readText(rootDir, 'docs/rules/engineering-with-codex-openai.md', failures);
|
|
@@ -1651,6 +1747,7 @@ function validateDocs(rootDir) {
|
|
|
1651
1747
|
const failures = [];
|
|
1652
1748
|
|
|
1653
1749
|
validatePackageScripts(rootDir, failures);
|
|
1750
|
+
validateNpmScriptsAreReal(rootDir, failures);
|
|
1654
1751
|
validatePositioningBaselineDocs(rootDir, failures);
|
|
1655
1752
|
validateCliSurfaceDocs(rootDir, failures);
|
|
1656
1753
|
validateConfigDocs(rootDir, failures);
|