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