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