@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,29 @@
|
|
|
1
|
+
// [META] since:2026-05-01 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Safety-gated auto-remediation engine — executes nextCommand only when confidence >= threshold and --apply-suggestion flag set
|
|
3
|
+
import { exec } from 'node:child_process';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
import { APPLY_SUGGESTION_CONFIDENCE_THRESHOLD } from './types.js';
|
|
6
|
+
const execAsync = promisify(exec);
|
|
7
|
+
export async function tryApplySuggestion(error, options, _mode) {
|
|
8
|
+
if (!options.applySuggestion) {
|
|
9
|
+
return { type: 'result', success: false, data: { reason: 'apply-suggestion flag not set' } };
|
|
10
|
+
}
|
|
11
|
+
if (error.confidence < APPLY_SUGGESTION_CONFIDENCE_THRESHOLD) {
|
|
12
|
+
return { type: 'result', success: false, data: { reason: `confidence ${error.confidence} below threshold ${APPLY_SUGGESTION_CONFIDENCE_THRESHOLD}` } };
|
|
13
|
+
}
|
|
14
|
+
if (!error.nextCommand) {
|
|
15
|
+
return { type: 'result', success: false, data: { reason: 'no nextCommand available' } };
|
|
16
|
+
}
|
|
17
|
+
process.stderr.write(JSON.stringify({ type: 'apply-suggestion', action: 'attempt', command: error.nextCommand, confidence: error.confidence }) + '\n');
|
|
18
|
+
try {
|
|
19
|
+
const { stdout } = await execAsync(error.nextCommand, { timeout: 30000 });
|
|
20
|
+
process.stderr.write(JSON.stringify({ type: 'apply-suggestion', action: 'success', command: error.nextCommand }) + '\n');
|
|
21
|
+
return { type: 'result', success: true, data: { stdout: stdout.trim() }, attemptedCommand: error.nextCommand };
|
|
22
|
+
}
|
|
23
|
+
catch (execError) {
|
|
24
|
+
const msg = execError instanceof Error ? execError.message : String(execError);
|
|
25
|
+
process.stderr.write(JSON.stringify({ type: 'apply-suggestion', action: 'failed', command: error.nextCommand, error: msg }) + '\n');
|
|
26
|
+
return { type: 'result', success: false, data: { error: msg }, attemptedCommand: error.nextCommand };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=apply-suggestion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-suggestion.js","sourceRoot":"","sources":["../../../src/cli/output/apply-suggestion.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,sIAAsI;AAEtI,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,qCAAqC,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,SAAS,GAAG,SAAS,CAAC,IA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G,IAAI,CAAC,CAAC;QACzH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;IACjH,CAAC;IAAC,OAAO,SAAS,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,SAAS,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACpI,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;IACvG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const ErrorCodes: {
|
|
2
|
+
readonly DEP_NATIVE_MISSING: "DEP_NATIVE_MISSING";
|
|
3
|
+
readonly DEP_WASM_FALLBACK_AVAILABLE: "DEP_WASM_FALLBACK_AVAILABLE";
|
|
4
|
+
readonly DEP_MODULE_NOT_FOUND: "DEP_MODULE_NOT_FOUND";
|
|
5
|
+
readonly DEP_REBUILD_REQUIRED: "DEP_REBUILD_REQUIRED";
|
|
6
|
+
readonly CFG_INVALID_CONFIG: "CFG_INVALID_CONFIG";
|
|
7
|
+
readonly CFG_WORKSPACE_NOT_INITIALIZED: "CFG_WORKSPACE_NOT_INITIALIZED";
|
|
8
|
+
readonly CFG_WORKSPACE_DRIFT: "CFG_WORKSPACE_DRIFT";
|
|
9
|
+
readonly DEPRECATED_PARSER_MODE: "DEPRECATED_PARSER_MODE";
|
|
10
|
+
readonly UNSUPPORTED_STORAGE_TYPE: "UNSUPPORTED_STORAGE_TYPE";
|
|
11
|
+
readonly RUN_COMMAND_FAILED: "RUN_COMMAND_FAILED";
|
|
12
|
+
readonly RUN_PARSE_ERROR: "RUN_PARSE_ERROR";
|
|
13
|
+
readonly RUN_TIMEOUT: "RUN_TIMEOUT";
|
|
14
|
+
readonly FS_FILE_NOT_FOUND: "FS_FILE_NOT_FOUND";
|
|
15
|
+
readonly FS_PERMISSION_DENIED: "FS_PERMISSION_DENIED";
|
|
16
|
+
readonly FS_WORKING_DIR_INVALID: "FS_WORKING_DIR_INVALID";
|
|
17
|
+
};
|
|
18
|
+
export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
|
|
19
|
+
export declare const ErrorRemediation: Record<ErrorCode, {
|
|
20
|
+
message: string;
|
|
21
|
+
nextCommand?: string;
|
|
22
|
+
confidence: number;
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/cli/output/error-codes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;CAuBb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAErE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,SAAS,EACT;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA6E9D,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// [META] since:2026-05-01 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Canonical error code registry with prefix classification and remediation map
|
|
3
|
+
export const ErrorCodes = {
|
|
4
|
+
// Dependency errors
|
|
5
|
+
DEP_NATIVE_MISSING: 'DEP_NATIVE_MISSING',
|
|
6
|
+
DEP_WASM_FALLBACK_AVAILABLE: 'DEP_WASM_FALLBACK_AVAILABLE',
|
|
7
|
+
DEP_MODULE_NOT_FOUND: 'DEP_MODULE_NOT_FOUND',
|
|
8
|
+
DEP_REBUILD_REQUIRED: 'DEP_REBUILD_REQUIRED',
|
|
9
|
+
// Configuration errors
|
|
10
|
+
CFG_INVALID_CONFIG: 'CFG_INVALID_CONFIG',
|
|
11
|
+
CFG_WORKSPACE_NOT_INITIALIZED: 'CFG_WORKSPACE_NOT_INITIALIZED',
|
|
12
|
+
CFG_WORKSPACE_DRIFT: 'CFG_WORKSPACE_DRIFT',
|
|
13
|
+
// Runtime errors
|
|
14
|
+
DEPRECATED_PARSER_MODE: 'DEPRECATED_PARSER_MODE',
|
|
15
|
+
UNSUPPORTED_STORAGE_TYPE: 'UNSUPPORTED_STORAGE_TYPE',
|
|
16
|
+
RUN_COMMAND_FAILED: 'RUN_COMMAND_FAILED',
|
|
17
|
+
RUN_PARSE_ERROR: 'RUN_PARSE_ERROR',
|
|
18
|
+
RUN_TIMEOUT: 'RUN_TIMEOUT',
|
|
19
|
+
// Filesystem errors
|
|
20
|
+
FS_FILE_NOT_FOUND: 'FS_FILE_NOT_FOUND',
|
|
21
|
+
FS_PERMISSION_DENIED: 'FS_PERMISSION_DENIED',
|
|
22
|
+
FS_WORKING_DIR_INVALID: 'FS_WORKING_DIR_INVALID',
|
|
23
|
+
};
|
|
24
|
+
export const ErrorRemediation = {
|
|
25
|
+
DEP_NATIVE_MISSING: {
|
|
26
|
+
message: 'Native dependency cannot be loaded. Try: --wasm-fallback, npm rebuild, or install prebuilt binaries',
|
|
27
|
+
nextCommand: 'codemap --wasm-fallback',
|
|
28
|
+
confidence: 0.9,
|
|
29
|
+
},
|
|
30
|
+
DEP_WASM_FALLBACK_AVAILABLE: {
|
|
31
|
+
message: 'Native dependency unavailable but WASM fallback is available',
|
|
32
|
+
nextCommand: 'codemap --wasm-fallback',
|
|
33
|
+
confidence: 0.95,
|
|
34
|
+
},
|
|
35
|
+
DEP_MODULE_NOT_FOUND: {
|
|
36
|
+
message: 'Required module not found. Run npm install to install dependencies',
|
|
37
|
+
nextCommand: 'npm install',
|
|
38
|
+
confidence: 0.85,
|
|
39
|
+
},
|
|
40
|
+
DEP_REBUILD_REQUIRED: {
|
|
41
|
+
message: 'Native modules need rebuilding. Run npm rebuild',
|
|
42
|
+
nextCommand: 'npm rebuild',
|
|
43
|
+
confidence: 0.85,
|
|
44
|
+
},
|
|
45
|
+
CFG_INVALID_CONFIG: {
|
|
46
|
+
message: 'Configuration file is invalid. Check .mycodemap/config.json syntax',
|
|
47
|
+
confidence: 0.7,
|
|
48
|
+
},
|
|
49
|
+
CFG_WORKSPACE_NOT_INITIALIZED: {
|
|
50
|
+
message: 'Workspace not initialized. Run codemap init first',
|
|
51
|
+
nextCommand: 'codemap init',
|
|
52
|
+
confidence: 0.9,
|
|
53
|
+
},
|
|
54
|
+
CFG_WORKSPACE_DRIFT: {
|
|
55
|
+
message: 'Workspace has drifted from receipt state. Run codemap doctor for details',
|
|
56
|
+
nextCommand: 'codemap doctor',
|
|
57
|
+
confidence: 0.8,
|
|
58
|
+
},
|
|
59
|
+
DEPRECATED_PARSER_MODE: {
|
|
60
|
+
message: 'Parser mode inputs fast/smart/hybrid are deprecated. Remove the mode flag or config value and use the default registry-backed parser flow',
|
|
61
|
+
nextCommand: 'mycodemap doctor',
|
|
62
|
+
confidence: 0.98,
|
|
63
|
+
},
|
|
64
|
+
UNSUPPORTED_STORAGE_TYPE: {
|
|
65
|
+
message: 'Persistent storage has converged to SQLite-only. Change storage.type to "sqlite" (recommended) or "auto"; use "memory" only for tests, and migrate legacy filesystem/Kuzu data into the SQLite database path before rerunning',
|
|
66
|
+
nextCommand: 'mycodemap doctor',
|
|
67
|
+
confidence: 0.97,
|
|
68
|
+
},
|
|
69
|
+
RUN_COMMAND_FAILED: {
|
|
70
|
+
message: 'Command execution failed. Check the error details above',
|
|
71
|
+
confidence: 0.3,
|
|
72
|
+
},
|
|
73
|
+
RUN_PARSE_ERROR: {
|
|
74
|
+
message: 'Parse error in source file. Verify the file syntax',
|
|
75
|
+
confidence: 0.5,
|
|
76
|
+
},
|
|
77
|
+
RUN_TIMEOUT: {
|
|
78
|
+
message: 'Operation timed out. Try with a smaller scope or increase timeout',
|
|
79
|
+
confidence: 0.6,
|
|
80
|
+
},
|
|
81
|
+
FS_FILE_NOT_FOUND: {
|
|
82
|
+
message: 'Required file not found. Verify the path is correct',
|
|
83
|
+
confidence: 0.7,
|
|
84
|
+
},
|
|
85
|
+
FS_PERMISSION_DENIED: {
|
|
86
|
+
message: 'Permission denied. Check file/directory permissions',
|
|
87
|
+
confidence: 0.6,
|
|
88
|
+
},
|
|
89
|
+
FS_WORKING_DIR_INVALID: {
|
|
90
|
+
message: 'Working directory is invalid or does not exist',
|
|
91
|
+
confidence: 0.8,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=error-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../../src/cli/output/error-codes.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,qFAAqF;AAErF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,oBAAoB;IACpB,kBAAkB,EAAE,oBAAoB;IACxC,2BAA2B,EAAE,6BAA6B;IAC1D,oBAAoB,EAAE,sBAAsB;IAC5C,oBAAoB,EAAE,sBAAsB;IAE5C,uBAAuB;IACvB,kBAAkB,EAAE,oBAAoB;IACxC,6BAA6B,EAAE,+BAA+B;IAC9D,mBAAmB,EAAE,qBAAqB;IAE1C,iBAAiB;IACjB,sBAAsB,EAAE,wBAAwB;IAChD,wBAAwB,EAAE,0BAA0B;IACpD,kBAA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oD;QAC7D,UAAU,EAAE,GAAG;KAChB;IACD,WAAW,EAAE;QACX,OAAO,EACL,mEAAmE;QACrE,UAAU,EAAE,GAAG;KAChB;IACD,iBAAiB,EAAE;QACjB,OAAO,EAAE,qDAAqD;QAC9D,UAAU,EAAE,GAAG;KAChB;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,qDAAqD;QAC9D,UAAU,EAAE,GAAG;KAChB;IACD,sBAAsB,EAAE;QACtB,OAAO,EAAE,gDAAgD;QACzD,UAAU,EAAE,GAAG;KAChB;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OutputMode, ActionableError } from './types.js';
|
|
2
|
+
import { type ErrorCode } from './error-codes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Format an error based on output mode.
|
|
5
|
+
*
|
|
6
|
+
* - JSON mode: returns JSON string of {type:"error", code, message, ...actionableFields}
|
|
7
|
+
* - Human mode: returns chalk-colored readable string
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatError(error: unknown, mode: OutputMode, attempted?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Programmatically create an ActionableError with sensible defaults.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createActionableError(code: ErrorCode | string, message: string, attempted: string, overrides?: Partial<Pick<ActionableError, 'confidence' | 'nextCommand' | 'causes' | 'rootCause' | 'remediationPlan'>>): ActionableError;
|
|
14
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/cli/output/errors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAE/E,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAYhF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCxF;AA2HD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,GAAG,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,iBAAiB,CAAC,CAAC,GACpH,eAAe,CAejB"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Mode-aware error formatting — structured JSON for machines, chalk-colored text for humans
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { isActionableError } from './types.js';
|
|
5
|
+
import { ErrorCodes, ErrorRemediation } from './error-codes.js';
|
|
6
|
+
/**
|
|
7
|
+
* Format an error based on output mode.
|
|
8
|
+
*
|
|
9
|
+
* - JSON mode: returns JSON string of {type:"error", code, message, ...actionableFields}
|
|
10
|
+
* - Human mode: returns chalk-colored readable string
|
|
11
|
+
*/
|
|
12
|
+
export function formatError(error, mode, attempted) {
|
|
13
|
+
const normalized = normalizeError(error, attempted);
|
|
14
|
+
if (mode === 'json') {
|
|
15
|
+
const base = {
|
|
16
|
+
type: 'error',
|
|
17
|
+
code: normalized.code,
|
|
18
|
+
message: normalized.message,
|
|
19
|
+
...(normalized.remediation ? { remediation: normalized.remediation } : {}),
|
|
20
|
+
};
|
|
21
|
+
if (isActionableError(normalized)) {
|
|
22
|
+
const json = {
|
|
23
|
+
...base,
|
|
24
|
+
attempted: normalized.attempted,
|
|
25
|
+
rootCause: normalized.rootCause,
|
|
26
|
+
remediationPlan: normalized.remediationPlan,
|
|
27
|
+
confidence: normalized.confidence,
|
|
28
|
+
};
|
|
29
|
+
if (normalized.nextCommand)
|
|
30
|
+
json.nextCommand = normalized.nextCommand;
|
|
31
|
+
if (normalized.causes && normalized.causes.length > 0)
|
|
32
|
+
json.causes = normalized.causes;
|
|
33
|
+
return JSON.stringify(json);
|
|
34
|
+
}
|
|
35
|
+
return JSON.stringify(base);
|
|
36
|
+
}
|
|
37
|
+
// Human mode
|
|
38
|
+
let output = chalk.red('Error: ') + normalized.message;
|
|
39
|
+
if (normalized.code && normalized.code !== 'UNKNOWN') {
|
|
40
|
+
output = chalk.red('Error: ') + `[${normalized.code}] ${normalized.message}`;
|
|
41
|
+
}
|
|
42
|
+
output += '\n ' + chalk.cyan('Attempted: ') + normalized.attempted;
|
|
43
|
+
output += '\n ' + chalk.cyan('Root cause: ') + normalized.rootCause;
|
|
44
|
+
if (normalized.remediationPlan) {
|
|
45
|
+
const pct = Math.round(normalized.confidence * 100);
|
|
46
|
+
output += `\n ${chalk.yellow('Suggestion: ')}${normalized.remediationPlan} (${pct}% confidence)`;
|
|
47
|
+
}
|
|
48
|
+
if (normalized.nextCommand) {
|
|
49
|
+
output += '\n ' + chalk.green('Next: ') + normalized.nextCommand;
|
|
50
|
+
}
|
|
51
|
+
return output;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Normalize any thrown value into an ActionableError with auto-detected codes.
|
|
55
|
+
*/
|
|
56
|
+
function normalizeError(error, attempted) {
|
|
57
|
+
if (error instanceof Error) {
|
|
58
|
+
const err = error;
|
|
59
|
+
const detected = detectErrorPattern(err);
|
|
60
|
+
return {
|
|
61
|
+
type: 'error',
|
|
62
|
+
code: detected.code,
|
|
63
|
+
message: err.message,
|
|
64
|
+
name: 'ActionableError',
|
|
65
|
+
attempted: attempted ?? 'unknown operation',
|
|
66
|
+
rootCause: detectRootCause(err),
|
|
67
|
+
remediationPlan: detected.remediation.message,
|
|
68
|
+
confidence: detected.remediation.confidence,
|
|
69
|
+
nextCommand: detected.remediation.nextCommand,
|
|
70
|
+
remediation: detected.remediation.nextCommand ?? detected.remediation.message,
|
|
71
|
+
causes: extractCauses(err),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
type: 'error',
|
|
76
|
+
code: ErrorCodes.RUN_COMMAND_FAILED,
|
|
77
|
+
message: String(error),
|
|
78
|
+
name: 'ActionableError',
|
|
79
|
+
attempted: attempted ?? 'unknown operation',
|
|
80
|
+
rootCause: String(error),
|
|
81
|
+
remediationPlan: ErrorRemediation.RUN_COMMAND_FAILED.message,
|
|
82
|
+
confidence: 0.1,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Map Node.js error codes and patterns to our error code registry.
|
|
87
|
+
*/
|
|
88
|
+
function detectErrorPattern(err) {
|
|
89
|
+
const errCode = err.code ?? '';
|
|
90
|
+
const msg = err.message.toLowerCase();
|
|
91
|
+
// Node.js system error codes
|
|
92
|
+
if (errCode === 'MODULE_NOT_FOUND') {
|
|
93
|
+
return { code: ErrorCodes.DEP_MODULE_NOT_FOUND, remediation: ErrorRemediation.DEP_MODULE_NOT_FOUND };
|
|
94
|
+
}
|
|
95
|
+
if (errCode === 'EACCES' || errCode === 'EPERM') {
|
|
96
|
+
return { code: ErrorCodes.FS_PERMISSION_DENIED, remediation: ErrorRemediation.FS_PERMISSION_DENIED };
|
|
97
|
+
}
|
|
98
|
+
if (errCode === 'ENOENT') {
|
|
99
|
+
return { code: ErrorCodes.FS_FILE_NOT_FOUND, remediation: ErrorRemediation.FS_FILE_NOT_FOUND };
|
|
100
|
+
}
|
|
101
|
+
if (errCode && Object.values(ErrorCodes).includes(errCode)) {
|
|
102
|
+
const registryRemediation = ErrorRemediation[errCode] ?? { message: 'Check the error details and try again', confidence: 0.3 };
|
|
103
|
+
return {
|
|
104
|
+
code: errCode,
|
|
105
|
+
remediation: {
|
|
106
|
+
...registryRemediation,
|
|
107
|
+
...(err.remediation ? { message: err.remediation } : {}),
|
|
108
|
+
...(err.nextCommand ? { nextCommand: err.nextCommand } : {}),
|
|
109
|
+
...(typeof err.confidence === 'number' ? { confidence: err.confidence } : {}),
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// Preserve custom error codes from callers (e.g., MISSING_TARGET, INDEX_NOT_FOUND)
|
|
114
|
+
if (errCode && !Object.values(ErrorCodes).includes(errCode)) {
|
|
115
|
+
const customRemediation = err.remediation
|
|
116
|
+
? { message: err.remediation, confidence: 0.7 }
|
|
117
|
+
: { message: 'Check the error details and try again', confidence: 0.3 };
|
|
118
|
+
return { code: errCode, remediation: customRemediation };
|
|
119
|
+
}
|
|
120
|
+
// Content-based detection for native dependency failures
|
|
121
|
+
if (msg.includes('tree-sitter') || msg.includes('better-sqlite3')) {
|
|
122
|
+
return { code: ErrorCodes.DEP_NATIVE_MISSING, remediation: ErrorRemediation.DEP_NATIVE_MISSING };
|
|
123
|
+
}
|
|
124
|
+
if (msg.includes('config.json') || msg.includes('.mycodemap')) {
|
|
125
|
+
return { code: ErrorCodes.CFG_INVALID_CONFIG, remediation: ErrorRemediation.CFG_INVALID_CONFIG };
|
|
126
|
+
}
|
|
127
|
+
if (msg.includes('not initialized') || msg.includes('workspace not found')) {
|
|
128
|
+
return { code: ErrorCodes.CFG_WORKSPACE_NOT_INITIALIZED, remediation: ErrorRemediation.CFG_WORKSPACE_NOT_INITIALIZED };
|
|
129
|
+
}
|
|
130
|
+
return { code: ErrorCodes.RUN_COMMAND_FAILED, remediation: ErrorRemediation.RUN_COMMAND_FAILED };
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Extract the deepest root cause from an error message or cause chain.
|
|
134
|
+
*/
|
|
135
|
+
function detectRootCause(err) {
|
|
136
|
+
if (err.cause instanceof Error) {
|
|
137
|
+
return detectRootCause(err.cause);
|
|
138
|
+
}
|
|
139
|
+
return err.message;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Walk the error.cause chain and convert each to ActionableError.
|
|
143
|
+
*/
|
|
144
|
+
function extractCauses(err) {
|
|
145
|
+
const causes = [];
|
|
146
|
+
let current = err.cause;
|
|
147
|
+
while (current instanceof Error) {
|
|
148
|
+
const causeErr = current;
|
|
149
|
+
causes.push({
|
|
150
|
+
type: 'error',
|
|
151
|
+
code: causeErr.code ?? 'UNKNOWN',
|
|
152
|
+
message: causeErr.message,
|
|
153
|
+
name: 'ActionableError',
|
|
154
|
+
attempted: 'nested error',
|
|
155
|
+
rootCause: causeErr.message,
|
|
156
|
+
remediationPlan: '',
|
|
157
|
+
confidence: 0,
|
|
158
|
+
});
|
|
159
|
+
current = causeErr.cause;
|
|
160
|
+
}
|
|
161
|
+
return causes;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Programmatically create an ActionableError with sensible defaults.
|
|
165
|
+
*/
|
|
166
|
+
export function createActionableError(code, message, attempted, overrides) {
|
|
167
|
+
const remediation = ErrorRemediation[code] ?? { message: 'Check the error details', confidence: 0.3 };
|
|
168
|
+
return {
|
|
169
|
+
type: 'error',
|
|
170
|
+
code,
|
|
171
|
+
message,
|
|
172
|
+
name: 'ActionableError',
|
|
173
|
+
attempted,
|
|
174
|
+
rootCause: overrides?.rootCause ?? message,
|
|
175
|
+
remediationPlan: overrides?.remediationPlan ?? remediation.message,
|
|
176
|
+
confidence: overrides?.confidence ?? remediation.confidence,
|
|
177
|
+
nextCommand: overrides?.nextCommand ?? remediation.nextCommand,
|
|
178
|
+
remediation: overrides?.nextCommand ?? remediation.message,
|
|
179
|
+
...(overrides?.causes ? { causes: overrides.causes } : {}),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/cli/output/errors.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,kGAAkG;AAElG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAyC,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAkB,MAAM,kBAAkB,CAAC;AAYhF;;;;;G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,QAAQ,CAAC,IAAI,IAAI,SAAS;YAChC,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,IAAI,EAAE,iBAAiB;YACvB,SAAS,EAAE,cAAc;YACzB,SAAS,EAAE,QAAQ,CAAC,OAAO;YAC3B,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,CAAC;SACd,CAAC,CAAC;QACH,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAwB,EACxB,OAAe,EACf,SAAiB,EACjB,SAAqH;IAErH,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IACnH,OAAO;QACL,IAAI,EAAE,OAAO;QACb,IAAI;QACJ,OAAO;QACP,IAAI,EAAE,iBAAiB;QACvB,SAAS;QACT,SAAS,EAAE,SAAS,EAAE,SAAS,IAAI,OAAO;QAC1C,eAAe,EAAE,SAAS,EAAE,eAAe,IAAI,WAAW,CAAC,OAAO;QAClE,UAAU,EAAE,SAAS,EAAE,UAAU,IAAI,WAAW,CAAC,UAAU;QAC3D,WAAW,EAAE,SAAS,EAAE,WAAW,IAAI,WAAW,CAAC,WAAW;QAC9D,WAAW,EAAE,SAAS,EAAE,WAAW,IAAI,WAAW,CAAC,OAAO;QAC1D,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { resolveOutputMode } from './mode.js';
|
|
2
|
+
export { createProgressEmitter } from './progress.js';
|
|
3
|
+
export { formatError, createActionableError } from './errors.js';
|
|
4
|
+
export { renderOutput } from './render.js';
|
|
5
|
+
export type { OutputMode, OutputModeOptions, ProgressEmitter, StructuredError, ActionableError } from './types.js';
|
|
6
|
+
export { isActionableError, APPLY_SUGGESTION_CONFIDENCE_THRESHOLD } from './types.js';
|
|
7
|
+
export { ErrorCodes, ErrorRemediation } from './error-codes.js';
|
|
8
|
+
export type { ErrorCode } from './error-codes.js';
|
|
9
|
+
export { tryApplySuggestion } from './apply-suggestion.js';
|
|
10
|
+
export type { SuggestionResult } from './apply-suggestion.js';
|
|
11
|
+
export { checkAndActivateWasmFallback, createNativeDepError } from './wasm-fallback.js';
|
|
12
|
+
export type { WasmFallbackResult } from './wasm-fallback.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/output/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,qCAAqC,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxF,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Barrel exports for output mode module — single import point for all commands
|
|
3
|
+
export { resolveOutputMode } from './mode.js';
|
|
4
|
+
export { createProgressEmitter } from './progress.js';
|
|
5
|
+
export { formatError, createActionableError } from './errors.js';
|
|
6
|
+
export { renderOutput } from './render.js';
|
|
7
|
+
export { isActionableError, APPLY_SUGGESTION_CONFIDENCE_THRESHOLD } from './types.js';
|
|
8
|
+
export { ErrorCodes, ErrorRemediation } from './error-codes.js';
|
|
9
|
+
export { tryApplySuggestion } from './apply-suggestion.js';
|
|
10
|
+
export { checkAndActivateWasmFallback, createNativeDepError } from './wasm-fallback.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/output/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,qFAAqF;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,qCAAqC,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OutputMode, OutputModeOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve output mode from CLI flags and TTY state.
|
|
4
|
+
*
|
|
5
|
+
* Priority: --json wins over --human (explicit machine-readable takes priority).
|
|
6
|
+
* No flags: TTY auto-detect (human in terminal, json when piped).
|
|
7
|
+
*
|
|
8
|
+
* @param options - CLI flags { json?, human? }
|
|
9
|
+
* @param ttyOverride - Override for process.stdout.isTTY (useful in tests). Defaults to process.stdout.isTTY.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveOutputMode(options?: OutputModeOptions, ttyOverride?: boolean): OutputMode;
|
|
12
|
+
//# sourceMappingURL=mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../../src/cli/output/mode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEhE;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,iBAAsB,EAC/B,WAAW,CAAC,EAAE,OAAO,GACpB,UAAU,CAYZ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Unified TTY/flag detection — single source of truth for output mode resolution
|
|
3
|
+
/**
|
|
4
|
+
* Resolve output mode from CLI flags and TTY state.
|
|
5
|
+
*
|
|
6
|
+
* Priority: --json wins over --human (explicit machine-readable takes priority).
|
|
7
|
+
* No flags: TTY auto-detect (human in terminal, json when piped).
|
|
8
|
+
*
|
|
9
|
+
* @param options - CLI flags { json?, human? }
|
|
10
|
+
* @param ttyOverride - Override for process.stdout.isTTY (useful in tests). Defaults to process.stdout.isTTY.
|
|
11
|
+
*/
|
|
12
|
+
export function resolveOutputMode(options = {}, ttyOverride) {
|
|
13
|
+
if (options.json) {
|
|
14
|
+
return 'json';
|
|
15
|
+
}
|
|
16
|
+
if (options.human) {
|
|
17
|
+
return 'human';
|
|
18
|
+
}
|
|
19
|
+
// No explicit flag: auto-detect from TTY
|
|
20
|
+
const isTTY = ttyOverride ?? process.stdout.isTTY;
|
|
21
|
+
return isTTY ? 'human' : 'json';
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../../src/cli/output/mode.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,uFAAuF;AAIvF;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA6B,EAAE,EAC/B,WAAqB;IAErB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,yCAAyC;IACzC,MAAM,KAAK,GAAG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OutputMode, ProgressEmitter } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a progress emitter appropriate for the output mode.
|
|
4
|
+
*
|
|
5
|
+
* - JSON mode: writes NDJSON lines {type:"progress", percent, message} to stderr
|
|
6
|
+
* - Human mode: uses ora spinner on stderr (no stdout pollution)
|
|
7
|
+
*/
|
|
8
|
+
export declare function createProgressEmitter(mode: OutputMode, prefix?: string): ProgressEmitter;
|
|
9
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/cli/output/progress.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,UAAU,EAChB,MAAM,CAAC,EAAE,MAAM,GACd,eAAe,CAKjB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Progress emitter abstraction — NDJSON to stderr in JSON mode, ora spinner in human mode
|
|
3
|
+
import ora from 'ora';
|
|
4
|
+
/**
|
|
5
|
+
* Create a progress emitter appropriate for the output mode.
|
|
6
|
+
*
|
|
7
|
+
* - JSON mode: writes NDJSON lines {type:"progress", percent, message} to stderr
|
|
8
|
+
* - Human mode: uses ora spinner on stderr (no stdout pollution)
|
|
9
|
+
*/
|
|
10
|
+
export function createProgressEmitter(mode, prefix) {
|
|
11
|
+
if (mode === 'json') {
|
|
12
|
+
return createJsonProgressEmitter();
|
|
13
|
+
}
|
|
14
|
+
return createHumanProgressEmitter(prefix);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* JSON mode: structured NDJSON progress on stderr
|
|
18
|
+
*/
|
|
19
|
+
function createJsonProgressEmitter() {
|
|
20
|
+
let lastPercent = -1;
|
|
21
|
+
return {
|
|
22
|
+
update(percent, message) {
|
|
23
|
+
// Rate-limit: only emit when percent changes by >= 5 or message changes
|
|
24
|
+
if (Math.abs(percent - lastPercent) < 5 && lastPercent >= 0) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
lastPercent = percent;
|
|
28
|
+
const line = JSON.stringify({ type: 'progress', percent, message });
|
|
29
|
+
process.stderr.write(line + '\n');
|
|
30
|
+
},
|
|
31
|
+
complete() {
|
|
32
|
+
const line = JSON.stringify({ type: 'progress', percent: 100, message: 'complete' });
|
|
33
|
+
process.stderr.write(line + '\n');
|
|
34
|
+
},
|
|
35
|
+
fail(message) {
|
|
36
|
+
const line = JSON.stringify({ type: 'progress', percent: -1, message: message ?? 'failed' });
|
|
37
|
+
process.stderr.write(line + '\n');
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Human mode: ora spinner on stderr
|
|
43
|
+
*/
|
|
44
|
+
function createHumanProgressEmitter(prefix) {
|
|
45
|
+
const spinner = ora({ spinner: 'dots', prefixText: prefix });
|
|
46
|
+
return {
|
|
47
|
+
update(_percent, message) {
|
|
48
|
+
if (!spinner.isSpinning) {
|
|
49
|
+
spinner.start();
|
|
50
|
+
}
|
|
51
|
+
spinner.text = message;
|
|
52
|
+
},
|
|
53
|
+
complete() {
|
|
54
|
+
if (spinner.isSpinning) {
|
|
55
|
+
spinner.succeed();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
fail(message) {
|
|
59
|
+
if (spinner.isSpinning) {
|
|
60
|
+
spinner.fail(message);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/cli/output/progress.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,gGAAgG;AAEhG,OAAO,GAAG,MAAM,KAAK,CAAC;AAGtB;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAgB,EAChB,MAAe;IAEf,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,yBAAyB,EAAE,CAAC;IACrC,CAAC;IACD,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB;IAChC,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC;IAErB,OAAO;QACL,MAAM,CAAC,OAAe,EAAE,OAAe;YACrC,wEAAwE;YACxE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;gBAC5D,OAAO;YACT,CAAC;YACD,WAAW,GAAG,OAAO,CAA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AAU,EAAE,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OutputMode } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Render data to stdout based on output mode.
|
|
4
|
+
*
|
|
5
|
+
* - JSON mode: writes JSON.stringify(data) + newline to stdout
|
|
6
|
+
* - Human mode: writes humanRenderer(data) + newline to stdout
|
|
7
|
+
*
|
|
8
|
+
* Uses process.stdout.write (not console.log) for predictable output formatting.
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderOutput<T>(data: T, humanRenderer: (data: T) => string, mode: OutputMode): void;
|
|
11
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/cli/output/render.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAClC,IAAI,EAAE,UAAU,GACf,IAAI,CAON"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// [META] since:2026-04-30 | owner:cli-team | stable:false
|
|
2
|
+
// [WHY] Mode-aware stdout writer — JSON.stringify in json mode, human renderer in human mode
|
|
3
|
+
/**
|
|
4
|
+
* Render data to stdout based on output mode.
|
|
5
|
+
*
|
|
6
|
+
* - JSON mode: writes JSON.stringify(data) + newline to stdout
|
|
7
|
+
* - Human mode: writes humanRenderer(data) + newline to stdout
|
|
8
|
+
*
|
|
9
|
+
* Uses process.stdout.write (not console.log) for predictable output formatting.
|
|
10
|
+
*/
|
|
11
|
+
export function renderOutput(data, humanRenderer, mode) {
|
|
12
|
+
if (mode === 'json') {
|
|
13
|
+
process.stdout.write(JSON.stringify(data) + '\n');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
process.stdout.write(humanRenderer(data) + '\n');
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../src/cli/output/render.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,6FAA6F;AAI7F;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAO,EACP,aAAkC,EAClC,IAAgB;IAEhB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAClD,OAAO;IACT,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output mode: 'json' for non-TTY/CI/piped consumers, 'human' for interactive terminals
|
|
3
|
+
*/
|
|
4
|
+
export type OutputMode = 'json' | 'human';
|
|
5
|
+
/**
|
|
6
|
+
* Options passed from CLI flags to resolveOutputMode
|
|
7
|
+
*/
|
|
8
|
+
export interface OutputModeOptions {
|
|
9
|
+
json?: boolean;
|
|
10
|
+
human?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Structured progress emitter — abstracts away NDJSON-vs-spinner differences
|
|
14
|
+
*/
|
|
15
|
+
export interface ProgressEmitter {
|
|
16
|
+
update(percent: number, message: string): void;
|
|
17
|
+
complete(): void;
|
|
18
|
+
fail(message?: string): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Structured error shape for JSON mode output
|
|
22
|
+
*/
|
|
23
|
+
export interface StructuredError {
|
|
24
|
+
type: 'error';
|
|
25
|
+
code: string;
|
|
26
|
+
message: string;
|
|
27
|
+
remediation?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Actionable error with recovery context — extends StructuredError
|
|
31
|
+
* with fields that enable automated or guided remediation.
|
|
32
|
+
*/
|
|
33
|
+
export interface ActionableError extends StructuredError {
|
|
34
|
+
type: 'error';
|
|
35
|
+
code: string;
|
|
36
|
+
name: string;
|
|
37
|
+
attempted: string;
|
|
38
|
+
rootCause: string;
|
|
39
|
+
remediationPlan: string;
|
|
40
|
+
confidence: number;
|
|
41
|
+
nextCommand?: string;
|
|
42
|
+
causes?: ActionableError[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Type guard: checks if an error has actionable recovery fields
|
|
46
|
+
*/
|
|
47
|
+
export declare function isActionableError(error: StructuredError | ActionableError): error is ActionableError;
|
|
48
|
+
/**
|
|
49
|
+
* Confidence threshold for --apply-suggestion auto-execution.
|
|
50
|
+
* Suggestions below this threshold are not auto-executed.
|
|
51
|
+
*/
|
|
52
|
+
export declare const APPLY_SUGGESTION_CONFIDENCE_THRESHOLD = 0.8;
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|