@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,118 @@
|
|
|
1
|
+
// [META] since:2026-05-02 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Interface contract for the `preview` command family
|
|
3
|
+
export const previewContract = {
|
|
4
|
+
name: 'preview',
|
|
5
|
+
description: 'Zero-config project preview — file count, modules, dependencies, complexity',
|
|
6
|
+
stable: true,
|
|
7
|
+
args: [],
|
|
8
|
+
flags: [
|
|
9
|
+
{
|
|
10
|
+
name: 'save',
|
|
11
|
+
long: 'save',
|
|
12
|
+
description: 'Save profile config and run full generate',
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
defaultValue: false,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'human',
|
|
18
|
+
long: 'human',
|
|
19
|
+
description: 'Force human-readable output',
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
defaultValue: false,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'json',
|
|
25
|
+
short: 'j',
|
|
26
|
+
long: 'json',
|
|
27
|
+
description: 'Force JSON output',
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
defaultValue: false,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'profile',
|
|
33
|
+
long: 'profile',
|
|
34
|
+
description: 'Skip detection, use specified profile (nodejs|python|go|rust|generic)',
|
|
35
|
+
type: 'string',
|
|
36
|
+
defaultValue: undefined,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
outputShape: {
|
|
40
|
+
description: 'Project preview summary',
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: [
|
|
43
|
+
{ name: 'projectType', type: 'string', description: 'Detected or specified project type' },
|
|
44
|
+
{ name: 'profile', type: 'string', description: 'Profile name used for analysis' },
|
|
45
|
+
{
|
|
46
|
+
name: 'files',
|
|
47
|
+
type: 'object',
|
|
48
|
+
description: 'File discovery results',
|
|
49
|
+
properties: [
|
|
50
|
+
{ name: 'total', type: 'number', description: 'Total source files found' },
|
|
51
|
+
{ name: 'byExtension', type: 'object', description: 'File count by extension' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'modules',
|
|
56
|
+
type: 'object',
|
|
57
|
+
description: 'Module grouping results',
|
|
58
|
+
properties: [
|
|
59
|
+
{ name: 'count', type: 'number', description: 'Number of distinct module directories' },
|
|
60
|
+
{
|
|
61
|
+
name: 'top',
|
|
62
|
+
type: 'array',
|
|
63
|
+
description: 'Top directories by file count',
|
|
64
|
+
items: { name: 'dir', type: 'string' },
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'dependencies',
|
|
70
|
+
type: 'object',
|
|
71
|
+
description: 'Direct dependencies from marker files',
|
|
72
|
+
properties: [
|
|
73
|
+
{
|
|
74
|
+
name: 'direct',
|
|
75
|
+
type: 'array',
|
|
76
|
+
description: 'Dependency names',
|
|
77
|
+
items: { name: 'dep', type: 'string' },
|
|
78
|
+
},
|
|
79
|
+
{ name: 'count', type: 'number', description: 'Total dependency count' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'complexity',
|
|
84
|
+
type: 'object',
|
|
85
|
+
description: 'Complexity hotspot analysis',
|
|
86
|
+
properties: [
|
|
87
|
+
{
|
|
88
|
+
name: 'hotspots',
|
|
89
|
+
type: 'array',
|
|
90
|
+
description: 'Top-5 files by cyclomatic complexity',
|
|
91
|
+
items: {
|
|
92
|
+
name: 'hotspot',
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: [
|
|
95
|
+
{ name: 'file', type: 'string' },
|
|
96
|
+
{ name: 'score', type: 'number' },
|
|
97
|
+
{ name: 'functions', type: 'number' },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{ name: 'hint', type: 'string', description: 'Next-step guidance text' },
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
errorCodes: [
|
|
107
|
+
{ code: 'PREVIEW_PROFILE_LOAD_FAILED', description: 'Failed to load bootstrap profile' },
|
|
108
|
+
{ code: 'PREVIEW_NO_FILES_FOUND', description: 'No source files discovered' },
|
|
109
|
+
],
|
|
110
|
+
examples: [
|
|
111
|
+
'codemap preview',
|
|
112
|
+
'codemap preview --save',
|
|
113
|
+
'codemap preview --json',
|
|
114
|
+
'codemap preview --profile nodejs',
|
|
115
|
+
'codemap preview --human',
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../../src/cli/interface-contract/commands/preview.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,4DAA4D;AAI5D,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,6EAA6E;IAC1F,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,EAAE;IACR,KAAK,EAAE;QACL;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,KAAK;SACpB;QACD;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,KAAK;SACpB;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,KAAK;SACpB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,uEAAuE;YACpF,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,SAAS;SACxB;KACF;IACD,WAAW,EAAE;QACX,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;YAC1F,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;YAClF;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wBAAwB;gBACrC,UAAU,EAAE;oBACV,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ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E,IAAI,EAAE,QAAQ,EAAE;gCACjC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;6BACtC;yBACF;qBACF;iBACF;aACF;YACD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;SACzE;KACF;IACD,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,6BAA6B,EAAE,WAAW,EAAE,kCAAkC,EAAE;QACxF,EAAE,IAAI,EAAE,wBAAwB,EAAE,WAAW,EAAE,4BAA4B,EAAE;KAC9E;IACD,QAAQ,EAAE;QACR,iBAAiB;QACjB,wBAAwB;QACxB,wBAAwB;QACxB,kCAAkC;QAClC,yBAAyB;KAC1B;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/cli/interface-contract/commands/query.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,aAAa,EAAE,eAsL3B,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Interface contract for the `query` command family
|
|
3
|
+
export const queryContract = {
|
|
4
|
+
name: 'query',
|
|
5
|
+
description: '查询代码地图中的符号、模块、依赖信息',
|
|
6
|
+
stable: true,
|
|
7
|
+
args: [],
|
|
8
|
+
flags: [
|
|
9
|
+
{
|
|
10
|
+
name: 'symbol',
|
|
11
|
+
short: 's',
|
|
12
|
+
long: 'symbol',
|
|
13
|
+
description: '精确查询符号',
|
|
14
|
+
type: 'string',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'module',
|
|
18
|
+
short: 'm',
|
|
19
|
+
long: 'module',
|
|
20
|
+
description: '查询模块',
|
|
21
|
+
type: 'string',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'deps',
|
|
25
|
+
short: 'd',
|
|
26
|
+
long: 'deps',
|
|
27
|
+
description: '查询依赖',
|
|
28
|
+
type: 'string',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'search',
|
|
32
|
+
short: 'S',
|
|
33
|
+
long: 'search',
|
|
34
|
+
description: '模糊搜索',
|
|
35
|
+
type: 'string',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'limit',
|
|
39
|
+
short: 'l',
|
|
40
|
+
long: 'limit',
|
|
41
|
+
description: '限制结果数量',
|
|
42
|
+
type: 'number',
|
|
43
|
+
defaultValue: 50,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'json',
|
|
47
|
+
short: 'j',
|
|
48
|
+
long: 'json',
|
|
49
|
+
description: 'JSON 格式输出',
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
defaultValue: false,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'structured',
|
|
55
|
+
long: 'structured',
|
|
56
|
+
description: '输出完全结构化的 JSON(不包含自然语言字符串,需要配合 --json 使用)',
|
|
57
|
+
type: 'boolean',
|
|
58
|
+
defaultValue: false,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'verbose',
|
|
62
|
+
short: 'v',
|
|
63
|
+
long: 'verbose',
|
|
64
|
+
description: '显示性能指标',
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
defaultValue: false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'regex',
|
|
70
|
+
short: 'r',
|
|
71
|
+
long: 'regex',
|
|
72
|
+
description: '使用正则表达式搜索(仅适用于 -S/--search)',
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
defaultValue: false,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'context',
|
|
78
|
+
short: 'c',
|
|
79
|
+
long: 'context',
|
|
80
|
+
description: '显示代码上下文行数',
|
|
81
|
+
type: 'number',
|
|
82
|
+
defaultValue: 0,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'case-sensitive',
|
|
86
|
+
long: 'case-sensitive',
|
|
87
|
+
description: '大小写敏感搜索(精确搜索默认开启)',
|
|
88
|
+
type: 'boolean',
|
|
89
|
+
defaultValue: false,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'include-references',
|
|
93
|
+
long: 'include-references',
|
|
94
|
+
description: '包含符号引用位置信息',
|
|
95
|
+
type: 'boolean',
|
|
96
|
+
defaultValue: false,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'deps-format',
|
|
100
|
+
long: 'deps-format',
|
|
101
|
+
description: '依赖查询输出格式 (default|detailed)',
|
|
102
|
+
type: 'string',
|
|
103
|
+
defaultValue: 'default',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'no-cache',
|
|
107
|
+
long: 'no-cache',
|
|
108
|
+
description: '禁用缓存,强制重新加载索引',
|
|
109
|
+
type: 'boolean',
|
|
110
|
+
defaultValue: false,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
outputShape: {
|
|
114
|
+
description: '查询结果',
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: [
|
|
117
|
+
{
|
|
118
|
+
name: 'type',
|
|
119
|
+
type: 'string',
|
|
120
|
+
description: '查询类型: symbol | module | deps | search',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'query',
|
|
124
|
+
type: 'string',
|
|
125
|
+
description: '实际执行的查询字符串',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'count',
|
|
129
|
+
type: 'number',
|
|
130
|
+
description: '结果数量',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'results',
|
|
134
|
+
type: 'array',
|
|
135
|
+
description: '结果条目列表',
|
|
136
|
+
items: {
|
|
137
|
+
name: 'resultItem',
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: [
|
|
140
|
+
{ name: 'name', type: 'string' },
|
|
141
|
+
{ name: 'path', type: 'string', nullable: true },
|
|
142
|
+
{ name: 'kind', type: 'string', nullable: true },
|
|
143
|
+
{ name: 'details', type: 'string', nullable: true },
|
|
144
|
+
{
|
|
145
|
+
name: 'location',
|
|
146
|
+
type: 'object',
|
|
147
|
+
nullable: true,
|
|
148
|
+
properties: [
|
|
149
|
+
{ name: 'file', type: 'string' },
|
|
150
|
+
{ name: 'line', type: 'number', nullable: true },
|
|
151
|
+
{ name: 'column', type: 'number', nullable: true },
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
{ name: 'isExported', type: 'boolean', nullable: true },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'metrics',
|
|
160
|
+
type: 'object',
|
|
161
|
+
description: '性能指标(verbose 模式输出)',
|
|
162
|
+
nullable: true,
|
|
163
|
+
properties: [
|
|
164
|
+
{ name: 'indexLoadTime', type: 'number' },
|
|
165
|
+
{ name: 'queryTime', type: 'number' },
|
|
166
|
+
{ name: 'totalTime', type: 'number' },
|
|
167
|
+
{ name: 'cacheHit', type: 'boolean' },
|
|
168
|
+
{ name: 'indexSize', type: 'number' },
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
errorCodes: [
|
|
174
|
+
{ code: 'INDEX_NOT_FOUND', description: '代码地图索引不存在,需先运行 generate' },
|
|
175
|
+
{ code: 'INVALID_QUERY', description: '查询参数无效或冲突' },
|
|
176
|
+
{ code: 'NO_RESULTS', description: '未找到匹配结果' },
|
|
177
|
+
{ code: 'CACHE_ERROR', description: '缓存读写失败' },
|
|
178
|
+
],
|
|
179
|
+
examples: [
|
|
180
|
+
'codemap query -s MyClass --json',
|
|
181
|
+
'codemap query -m src/index.ts -l 10',
|
|
182
|
+
'codemap query -S "router" --regex -j',
|
|
183
|
+
'codemap query -d lodash --deps-format detailed --json',
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/cli/interface-contract/commands/query.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,0DAA0D;AAI1D,MAAM,CAAC,MAAM,aAAa,GAAoB;IAC5C,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,oBAAoB;IACjC,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,EAAE;IACR,KAAK,EAAE;QACL;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,EAAE;SACjB;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,KAAK;SACpB;QACD;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,YAAY;YACl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BACd,UAAU,EAAE;oBACV,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACrC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;oBACrC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;iBACtC;aACF;SACF;KACF;IACD,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,yBAAyB,EAAE;QACnE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE;QACnD,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE;QAC9C,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE;KAC/C;IACD,QAAQ,EAAE;QACR,iCAAiC;QACjC,qCAAqC;QACrC,sCAAsC;QACtC,uDAAuD;KACxD;CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InterfaceContract } from './types.js';
|
|
2
|
+
export type { ArgDef, CommandContract, ErrorCode, FlagDef, FlagType, InterfaceContract, OutputProperty, OutputShape, } from './types.js';
|
|
3
|
+
export { interfaceContractSchema, safeValidateInterfaceContract, validateInterfaceContract, } from './schema.js';
|
|
4
|
+
export { commandContracts, analyzeContract, queryContract, depsContract, doctorContract, benchmarkContract, initContract, envContractContract, agentMetricsContract, } from './commands/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Build the full interface contract from the registered command contracts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getFullContract(): InterfaceContract;
|
|
9
|
+
/**
|
|
10
|
+
* Validate a candidate contract object against the meta-schema.
|
|
11
|
+
* @throws {z.ZodError} if validation fails
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateContract(data: unknown): InterfaceContract;
|
|
14
|
+
/**
|
|
15
|
+
* Validate the current full contract against the meta-schema.
|
|
16
|
+
* Useful as a self-test during CI or startup.
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateCurrentContract(): {
|
|
19
|
+
valid: boolean;
|
|
20
|
+
errors?: string[];
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/interface-contract/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAQpD,YAAY,EACV,MAAM,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,wBAAgB,eAAe,IAAI,iBAAiB,CASnD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAEjE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI;IACzC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAYA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Public API for the CLI interface contract — schema access, validation, and programmatic introspection
|
|
3
|
+
import { commandContracts } from './commands/index.js';
|
|
4
|
+
import { safeValidateInterfaceContract, validateInterfaceContract, } from './schema.js';
|
|
5
|
+
export { interfaceContractSchema, safeValidateInterfaceContract, validateInterfaceContract, } from './schema.js';
|
|
6
|
+
export { commandContracts, analyzeContract, queryContract, depsContract, doctorContract, benchmarkContract, initContract, envContractContract, agentMetricsContract, } from './commands/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Build the full interface contract from the registered command contracts.
|
|
9
|
+
*/
|
|
10
|
+
export function getFullContract() {
|
|
11
|
+
return {
|
|
12
|
+
version: '1.0.0',
|
|
13
|
+
programName: 'mycodemap',
|
|
14
|
+
aliases: ['codemap'],
|
|
15
|
+
description: 'TypeScript 代码地图工具 - 为 AI 辅助开发提供结构化上下文',
|
|
16
|
+
commands: [...commandContracts],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Validate a candidate contract object against the meta-schema.
|
|
21
|
+
* @throws {z.ZodError} if validation fails
|
|
22
|
+
*/
|
|
23
|
+
export function validateContract(data) {
|
|
24
|
+
return validateInterfaceContract(data);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Validate the current full contract against the meta-schema.
|
|
28
|
+
* Useful as a self-test during CI or startup.
|
|
29
|
+
*/
|
|
30
|
+
export function validateCurrentContract() {
|
|
31
|
+
const contract = getFullContract();
|
|
32
|
+
const result = safeValidateInterfaceContract(contract);
|
|
33
|
+
if (result.success) {
|
|
34
|
+
return { valid: true };
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
valid: false,
|
|
38
|
+
errors: result.error.issues.map((e) => `${String(e.path)}: ${e.message}`),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/interface-contract/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,8GAA8G;AAG9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAA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OutputShape } from './types.js';
|
|
3
|
+
export declare const flagTypeSchema: z.ZodEnum<{
|
|
4
|
+
string: "string";
|
|
5
|
+
number: "number";
|
|
6
|
+
boolean: "boolean";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const argDefSchema: z.ZodType<ArgDef>;
|
|
9
|
+
export declare const flagDefSchema: z.ZodType<FlagDef>;
|
|
10
|
+
export declare const outputPropertySchema: z.ZodType<OutputProperty>;
|
|
11
|
+
export declare const outputShapeSchema: z.ZodType<OutputShape>;
|
|
12
|
+
export declare const errorCodeSchema: z.ZodType<ErrorCode>;
|
|
13
|
+
export declare const commandContractSchema: z.ZodType<CommandContract>;
|
|
14
|
+
export declare const interfaceContractSchema: z.ZodType<InterfaceContract>;
|
|
15
|
+
/**
|
|
16
|
+
* Validate an unknown value as an InterfaceContract.
|
|
17
|
+
* @returns parsed contract on success, throws ZodError on failure
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateInterfaceContract(data: unknown): InterfaceContract;
|
|
20
|
+
/**
|
|
21
|
+
* Safe validation — returns a result object instead of throwing.
|
|
22
|
+
*/
|
|
23
|
+
export declare function safeValidateInterfaceContract(data: unknown): {
|
|
24
|
+
success: true;
|
|
25
|
+
data: InterfaceContract;
|
|
26
|
+
} | {
|
|
27
|
+
success: false;
|
|
28
|
+
error: z.ZodError;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/cli/interface-contract/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,MAAM,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,cAAc;;;;EAA0C,CAAC;AAEtE,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAKzC,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAS3C,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAS1D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAInD,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAG/C,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAU3D,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAM/D,CAAC;AAEH;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAE1E;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,OAAO,GACZ;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAA;CAAE,CAMpF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Zod meta-schema for runtime validation of interface contracts
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export const flagTypeSchema = z.enum(['string', 'boolean', 'number']);
|
|
5
|
+
export const argDefSchema = z.object({
|
|
6
|
+
name: z.string(),
|
|
7
|
+
description: z.string(),
|
|
8
|
+
required: z.boolean().optional(),
|
|
9
|
+
variadic: z.boolean().optional(),
|
|
10
|
+
});
|
|
11
|
+
export const flagDefSchema = z.object({
|
|
12
|
+
name: z.string(),
|
|
13
|
+
short: z.string().optional(),
|
|
14
|
+
long: z.string(),
|
|
15
|
+
description: z.string(),
|
|
16
|
+
type: flagTypeSchema,
|
|
17
|
+
defaultValue: z.unknown().optional(),
|
|
18
|
+
multiple: z.boolean().optional(),
|
|
19
|
+
required: z.boolean().optional(),
|
|
20
|
+
});
|
|
21
|
+
export const outputPropertySchema = z.lazy(() => z.object({
|
|
22
|
+
name: z.string(),
|
|
23
|
+
type: z.enum(['string', 'number', 'boolean', 'object', 'array', 'null']),
|
|
24
|
+
description: z.string().optional(),
|
|
25
|
+
nullable: z.boolean().optional(),
|
|
26
|
+
items: outputPropertySchema.optional(),
|
|
27
|
+
properties: z.array(outputPropertySchema).optional(),
|
|
28
|
+
}));
|
|
29
|
+
export const outputShapeSchema = z.object({
|
|
30
|
+
description: z.string().optional(),
|
|
31
|
+
type: z.enum(['object', 'array']),
|
|
32
|
+
properties: z.array(outputPropertySchema),
|
|
33
|
+
});
|
|
34
|
+
export const errorCodeSchema = z.object({
|
|
35
|
+
code: z.string(),
|
|
36
|
+
description: z.string(),
|
|
37
|
+
});
|
|
38
|
+
export const commandContractSchema = z.object({
|
|
39
|
+
name: z.string(),
|
|
40
|
+
description: z.string(),
|
|
41
|
+
stable: z.boolean(),
|
|
42
|
+
aliases: z.array(z.string()).optional(),
|
|
43
|
+
args: z.array(argDefSchema),
|
|
44
|
+
flags: z.array(flagDefSchema),
|
|
45
|
+
outputShape: outputShapeSchema,
|
|
46
|
+
errorCodes: z.array(errorCodeSchema),
|
|
47
|
+
examples: z.array(z.string()),
|
|
48
|
+
});
|
|
49
|
+
export const interfaceContractSchema = z.object({
|
|
50
|
+
version: z.string(),
|
|
51
|
+
programName: z.string(),
|
|
52
|
+
aliases: z.array(z.string()),
|
|
53
|
+
description: z.string(),
|
|
54
|
+
commands: z.array(commandContractSchema),
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Validate an unknown value as an InterfaceContract.
|
|
58
|
+
* @returns parsed contract on success, throws ZodError on failure
|
|
59
|
+
*/
|
|
60
|
+
export function validateInterfaceContract(data) {
|
|
61
|
+
return interfaceContractSchema.parse(data);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Safe validation — returns a result object instead of throwing.
|
|
65
|
+
*/
|
|
66
|
+
export function safeValidateInterfaceContract(data) {
|
|
67
|
+
const result = interfaceContractSchema.safeParse(data);
|
|
68
|
+
if (result.success) {
|
|
69
|
+
return { success: true, data: result.data };
|
|
70
|
+
}
|
|
71
|
+
return { success: false, error: result.error };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/cli/interface-contract/schema.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,YAAY,GAAsB,CAAC,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAuB,CAAC,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,cAAc;IACpB,YAAY,EAAE,CAAC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OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported flag value types
|
|
3
|
+
*/
|
|
4
|
+
export type FlagType = 'string' | 'boolean' | 'number';
|
|
5
|
+
/**
|
|
6
|
+
* Positional argument definition
|
|
7
|
+
*/
|
|
8
|
+
export interface ArgDef {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
variadic?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Flag / option definition
|
|
16
|
+
*/
|
|
17
|
+
export interface FlagDef {
|
|
18
|
+
name: string;
|
|
19
|
+
short?: string;
|
|
20
|
+
long: string;
|
|
21
|
+
description: string;
|
|
22
|
+
type: FlagType;
|
|
23
|
+
defaultValue?: unknown;
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Output property descriptor (JSON Schema-ish, serializable)
|
|
29
|
+
*/
|
|
30
|
+
export interface OutputProperty {
|
|
31
|
+
name: string;
|
|
32
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null';
|
|
33
|
+
description?: string;
|
|
34
|
+
nullable?: boolean;
|
|
35
|
+
items?: OutputProperty;
|
|
36
|
+
properties?: OutputProperty[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Output shape descriptor for a command
|
|
40
|
+
*/
|
|
41
|
+
export interface OutputShape {
|
|
42
|
+
description?: string;
|
|
43
|
+
type: 'object' | 'array';
|
|
44
|
+
properties: OutputProperty[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Known error code for a command
|
|
48
|
+
*/
|
|
49
|
+
export interface ErrorCode {
|
|
50
|
+
code: string;
|
|
51
|
+
description: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Contract for a single CLI command
|
|
55
|
+
*/
|
|
56
|
+
export interface CommandContract {
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
stable: boolean;
|
|
60
|
+
aliases?: string[];
|
|
61
|
+
args: ArgDef[];
|
|
62
|
+
flags: FlagDef[];
|
|
63
|
+
outputShape: OutputShape;
|
|
64
|
+
errorCodes: ErrorCode[];
|
|
65
|
+
examples: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Full CLI interface contract
|
|
69
|
+
*/
|
|
70
|
+
export interface InterfaceContract {
|
|
71
|
+
version: string;
|
|
72
|
+
programName: string;
|
|
73
|
+
aliases: string[];
|
|
74
|
+
description: string;
|
|
75
|
+
commands: CommandContract[];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/interface-contract/types.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WA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C1D,2GAA2G"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OutputMode, ActionableError } from './types.js';
|
|
2
|
+
export interface SuggestionResult {
|
|
3
|
+
type: 'result';
|
|
4
|
+
success: boolean;
|
|
5
|
+
data?: unknown;
|
|
6
|
+
attemptedCommand?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function tryApplySuggestion(error: ActionableError, options: {
|
|
9
|
+
applySuggestion?: boolean;
|
|
10
|
+
wasmFallback?: boolean;
|
|
11
|
+
}, _mode: OutputMode): Promise<SuggestionResult>;
|
|
12
|
+
//# sourceMappingURL=apply-suggestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-suggestion.d.ts","sourceRoot":"","sources":["../../../src/cli/output/apply-suggestion.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK9D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,EAC9D,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,gBAAgB,CAAC,CAwB3B"}
|