@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.
Files changed (527) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +63 -978
  3. package/README.zh-CN.md +1096 -0
  4. package/dist/cli/commands/agent-metrics/human.d.ts +4 -0
  5. package/dist/cli/commands/agent-metrics/human.d.ts.map +1 -0
  6. package/dist/cli/commands/agent-metrics/human.js +134 -0
  7. package/dist/cli/commands/agent-metrics/human.js.map +1 -0
  8. package/dist/cli/commands/agent-metrics/index.d.ts +15 -0
  9. package/dist/cli/commands/agent-metrics/index.d.ts.map +1 -0
  10. package/dist/cli/commands/agent-metrics/index.js +116 -0
  11. package/dist/cli/commands/agent-metrics/index.js.map +1 -0
  12. package/dist/cli/commands/analyze-options.d.ts.map +1 -1
  13. package/dist/cli/commands/analyze-options.js +8 -0
  14. package/dist/cli/commands/analyze-options.js.map +1 -1
  15. package/dist/cli/commands/analyze.d.ts +3 -196
  16. package/dist/cli/commands/analyze.d.ts.map +1 -1
  17. package/dist/cli/commands/analyze.js +27 -1162
  18. package/dist/cli/commands/analyze.js.map +1 -1
  19. package/dist/cli/commands/benchmark.d.ts +8 -0
  20. package/dist/cli/commands/benchmark.d.ts.map +1 -0
  21. package/dist/cli/commands/benchmark.js +153 -0
  22. package/dist/cli/commands/benchmark.js.map +1 -0
  23. package/dist/cli/commands/complexity.d.ts.map +1 -1
  24. package/dist/cli/commands/complexity.js +62 -95
  25. package/dist/cli/commands/complexity.js.map +1 -1
  26. package/dist/cli/commands/deps.d.ts +3 -59
  27. package/dist/cli/commands/deps.d.ts.map +1 -1
  28. package/dist/cli/commands/deps.js +25 -331
  29. package/dist/cli/commands/deps.js.map +1 -1
  30. package/dist/cli/commands/doctor.d.ts +3 -0
  31. package/dist/cli/commands/doctor.d.ts.map +1 -0
  32. package/dist/cli/commands/doctor.js +34 -0
  33. package/dist/cli/commands/doctor.js.map +1 -0
  34. package/dist/cli/commands/env-contract.d.ts +3 -0
  35. package/dist/cli/commands/env-contract.d.ts.map +1 -0
  36. package/dist/cli/commands/env-contract.js +221 -0
  37. package/dist/cli/commands/env-contract.js.map +1 -0
  38. package/dist/cli/commands/generate.d.ts +19 -1
  39. package/dist/cli/commands/generate.d.ts.map +1 -1
  40. package/dist/cli/commands/generate.js +735 -89
  41. package/dist/cli/commands/generate.js.map +1 -1
  42. package/dist/cli/commands/impact.d.ts +4 -38
  43. package/dist/cli/commands/impact.d.ts.map +1 -1
  44. package/dist/cli/commands/impact.js +133 -375
  45. package/dist/cli/commands/impact.js.map +1 -1
  46. package/dist/cli/commands/init.d.ts +1 -0
  47. package/dist/cli/commands/init.d.ts.map +1 -1
  48. package/dist/cli/commands/init.js +61 -2
  49. package/dist/cli/commands/init.js.map +1 -1
  50. package/dist/cli/commands/preview.d.ts +3 -0
  51. package/dist/cli/commands/preview.d.ts.map +1 -0
  52. package/dist/cli/commands/preview.js +216 -0
  53. package/dist/cli/commands/preview.js.map +1 -0
  54. package/dist/cli/commands/query.d.ts +2 -20
  55. package/dist/cli/commands/query.d.ts.map +1 -1
  56. package/dist/cli/commands/query.js +23 -708
  57. package/dist/cli/commands/query.js.map +1 -1
  58. package/dist/cli/commands/watch-foreground.d.ts.map +1 -1
  59. package/dist/cli/commands/watch-foreground.js +5 -1
  60. package/dist/cli/commands/watch-foreground.js.map +1 -1
  61. package/dist/cli/config-loader.d.ts.map +1 -1
  62. package/dist/cli/config-loader.js +51 -13
  63. package/dist/cli/config-loader.js.map +1 -1
  64. package/dist/cli/doctor/check-agent.d.ts +3 -0
  65. package/dist/cli/doctor/check-agent.d.ts.map +1 -0
  66. package/dist/cli/doctor/check-agent.js +60 -0
  67. package/dist/cli/doctor/check-agent.js.map +1 -0
  68. package/dist/cli/doctor/check-env-contract.d.ts +3 -0
  69. package/dist/cli/doctor/check-env-contract.d.ts.map +1 -0
  70. package/dist/cli/doctor/check-env-contract.js +96 -0
  71. package/dist/cli/doctor/check-env-contract.js.map +1 -0
  72. package/dist/cli/doctor/check-ghost-commands.d.ts +3 -0
  73. package/dist/cli/doctor/check-ghost-commands.d.ts.map +1 -0
  74. package/dist/cli/doctor/check-ghost-commands.js +86 -0
  75. package/dist/cli/doctor/check-ghost-commands.js.map +1 -0
  76. package/dist/cli/doctor/check-native-deps.d.ts +3 -0
  77. package/dist/cli/doctor/check-native-deps.d.ts.map +1 -0
  78. package/dist/cli/doctor/check-native-deps.js +70 -0
  79. package/dist/cli/doctor/check-native-deps.js.map +1 -0
  80. package/dist/cli/doctor/check-workspace-drift.d.ts +3 -0
  81. package/dist/cli/doctor/check-workspace-drift.d.ts.map +1 -0
  82. package/dist/cli/doctor/check-workspace-drift.js +83 -0
  83. package/dist/cli/doctor/check-workspace-drift.js.map +1 -0
  84. package/dist/cli/doctor/formatter.d.ts +20 -0
  85. package/dist/cli/doctor/formatter.d.ts.map +1 -0
  86. package/dist/cli/doctor/formatter.js +91 -0
  87. package/dist/cli/doctor/formatter.js.map +1 -0
  88. package/dist/cli/doctor/index.d.ts +8 -0
  89. package/dist/cli/doctor/index.d.ts.map +1 -0
  90. package/dist/cli/doctor/index.js +9 -0
  91. package/dist/cli/doctor/index.js.map +1 -0
  92. package/dist/cli/doctor/orchestrator.d.ts +3 -0
  93. package/dist/cli/doctor/orchestrator.d.ts.map +1 -0
  94. package/dist/cli/doctor/orchestrator.js +40 -0
  95. package/dist/cli/doctor/orchestrator.js.map +1 -0
  96. package/dist/cli/doctor/types.d.ts +19 -0
  97. package/dist/cli/doctor/types.d.ts.map +1 -0
  98. package/dist/cli/doctor/types.js +4 -0
  99. package/dist/cli/doctor/types.js.map +1 -0
  100. package/dist/cli/env-contract/check.d.ts +18 -0
  101. package/dist/cli/env-contract/check.d.ts.map +1 -0
  102. package/dist/cli/env-contract/check.js +118 -0
  103. package/dist/cli/env-contract/check.js.map +1 -0
  104. package/dist/cli/env-contract/discovery.d.ts +12 -0
  105. package/dist/cli/env-contract/discovery.d.ts.map +1 -0
  106. package/dist/cli/env-contract/discovery.js +249 -0
  107. package/dist/cli/env-contract/discovery.js.map +1 -0
  108. package/dist/cli/env-contract/filters.d.ts +10 -0
  109. package/dist/cli/env-contract/filters.d.ts.map +1 -0
  110. package/dist/cli/env-contract/filters.js +23 -0
  111. package/dist/cli/env-contract/filters.js.map +1 -0
  112. package/dist/cli/env-contract/index.d.ts +6 -0
  113. package/dist/cli/env-contract/index.d.ts.map +1 -0
  114. package/dist/cli/env-contract/index.js +8 -0
  115. package/dist/cli/env-contract/index.js.map +1 -0
  116. package/dist/cli/env-contract/reminder-engine.d.ts +34 -0
  117. package/dist/cli/env-contract/reminder-engine.d.ts.map +1 -0
  118. package/dist/cli/env-contract/reminder-engine.js +51 -0
  119. package/dist/cli/env-contract/reminder-engine.js.map +1 -0
  120. package/dist/cli/env-contract/reminder-hook-runner.d.ts +45 -0
  121. package/dist/cli/env-contract/reminder-hook-runner.d.ts.map +1 -0
  122. package/dist/cli/env-contract/reminder-hook-runner.js +273 -0
  123. package/dist/cli/env-contract/reminder-hook-runner.js.map +1 -0
  124. package/dist/cli/env-contract/reminder-ledger.d.ts +11 -0
  125. package/dist/cli/env-contract/reminder-ledger.d.ts.map +1 -0
  126. package/dist/cli/env-contract/reminder-ledger.js +37 -0
  127. package/dist/cli/env-contract/reminder-ledger.js.map +1 -0
  128. package/dist/cli/env-contract/types.d.ts +48 -0
  129. package/dist/cli/env-contract/types.d.ts.map +1 -0
  130. package/dist/cli/env-contract/types.js +22 -0
  131. package/dist/cli/env-contract/types.js.map +1 -0
  132. package/dist/cli/env-contract/validation.d.ts +10 -0
  133. package/dist/cli/env-contract/validation.d.ts.map +1 -0
  134. package/dist/cli/env-contract/validation.js +116 -0
  135. package/dist/cli/env-contract/validation.js.map +1 -0
  136. package/dist/cli/first-run-guide.d.ts.map +1 -1
  137. package/dist/cli/first-run-guide.js +8 -3
  138. package/dist/cli/first-run-guide.js.map +1 -1
  139. package/dist/cli/index.js +94 -22
  140. package/dist/cli/index.js.map +1 -1
  141. package/dist/cli/init/assistant-plan.d.ts +14 -0
  142. package/dist/cli/init/assistant-plan.d.ts.map +1 -0
  143. package/dist/cli/init/assistant-plan.js +208 -0
  144. package/dist/cli/init/assistant-plan.js.map +1 -0
  145. package/dist/cli/init/detect.d.ts +28 -0
  146. package/dist/cli/init/detect.d.ts.map +1 -0
  147. package/dist/cli/init/detect.js +63 -0
  148. package/dist/cli/init/detect.js.map +1 -0
  149. package/dist/cli/init/env-contract-plan.d.ts +28 -0
  150. package/dist/cli/init/env-contract-plan.d.ts.map +1 -0
  151. package/dist/cli/init/env-contract-plan.js +184 -0
  152. package/dist/cli/init/env-contract-plan.js.map +1 -0
  153. package/dist/cli/init/manifest-extractors.d.ts +22 -0
  154. package/dist/cli/init/manifest-extractors.d.ts.map +1 -0
  155. package/dist/cli/init/manifest-extractors.js +185 -0
  156. package/dist/cli/init/manifest-extractors.js.map +1 -0
  157. package/dist/cli/init/profile-loader.d.ts +49 -0
  158. package/dist/cli/init/profile-loader.d.ts.map +1 -0
  159. package/dist/cli/init/profile-loader.js +107 -0
  160. package/dist/cli/init/profile-loader.js.map +1 -0
  161. package/dist/cli/init/profile-plan.d.ts +38 -0
  162. package/dist/cli/init/profile-plan.d.ts.map +1 -0
  163. package/dist/cli/init/profile-plan.js +120 -0
  164. package/dist/cli/init/profile-plan.js.map +1 -0
  165. package/dist/cli/init/profiles/generic.json +16 -0
  166. package/dist/cli/init/profiles/go.json +12 -0
  167. package/dist/cli/init/profiles/nodejs.json +16 -0
  168. package/dist/cli/init/profiles/python.json +17 -0
  169. package/dist/cli/init/profiles/rust.json +12 -0
  170. package/dist/cli/init/receipt.d.ts.map +1 -1
  171. package/dist/cli/init/receipt.js +107 -7
  172. package/dist/cli/init/receipt.js.map +1 -1
  173. package/dist/cli/init/reconciler.d.ts +10 -1
  174. package/dist/cli/init/reconciler.d.ts.map +1 -1
  175. package/dist/cli/init/reconciler.js +85 -15
  176. package/dist/cli/init/reconciler.js.map +1 -1
  177. package/dist/cli/interface-contract/commands/agent-metrics.d.ts +3 -0
  178. package/dist/cli/interface-contract/commands/agent-metrics.d.ts.map +1 -0
  179. package/dist/cli/interface-contract/commands/agent-metrics.js +217 -0
  180. package/dist/cli/interface-contract/commands/agent-metrics.js.map +1 -0
  181. package/dist/cli/interface-contract/commands/analyze.d.ts +3 -0
  182. package/dist/cli/interface-contract/commands/analyze.d.ts.map +1 -0
  183. package/dist/cli/interface-contract/commands/analyze.js +139 -0
  184. package/dist/cli/interface-contract/commands/analyze.js.map +1 -0
  185. package/dist/cli/interface-contract/commands/benchmark.d.ts +3 -0
  186. package/dist/cli/interface-contract/commands/benchmark.d.ts.map +1 -0
  187. package/dist/cli/interface-contract/commands/benchmark.js +108 -0
  188. package/dist/cli/interface-contract/commands/benchmark.js.map +1 -0
  189. package/dist/cli/interface-contract/commands/deps.d.ts +3 -0
  190. package/dist/cli/interface-contract/commands/deps.d.ts.map +1 -0
  191. package/dist/cli/interface-contract/commands/deps.js +130 -0
  192. package/dist/cli/interface-contract/commands/deps.js.map +1 -0
  193. package/dist/cli/interface-contract/commands/doctor.d.ts +3 -0
  194. package/dist/cli/interface-contract/commands/doctor.d.ts.map +1 -0
  195. package/dist/cli/interface-contract/commands/doctor.js +60 -0
  196. package/dist/cli/interface-contract/commands/doctor.js.map +1 -0
  197. package/dist/cli/interface-contract/commands/env-contract.d.ts +3 -0
  198. package/dist/cli/interface-contract/commands/env-contract.d.ts.map +1 -0
  199. package/dist/cli/interface-contract/commands/env-contract.js +168 -0
  200. package/dist/cli/interface-contract/commands/env-contract.js.map +1 -0
  201. package/dist/cli/interface-contract/commands/index.d.ts +12 -0
  202. package/dist/cli/interface-contract/commands/index.d.ts.map +1 -0
  203. package/dist/cli/interface-contract/commands/index.js +24 -0
  204. package/dist/cli/interface-contract/commands/index.js.map +1 -0
  205. package/dist/cli/interface-contract/commands/init.d.ts +3 -0
  206. package/dist/cli/interface-contract/commands/init.d.ts.map +1 -0
  207. package/dist/cli/interface-contract/commands/init.js +96 -0
  208. package/dist/cli/interface-contract/commands/init.js.map +1 -0
  209. package/dist/cli/interface-contract/commands/preview.d.ts +3 -0
  210. package/dist/cli/interface-contract/commands/preview.d.ts.map +1 -0
  211. package/dist/cli/interface-contract/commands/preview.js +118 -0
  212. package/dist/cli/interface-contract/commands/preview.js.map +1 -0
  213. package/dist/cli/interface-contract/commands/query.d.ts +3 -0
  214. package/dist/cli/interface-contract/commands/query.d.ts.map +1 -0
  215. package/dist/cli/interface-contract/commands/query.js +186 -0
  216. package/dist/cli/interface-contract/commands/query.js.map +1 -0
  217. package/dist/cli/interface-contract/index.d.ts +22 -0
  218. package/dist/cli/interface-contract/index.d.ts.map +1 -0
  219. package/dist/cli/interface-contract/index.js +41 -0
  220. package/dist/cli/interface-contract/index.js.map +1 -0
  221. package/dist/cli/interface-contract/schema.d.ts +30 -0
  222. package/dist/cli/interface-contract/schema.d.ts.map +1 -0
  223. package/dist/cli/interface-contract/schema.js +73 -0
  224. package/dist/cli/interface-contract/schema.js.map +1 -0
  225. package/dist/cli/interface-contract/types.d.ts +77 -0
  226. package/dist/cli/interface-contract/types.d.ts.map +1 -0
  227. package/dist/cli/interface-contract/types.js +4 -0
  228. package/dist/cli/interface-contract/types.js.map +1 -0
  229. package/dist/cli/output/apply-suggestion.d.ts +12 -0
  230. package/dist/cli/output/apply-suggestion.d.ts.map +1 -0
  231. package/dist/cli/output/apply-suggestion.js +29 -0
  232. package/dist/cli/output/apply-suggestion.js.map +1 -0
  233. package/dist/cli/output/error-codes.d.ts +24 -0
  234. package/dist/cli/output/error-codes.d.ts.map +1 -0
  235. package/dist/cli/output/error-codes.js +94 -0
  236. package/dist/cli/output/error-codes.js.map +1 -0
  237. package/dist/cli/output/errors.d.ts +14 -0
  238. package/dist/cli/output/errors.d.ts.map +1 -0
  239. package/dist/cli/output/errors.js +182 -0
  240. package/dist/cli/output/errors.js.map +1 -0
  241. package/dist/cli/output/index.d.ts +13 -0
  242. package/dist/cli/output/index.d.ts.map +1 -0
  243. package/dist/cli/output/index.js +11 -0
  244. package/dist/cli/output/index.js.map +1 -0
  245. package/dist/cli/output/mode.d.ts +12 -0
  246. package/dist/cli/output/mode.d.ts.map +1 -0
  247. package/dist/cli/output/mode.js +23 -0
  248. package/dist/cli/output/mode.js.map +1 -0
  249. package/dist/cli/output/progress.d.ts +9 -0
  250. package/dist/cli/output/progress.d.ts.map +1 -0
  251. package/dist/cli/output/progress.js +65 -0
  252. package/dist/cli/output/progress.js.map +1 -0
  253. package/dist/cli/output/render.d.ts +11 -0
  254. package/dist/cli/output/render.d.ts.map +1 -0
  255. package/dist/cli/output/render.js +18 -0
  256. package/dist/cli/output/render.js.map +1 -0
  257. package/dist/cli/output/types.d.ts +53 -0
  258. package/dist/cli/output/types.d.ts.map +1 -0
  259. package/dist/cli/output/types.js +14 -0
  260. package/dist/cli/output/types.js.map +1 -0
  261. package/dist/cli/output/wasm-fallback.d.ts +14 -0
  262. package/dist/cli/output/wasm-fallback.d.ts.map +1 -0
  263. package/dist/cli/output/wasm-fallback.js +92 -0
  264. package/dist/cli/output/wasm-fallback.js.map +1 -0
  265. package/dist/cli/preview/complexity-scanner.d.ts +21 -0
  266. package/dist/cli/preview/complexity-scanner.d.ts.map +1 -0
  267. package/dist/cli/preview/complexity-scanner.js +52 -0
  268. package/dist/cli/preview/complexity-scanner.js.map +1 -0
  269. package/dist/cli/preview/dependency-extractor.d.ts +38 -0
  270. package/dist/cli/preview/dependency-extractor.d.ts.map +1 -0
  271. package/dist/cli/preview/dependency-extractor.js +140 -0
  272. package/dist/cli/preview/dependency-extractor.js.map +1 -0
  273. package/dist/cli/preview/preview-renderer.d.ts +32 -0
  274. package/dist/cli/preview/preview-renderer.d.ts.map +1 -0
  275. package/dist/cli/preview/preview-renderer.js +54 -0
  276. package/dist/cli/preview/preview-renderer.js.map +1 -0
  277. package/dist/cli/storage-runtime.d.ts +7 -0
  278. package/dist/cli/storage-runtime.d.ts.map +1 -1
  279. package/dist/cli/storage-runtime.js +22 -0
  280. package/dist/cli/storage-runtime.js.map +1 -1
  281. package/dist/cli/tree-sitter-check.d.ts +6 -1
  282. package/dist/cli/tree-sitter-check.d.ts.map +1 -1
  283. package/dist/cli/tree-sitter-check.js +23 -1
  284. package/dist/cli/tree-sitter-check.js.map +1 -1
  285. package/dist/cli-new/index.js +1 -1
  286. package/dist/cli-new/index.js.map +1 -1
  287. package/dist/composition/parser-composition.d.ts +7 -0
  288. package/dist/composition/parser-composition.d.ts.map +1 -0
  289. package/dist/composition/parser-composition.js +15 -0
  290. package/dist/composition/parser-composition.js.map +1 -0
  291. package/dist/core/analyzer.d.ts.map +1 -1
  292. package/dist/core/analyzer.js +83 -67
  293. package/dist/core/analyzer.js.map +1 -1
  294. package/dist/core/ast-complexity-analyzer.d.ts +12 -6
  295. package/dist/core/ast-complexity-analyzer.d.ts.map +1 -1
  296. package/dist/core/ast-complexity-analyzer.js +368 -209
  297. package/dist/core/ast-complexity-analyzer.js.map +1 -1
  298. package/dist/core/file-discovery.d.ts +1 -1
  299. package/dist/core/file-discovery.d.ts.map +1 -1
  300. package/dist/core/file-discovery.js +3 -0
  301. package/dist/core/file-discovery.js.map +1 -1
  302. package/dist/core/global-index.d.ts +3 -1
  303. package/dist/core/global-index.d.ts.map +1 -1
  304. package/dist/core/global-index.js +69 -4
  305. package/dist/core/global-index.js.map +1 -1
  306. package/dist/domain/entities/CodeGraph.d.ts +3 -0
  307. package/dist/domain/entities/CodeGraph.d.ts.map +1 -1
  308. package/dist/domain/entities/CodeGraph.js +19 -2
  309. package/dist/domain/entities/CodeGraph.js.map +1 -1
  310. package/dist/domain/entities/Dependency.d.ts +5 -2
  311. package/dist/domain/entities/Dependency.d.ts.map +1 -1
  312. package/dist/domain/entities/Dependency.js +49 -3
  313. package/dist/domain/entities/Dependency.js.map +1 -1
  314. package/dist/domain/repositories/CodeGraphRepository.d.ts +5 -0
  315. package/dist/domain/repositories/CodeGraphRepository.d.ts.map +1 -1
  316. package/dist/domain/repositories/CodeGraphRepository.js.map +1 -1
  317. package/dist/execution/contract-tools/analyze.d.ts +205 -0
  318. package/dist/execution/contract-tools/analyze.d.ts.map +1 -0
  319. package/dist/execution/contract-tools/analyze.js +1215 -0
  320. package/dist/execution/contract-tools/analyze.js.map +1 -0
  321. package/dist/execution/contract-tools/deps.d.ts +62 -0
  322. package/dist/execution/contract-tools/deps.d.ts.map +1 -0
  323. package/dist/execution/contract-tools/deps.js +234 -0
  324. package/dist/execution/contract-tools/deps.js.map +1 -0
  325. package/dist/execution/contract-tools/index.d.ts +5 -0
  326. package/dist/execution/contract-tools/index.d.ts.map +1 -0
  327. package/dist/execution/contract-tools/index.js +7 -0
  328. package/dist/execution/contract-tools/index.js.map +1 -0
  329. package/dist/execution/contract-tools/query.d.ts +60 -0
  330. package/dist/execution/contract-tools/query.d.ts.map +1 -0
  331. package/dist/execution/contract-tools/query.js +532 -0
  332. package/dist/execution/contract-tools/query.js.map +1 -0
  333. package/dist/execution/contract-tools/types.d.ts +26 -0
  334. package/dist/execution/contract-tools/types.d.ts.map +1 -0
  335. package/dist/execution/contract-tools/types.js +32 -0
  336. package/dist/execution/contract-tools/types.js.map +1 -0
  337. package/dist/generator/index.d.ts.map +1 -1
  338. package/dist/generator/index.js +0 -3
  339. package/dist/generator/index.js.map +1 -1
  340. package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.d.ts +12 -0
  341. package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.d.ts.map +1 -0
  342. package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.js +55 -0
  343. package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.js.map +1 -0
  344. package/dist/infrastructure/parser/implementations/GoParser.d.ts +2 -1
  345. package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -1
  346. package/dist/infrastructure/parser/implementations/GoParser.js +13 -1
  347. package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -1
  348. package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.d.ts +114 -0
  349. package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.d.ts.map +1 -0
  350. package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.js +1022 -0
  351. package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.js.map +1 -0
  352. package/dist/infrastructure/parser/implementations/TreeSitterParser.d.ts +78 -0
  353. package/dist/infrastructure/parser/implementations/TreeSitterParser.d.ts.map +1 -0
  354. package/dist/infrastructure/parser/implementations/TreeSitterParser.js +648 -0
  355. package/dist/infrastructure/parser/implementations/TreeSitterParser.js.map +1 -0
  356. package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +3 -55
  357. package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -1
  358. package/dist/infrastructure/parser/implementations/TypeScriptParser.js +4 -411
  359. package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -1
  360. package/dist/infrastructure/parser/index.d.ts +2 -0
  361. package/dist/infrastructure/parser/index.d.ts.map +1 -1
  362. package/dist/infrastructure/parser/index.js +9 -6
  363. package/dist/infrastructure/parser/index.js.map +1 -1
  364. package/dist/infrastructure/parser/interfaces/ParserBase.d.ts.map +1 -1
  365. package/dist/infrastructure/parser/interfaces/ParserBase.js +1 -0
  366. package/dist/infrastructure/parser/interfaces/ParserBase.js.map +1 -1
  367. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts +2 -0
  368. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts.map +1 -1
  369. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js +4 -0
  370. package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js.map +1 -1
  371. package/dist/infrastructure/storage/StorageFactory.d.ts +5 -18
  372. package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -1
  373. package/dist/infrastructure/storage/StorageFactory.js +30 -98
  374. package/dist/infrastructure/storage/StorageFactory.js.map +1 -1
  375. package/dist/infrastructure/storage/adapters/SQLiteStorage.d.ts +13 -1
  376. package/dist/infrastructure/storage/adapters/SQLiteStorage.d.ts.map +1 -1
  377. package/dist/infrastructure/storage/adapters/SQLiteStorage.js +322 -76
  378. package/dist/infrastructure/storage/adapters/SQLiteStorage.js.map +1 -1
  379. package/dist/infrastructure/storage/adapters/sqlite-loader.d.ts +45 -0
  380. package/dist/infrastructure/storage/adapters/sqlite-loader.d.ts.map +1 -0
  381. package/dist/infrastructure/storage/adapters/sqlite-loader.js +266 -0
  382. package/dist/infrastructure/storage/adapters/sqlite-loader.js.map +1 -0
  383. package/dist/infrastructure/storage/community-helpers.d.ts +4 -0
  384. package/dist/infrastructure/storage/community-helpers.d.ts.map +1 -0
  385. package/dist/infrastructure/storage/community-helpers.js +392 -0
  386. package/dist/infrastructure/storage/community-helpers.js.map +1 -0
  387. package/dist/infrastructure/storage/graph-helpers.d.ts +22 -5
  388. package/dist/infrastructure/storage/graph-helpers.d.ts.map +1 -1
  389. package/dist/infrastructure/storage/graph-helpers.js +496 -91
  390. package/dist/infrastructure/storage/graph-helpers.js.map +1 -1
  391. package/dist/infrastructure/storage/index.d.ts +1 -1
  392. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  393. package/dist/infrastructure/storage/index.js +1 -1
  394. package/dist/infrastructure/storage/index.js.map +1 -1
  395. package/dist/infrastructure/storage/interfaces/StorageBase.d.ts +2 -2
  396. package/dist/infrastructure/storage/interfaces/StorageBase.d.ts.map +1 -1
  397. package/dist/infrastructure/storage/interfaces/StorageBase.js.map +1 -1
  398. package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.d.ts +2 -0
  399. package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.d.ts.map +1 -1
  400. package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.js +52 -12
  401. package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.js.map +1 -1
  402. package/dist/infrastructure/storage/sqlite/schema.d.ts +2 -2
  403. package/dist/infrastructure/storage/sqlite/schema.d.ts.map +1 -1
  404. package/dist/infrastructure/storage/sqlite/schema.js +49 -1
  405. package/dist/infrastructure/storage/sqlite/schema.js.map +1 -1
  406. package/dist/interface/config/index.d.ts +5 -3
  407. package/dist/interface/config/index.d.ts.map +1 -1
  408. package/dist/interface/types/index.d.ts +37 -6
  409. package/dist/interface/types/index.d.ts.map +1 -1
  410. package/dist/interface/types/parser.d.ts +85 -0
  411. package/dist/interface/types/parser.d.ts.map +1 -1
  412. package/dist/interface/types/storage.d.ts +227 -10
  413. package/dist/interface/types/storage.d.ts.map +1 -1
  414. package/dist/orchestrator/agent-metrics-service.d.ts +126 -0
  415. package/dist/orchestrator/agent-metrics-service.d.ts.map +1 -0
  416. package/dist/orchestrator/agent-metrics-service.js +444 -0
  417. package/dist/orchestrator/agent-metrics-service.js.map +1 -0
  418. package/dist/orchestrator/types.d.ts +2 -0
  419. package/dist/orchestrator/types.d.ts.map +1 -1
  420. package/dist/orchestrator/types.js.map +1 -1
  421. package/dist/parser/enhancers/PythonTypeEnhancer.d.ts +26 -0
  422. package/dist/parser/enhancers/PythonTypeEnhancer.d.ts.map +1 -0
  423. package/dist/parser/enhancers/PythonTypeEnhancer.js +440 -0
  424. package/dist/parser/enhancers/PythonTypeEnhancer.js.map +1 -0
  425. package/dist/parser/implementations/smart-parser.d.ts.map +1 -1
  426. package/dist/parser/implementations/smart-parser.js +7 -69
  427. package/dist/parser/implementations/smart-parser.js.map +1 -1
  428. package/dist/parser/implementations/tree-sitter-loader.d.ts +18 -0
  429. package/dist/parser/implementations/tree-sitter-loader.d.ts.map +1 -0
  430. package/dist/parser/implementations/tree-sitter-loader.js +136 -0
  431. package/dist/parser/implementations/tree-sitter-loader.js.map +1 -0
  432. package/dist/parser/index.d.ts +5 -3
  433. package/dist/parser/index.d.ts.map +1 -1
  434. package/dist/parser/index.js +68 -6
  435. package/dist/parser/index.js.map +1 -1
  436. package/dist/parser/interfaces/IParser.d.ts +19 -6
  437. package/dist/parser/interfaces/IParser.d.ts.map +1 -1
  438. package/dist/parser/interfaces/IParser.js +2 -3
  439. package/dist/parser/interfaces/IParser.js.map +1 -1
  440. package/dist/server/handlers/AnalysisHandler.d.ts +13 -2
  441. package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -1
  442. package/dist/server/handlers/AnalysisHandler.js +24 -0
  443. package/dist/server/handlers/AnalysisHandler.js.map +1 -1
  444. package/dist/server/handlers/QueryHandler.d.ts.map +1 -1
  445. package/dist/server/handlers/QueryHandler.js +11 -30
  446. package/dist/server/handlers/QueryHandler.js.map +1 -1
  447. package/dist/server/mcp/context-tool.d.ts +9 -0
  448. package/dist/server/mcp/context-tool.d.ts.map +1 -0
  449. package/dist/server/mcp/context-tool.js +257 -0
  450. package/dist/server/mcp/context-tool.js.map +1 -0
  451. package/dist/server/mcp/schema-adapter.d.ts +55 -0
  452. package/dist/server/mcp/schema-adapter.d.ts.map +1 -0
  453. package/dist/server/mcp/schema-adapter.js +409 -0
  454. package/dist/server/mcp/schema-adapter.js.map +1 -0
  455. package/dist/server/mcp/server.d.ts +3 -3
  456. package/dist/server/mcp/server.d.ts.map +1 -1
  457. package/dist/server/mcp/server.js +134 -20
  458. package/dist/server/mcp/server.js.map +1 -1
  459. package/dist/server/mcp/service.d.ts +6 -2
  460. package/dist/server/mcp/service.d.ts.map +1 -1
  461. package/dist/server/mcp/service.js +138 -36
  462. package/dist/server/mcp/service.js.map +1 -1
  463. package/dist/server/mcp/stdio-transport.d.ts +23 -0
  464. package/dist/server/mcp/stdio-transport.d.ts.map +1 -0
  465. package/dist/server/mcp/stdio-transport.js +101 -0
  466. package/dist/server/mcp/stdio-transport.js.map +1 -0
  467. package/dist/server/mcp/types.d.ts +133 -8
  468. package/dist/server/mcp/types.d.ts.map +1 -1
  469. package/dist/server/routes/api.d.ts.map +1 -1
  470. package/dist/server/routes/api.js +11 -2
  471. package/dist/server/routes/api.js.map +1 -1
  472. package/docs/AI_ASSISTANT_SETUP.md +281 -12
  473. package/docs/API.md +170 -0
  474. package/docs/CONFIGURATION.md +141 -0
  475. package/docs/DEVELOPMENT.md +96 -0
  476. package/docs/GETTING-STARTED.md +114 -0
  477. package/docs/README.md +40 -1
  478. package/docs/SETUP_GUIDE.md +60 -14
  479. package/docs/TESTING.md +81 -0
  480. package/docs/ai-guide/COMMANDS.md +68 -10
  481. package/docs/ai-guide/INTEGRATION.md +77 -10
  482. package/docs/ai-guide/OUTPUT.md +345 -9
  483. package/docs/ai-guide/PROMPTS.md +2 -2
  484. package/docs/ai-guide/QUICKSTART.md +28 -1
  485. package/docs/ai-guide/README.md +2 -2
  486. package/docs/archive/ideation/2026-04-15-executable-architecture-constitution-ideation-archive.md +70 -0
  487. package/docs/archive/ideation/2026-04-20-mycodemap-init-enhancements-ideation-archive.md +109 -0
  488. package/docs/archive/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation-archive.md +54 -0
  489. package/docs/backlog.md +232 -144
  490. package/docs/brainstorms/2026-05-10-agent-effectiveness-validation-requirements.md +112 -0
  491. package/docs/generated/phase-58/subagent-evidence/claude-hook-example.json +15 -0
  492. package/docs/generated/phase-58/subagent-evidence/claude-session.md +146 -0
  493. package/docs/generated/phase-58/subagent-evidence/claude-subagent.json +28 -0
  494. package/docs/generated/phase-58/subagent-evidence/codex-agent-example.toml +19 -0
  495. package/docs/generated/phase-58/subagent-evidence/codex-session.md +150 -0
  496. package/docs/generated/phase-58/subagent-evidence/codex-subagent.json +20 -0
  497. package/docs/generated/phase-58/subagent-evidence/negative-no-retrieval.json +12 -0
  498. package/docs/generated/phase-58/subagent-evidence/verification-manifest.json +19 -0
  499. package/docs/ideation/2026-04-15-executable-architecture-constitution-ideation.md +10 -22
  500. package/docs/ideation/2026-04-20-mycodemap-init-enhancements-ideation.md +15 -60
  501. package/docs/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation.md +47 -52
  502. package/docs/ideation/2026-04-29-ux-install-agent-experience-ideation.md +256 -0
  503. package/docs/ideation/2026-05-02-subagent-environment-contract-injection-ideation.md +183 -0
  504. package/docs/ideation/2026-05-04-subagent-hooks-deep-dive-ideation.md +133 -0
  505. package/docs/ideation/2026-05-10-agent-effectiveness-validation-ideation.md +219 -0
  506. package/docs/plans/2026-04-30-install-guide-and-repo-analyzer-design.md +394 -0
  507. package/docs/rules/README.md +1 -0
  508. package/docs/rules/architecture-guardrails.md +2 -1
  509. package/docs/rules/engineering-with-codex-openai.md +1 -1
  510. package/docs/rules/harness.md +106 -0
  511. package/docs/rules/pre-release-checklist.md +28 -0
  512. package/docs/rules/testing.md +51 -0
  513. package/examples/claude/skills/mycodemap-repo-analyzer/SKILL.md +294 -0
  514. package/examples/claude/skills/mycodemap-repo-analyzer/references/analysis-guide.md +166 -0
  515. package/examples/claude/skills/mycodemap-repo-analyzer/references/module-analysis-guide.md +150 -0
  516. package/package.json +12 -4
  517. package/scripts/copy-build-assets.mjs +23 -0
  518. package/scripts/hooks/templates/pre-commit +33 -2
  519. package/scripts/sync-analyze-docs.js +2 -2
  520. package/scripts/tests/test_rule_control_workflow.py +15 -1
  521. package/scripts/validate-docs.js +113 -16
  522. package/scripts/verify-subagent-env-contract.mjs +279 -0
  523. package/dist/parser/implementations/tree-sitter-parser.d.ts +0 -57
  524. package/dist/parser/implementations/tree-sitter-parser.d.ts.map +0 -1
  525. package/dist/parser/implementations/tree-sitter-parser.js +0 -375
  526. package/dist/parser/implementations/tree-sitter-parser.js.map +0 -1
  527. package/docs/references/tmp.md +0 -527
@@ -1 +1 @@
1
- {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/deps.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,6BAA6B,CAAC;AAE5E,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,QAAQ;IAChB,OAAO,EAAE,MAAM,EAAE,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WAAW,EAAE,CAAC;AACvB,YAAY,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,GACX,CAAC"}
@@ -1,340 +1,34 @@
1
1
  // [META] since:2026-03-03 | owner:orchestrator-team | stable:true
2
- // [WHY] 提供依赖分析命令,添加 dependentsMap 解决 ID 到路径映射
3
- import chalk from 'chalk';
4
- import fs from 'fs';
5
- import path from 'path';
6
- import { resolveDataPath } from '../paths.js';
7
- /**
8
- * 加载代码地图数据
9
- */
10
- function loadCodeMap(rootDir) {
11
- const codemapPath = resolveDataPath(rootDir);
12
- if (!fs.existsSync(codemapPath)) {
13
- console.log(chalk.red('❌ 代码地图不存在,请先运行 codemap generate'));
14
- return null;
15
- }
16
- try {
17
- const data = fs.readFileSync(codemapPath, 'utf-8');
18
- return JSON.parse(data);
19
- }
20
- catch (error) {
21
- console.log(chalk.red('❌ 读取代码地图失败:', error instanceof Error ? error.message : String(error)));
22
- return null;
23
- }
24
- }
25
- /**
26
- * 获取模块的依赖关系
27
- */
28
- function getModuleDependencies(codeMap, modulePath) {
29
- const module = codeMap.modules.find(m => m.absolutePath.includes(modulePath) ||
30
- path.relative(codeMap.project.rootDir, m.absolutePath).includes(modulePath));
31
- if (!module) {
32
- return { module: undefined, dependencies: [], dependents: [] };
33
- }
34
- return {
35
- module,
36
- dependencies: module.dependencies,
37
- dependents: module.dependents
38
- };
39
- }
40
- /**
41
- * 构建 dependents ID 到路径的映射
42
- */
43
- function buildDependentsMap(dependents, codeMap) {
44
- return dependents.map(id => {
45
- const depModule = codeMap.modules.find(m => m.id === id);
46
- return {
47
- id,
48
- path: depModule
49
- ? path.relative(codeMap.project.rootDir, depModule.absolutePath)
50
- : id
51
- };
52
- });
53
- }
54
- /**
55
- * 构建 SourceLocation 对象
56
- */
57
- function buildLocation(filePath, line = 1, column = 1) {
58
- return {
59
- file: filePath,
60
- line,
61
- column,
62
- };
63
- }
64
- /**
65
- * 分析依赖关系 - 纯逻辑函数
66
- * @param codeMap 代码地图数据
67
- * @param modulePaths 目标模块路径列表(可选,为空则分析所有模块)
68
- * @returns 依赖分析结果
69
- */
70
- function analyzeDeps(codeMap, modulePaths) {
71
- const modules = [];
72
- const allDependencies = [];
73
- if (modulePaths && modulePaths.length > 0) {
74
- // 分析指定模块
75
- for (const modulePath of modulePaths) {
76
- const result = getModuleDependencies(codeMap, modulePath);
77
- if (result.module) {
78
- const dependentsMap = buildDependentsMap(result.module.dependents, codeMap);
79
- modules.push({
80
- path: result.module.absolutePath,
81
- relativePath: path.relative(codeMap.project.rootDir, result.module.absolutePath),
82
- dependencies: result.dependencies,
83
- dependents: result.dependents,
84
- dependentsMap
85
- });
86
- }
87
- }
88
- }
89
- else {
90
- // 分析所有模块
91
- for (const module of codeMap.modules) {
92
- const dependentsMap = buildDependentsMap(module.dependents, codeMap);
93
- modules.push({
94
- path: module.absolutePath,
95
- relativePath: path.relative(codeMap.project.rootDir, module.absolutePath),
96
- dependencies: module.dependencies,
97
- dependents: module.dependents,
98
- dependentsMap
99
- });
100
- allDependencies.push({
101
- path: module.absolutePath,
102
- count: module.dependencies.length,
103
- type: module.type
104
- });
105
- }
106
- // 按依赖数量排序
107
- allDependencies.sort((a, b) => b.count - a.count);
108
- }
109
- return {
110
- modules,
111
- allDependencies: allDependencies.length > 0 ? allDependencies : undefined
112
- };
113
- }
114
- /**
115
- * 格式化依赖输出
116
- */
117
- function formatDependencies(codeMap, targetModule, allDependencies, options) {
118
- if (options.json) {
119
- const output = {};
120
- if (options.module && targetModule) {
121
- const dependentsMap = buildDependentsMap(targetModule.dependents, codeMap);
122
- const location = buildLocation(path.relative(codeMap.project.rootDir, targetModule.absolutePath));
123
- output.module = {
124
- path: targetModule.absolutePath,
125
- relativePath: path.relative(codeMap.project.rootDir, targetModule.absolutePath),
126
- location, // 新增:结构化位置信息
127
- dependencies: targetModule.dependencies,
128
- dependents: targetModule.dependents,
129
- dependentsMap
130
- };
131
- }
132
- else {
133
- output.allDependencies = Object.fromEntries(allDependencies);
134
- output.modules = Array.from(allDependencies.entries()).map(([modulePath, info]) => ({
135
- path: modulePath,
136
- relativePath: path.relative(codeMap.project.rootDir, modulePath),
137
- location: buildLocation(path.relative(codeMap.project.rootDir, modulePath)),
138
- ...info
139
- }));
140
- }
141
- console.log(JSON.stringify(output, null, 2));
142
- return;
143
- }
144
- if (options.module && targetModule) {
145
- // 输出指定模块的依赖
146
- console.log(chalk.cyan(`\n📦 模块: ${path.relative(codeMap.project.rootDir, targetModule.absolutePath)}`));
147
- console.log(chalk.gray('─'.repeat(50)));
148
- // 直接依赖
149
- console.log(chalk.yellow('\n⬇️ 直接依赖 (dependencies):'));
150
- if (targetModule.dependencies.length === 0) {
151
- console.log(chalk.gray(' 无'));
152
- }
153
- else {
154
- for (const dep of targetModule.dependencies) {
155
- const depModule = codeMap.modules.find(m => m.dependencies.includes(dep) || m.absolutePath.includes(dep));
156
- const depType = depModule?.type || 'unknown';
157
- console.log(chalk.green(` • ${dep}`), chalk.gray(`[${depType}]`));
158
- }
159
- }
160
- // 依赖者(反向依赖)
161
- console.log(chalk.yellow('\n⬆️ 被依赖 (dependents):'));
162
- if (targetModule.dependents.length === 0) {
163
- console.log(chalk.gray(' 无'));
164
- }
165
- else {
166
- for (const dep of targetModule.dependents) {
167
- const depModule = codeMap.modules.find(m => m.id === dep);
168
- const relPath = depModule
169
- ? path.relative(codeMap.project.rootDir, depModule.absolutePath)
170
- : dep;
171
- console.log(chalk.green(` • ${relPath}`));
172
- }
173
- }
174
- // 统计
175
- console.log(chalk.gray('─'.repeat(50)));
176
- console.log(chalk.cyan(` 依赖数量: ${targetModule.dependencies.length}`));
177
- console.log(chalk.cyan(` 被依赖数量: ${targetModule.dependents.length}`));
178
- }
179
- else {
180
- // 输出所有模块的依赖统计
181
- console.log(chalk.cyan('\n📊 项目依赖分析'));
182
- console.log(chalk.gray('─'.repeat(50)));
183
- // 按依赖数量排序
184
- const sortedDeps = Array.from(allDependencies.entries())
185
- .sort((a, b) => b[1].count - a[1].count);
186
- console.log(chalk.yellow('\n📦 模块依赖排名 (Top 20):'));
187
- let rank = 1;
188
- for (const [modulePath, info] of sortedDeps.slice(0, 20)) {
189
- const relPath = modulePath.replace(codeMap.project.rootDir + '/', '');
190
- console.log(chalk.green(` ${rank}. ${relPath}`));
191
- console.log(chalk.gray(` 依赖: ${info.count}, 类型: ${info.type}`));
192
- rank++;
193
- }
194
- // 统计
195
- const totalDeps = allDependencies.size;
196
- const totalDepCount = Array.from(allDependencies.values()).reduce((sum, v) => sum + v.count, 0);
197
- console.log(chalk.gray('─'.repeat(50)));
198
- console.log(chalk.cyan(` 总模块数: ${codeMap.modules.length}`));
199
- console.log(chalk.cyan(` 有依赖的模块: ${totalDeps}`));
200
- console.log(chalk.cyan(` 总依赖关系: ${totalDepCount}`));
201
- }
202
- console.log('');
2
+ // [WHY] Thin CLI wrapper for shared deps execution so CLI and MCP can converge on one transport-free truth
3
+ import { resolveOutputMode, renderOutput, createProgressEmitter, formatError } from '../output/index.js';
4
+ import { DepsCommand, executeDepsTool, formatDepsHuman, } from '../../execution/contract-tools/deps.js';
5
+ function toExecutionError(error) {
6
+ const executionError = new Error(error.message);
7
+ executionError.code = error.code;
8
+ executionError.remediation = error.remediation;
9
+ executionError.details = error.details;
10
+ return executionError;
203
11
  }
204
- /**
205
- * Deps 命令实现 - 保持向后兼容
206
- */
207
12
  export async function depsCommand(options) {
208
- const rootDir = process.cwd();
209
- // 加载代码地图
210
- const codeMap = loadCodeMap(rootDir);
211
- if (!codeMap) {
212
- process.exit(1);
213
- }
214
- // 获取目标模块
215
- let targetModule;
216
- const allDependencies = new Map();
217
- if (options.module) {
218
- const result = getModuleDependencies(codeMap, options.module);
219
- targetModule = result.module;
220
- }
221
- else {
222
- // 统计所有模块的依赖
223
- for (const module of codeMap.modules) {
224
- allDependencies.set(module.absolutePath, {
225
- type: module.type,
226
- count: module.dependencies.length
13
+ const mode = resolveOutputMode({ json: options.json, human: options.human });
14
+ const progress = createProgressEmitter(mode, 'Analyzing deps...');
15
+ try {
16
+ progress.update(30, 'Loading modules...');
17
+ const execution = await executeDepsTool(options, process.cwd());
18
+ if (execution.status !== 'ok' || !execution.result) {
19
+ throw toExecutionError(execution.error ?? {
20
+ code: 'EXECUTION_FAILED',
21
+ message: 'Deps execution failed',
227
22
  });
228
23
  }
24
+ progress.complete();
25
+ renderOutput(execution.result, formatDepsHuman, mode);
229
26
  }
230
- // 输出结果
231
- formatDependencies(codeMap, targetModule, allDependencies, options);
232
- }
233
- /**
234
- * DepsCommand 类 - 供 ToolOrchestrator 调用
235
- */
236
- export class DepsCommand {
237
- codeMap = null;
238
- /**
239
- * 加载代码地图
240
- */
241
- loadCodeMap(rootDir) {
242
- const codemapPath = resolveDataPath(rootDir);
243
- if (!fs.existsSync(codemapPath)) {
244
- return null;
245
- }
246
- try {
247
- const data = fs.readFileSync(codemapPath, 'utf-8');
248
- return JSON.parse(data);
249
- }
250
- catch {
251
- return null;
252
- }
253
- }
254
- /**
255
- * 执行依赖分析
256
- * @param args 分析参数
257
- * @returns 依赖分析结果
258
- */
259
- async run(args) {
260
- const rootDir = process.cwd();
261
- // 加载代码地图
262
- if (!this.codeMap) {
263
- this.codeMap = this.loadCodeMap(rootDir);
264
- }
265
- if (!this.codeMap) {
266
- throw new Error('代码地图不存在,请先运行 codemap generate');
267
- }
268
- // 执行分析
269
- return analyzeDeps(this.codeMap, args.targets.length > 0 ? args.targets : undefined);
270
- }
271
- /**
272
- * 执行增强依赖分析,返回 UnifiedResult 格式
273
- * @param args 分析参数
274
- * @returns UnifiedResult 数组
275
- */
276
- async runEnhanced(args) {
277
- const result = await this.run(args);
278
- return this.toUnifiedResults(result);
279
- }
280
- /**
281
- * 将 DepsResult 转换为 UnifiedResult 数组
282
- * @param result 依赖分析结果
283
- * @returns UnifiedResult 数组
284
- */
285
- toUnifiedResults(result) {
286
- const unifiedResults = [];
287
- for (const module of result.modules) {
288
- // 生成唯一ID
289
- const fileName = path.basename(module.path);
290
- const id = `codemap-${fileName}-0`;
291
- // 构建人类可读内容
292
- const depCount = module.dependencies.length;
293
- const dependentCount = module.dependents.length;
294
- const content = `依赖 ${depCount} 个模块,被 ${dependentCount} 个模块依赖`;
295
- // 计算依赖复杂度评分 (gravity)
296
- // 基于依赖数量和被依赖数量的加权计算
297
- const gravity = Math.min(1.0, (depCount + dependentCount * 2) / 20);
298
- // 构建热度评分对象
299
- const heatScore = {
300
- freq30d: 0, // 依赖分析不涉及提交历史
301
- lastType: 'dependency',
302
- lastDate: null,
303
- stability: true
304
- };
305
- // 构建元数据
306
- const metadata = {
307
- symbolType: 'class',
308
- dependencies: module.dependencies,
309
- testFile: '',
310
- commitCount: 0,
311
- gravity,
312
- heatScore,
313
- impactCount: dependentCount,
314
- stability: dependentCount === 0 || dependentCount > 5, // 无依赖或多依赖视为稳定
315
- riskLevel: gravity > 0.7 ? 'high' : gravity > 0.4 ? 'medium' : 'low'
316
- };
317
- // 构建 location
318
- const location = {
319
- file: module.relativePath,
320
- line: 1,
321
- column: 1,
322
- };
323
- unifiedResults.push({
324
- id,
325
- source: 'codemap',
326
- toolScore: 0.9,
327
- type: 'file',
328
- file: module.path,
329
- line: 1,
330
- location, // 新增:结构化位置信息
331
- content,
332
- relevance: 0.8,
333
- keywords: [],
334
- metadata
335
- });
336
- }
337
- return unifiedResults;
27
+ catch (error) {
28
+ progress.fail();
29
+ process.stdout.write(formatError(error, mode, 'codemap deps') + '\n');
30
+ process.exitCode = 1;
338
31
  }
339
32
  }
33
+ export { DepsCommand };
340
34
  //# sourceMappingURL=deps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deps.js","sourceRoot":"","sources":["../../../src/cli/commands/deps.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,8CAA8C;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;A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K,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACzF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAElE,IAAI,CAAC;QACH,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAC;QAC1C,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAEhE,IAAI,SAAS,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACnD,MAAM,gBAAgB,CACpB,SAAS,CAAC,KAAK,IAAI;gBACjB,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,uBAAuB;aACjC,CACF,CAAC;QACJ,CAAC;QAED,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const doctorCommand: Command;
3
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkCpC,eAAO,MAAM,aAAa,SAIH,CAAC"}
@@ -0,0 +1,34 @@
1
+ // [META] since:2026-04-30 | owner:cli-team | stable:false
2
+ // [WHY] Top-level 'doctor' command — diagnose CodeMap ecosystem health
3
+ import { Command } from 'commander';
4
+ import { runDoctor } from '../doctor/orchestrator.js';
5
+ import { formatDoctorJsonData, formatDoctorReport } from '../doctor/formatter.js';
6
+ import { resolveOutputMode, formatError } from '../output/index.js';
7
+ async function doctorAction(options) {
8
+ try {
9
+ const report = await runDoctor({ json: options.json, cwd: process.cwd() });
10
+ // Resolve output mode: --human/--json/no-flag = TTY auto-detect
11
+ const mode = resolveOutputMode({ json: options.json, human: options.human });
12
+ // JSON mode: write the serializable data array; Human mode: write the formatted report
13
+ if (mode === 'json') {
14
+ const data = formatDoctorJsonData(report.results);
15
+ process.stdout.write(JSON.stringify(data) + '\n');
16
+ }
17
+ else {
18
+ process.stdout.write(formatDoctorReport(report.results) + '\n');
19
+ }
20
+ // Set exit code without calling process.exit() — allow commander natural exit
21
+ process.exitCode = report.exitCode;
22
+ }
23
+ catch (error) {
24
+ const mode = resolveOutputMode({ json: options.json, human: options.human });
25
+ process.stdout.write(formatError(error, mode) + '\n');
26
+ process.exitCode = 1;
27
+ }
28
+ }
29
+ export const doctorCommand = new Command('doctor')
30
+ .description('Diagnose CodeMap ecosystem health')
31
+ .option('-j, --json', 'Output diagnostics as JSON')
32
+ .option('--human', 'Force human-readable output')
33
+ .action(doctorAction);
34
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,uEAAuE;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOpE,KAAK,UAAU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A4B,CAAC;KAClD,MAAM,CAAC,SAAS,EAAE,6BAA6B,CAAC;KAChD,MAAM,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const envContractCommand: Command;
3
+ //# sourceMappingURL=env-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-contract.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/env-contract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+OpC,eAAO,MAAM,kBAAkB,SAWH,CAAC"}