edsger 0.77.0 → 0.78.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 (877) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +95 -210
  3. package/assets/LICENSE +21 -0
  4. package/assets/README.md +104 -0
  5. package/assets/benchmark/base.yaml +286 -0
  6. package/assets/benchmark/csharp.yaml +68 -0
  7. package/assets/benchmark/dart.yaml +70 -0
  8. package/assets/benchmark/go.yaml +71 -0
  9. package/assets/benchmark/java.yaml +68 -0
  10. package/assets/benchmark/python.yaml +72 -0
  11. package/assets/benchmark/typescript.yaml +71 -0
  12. package/assets/languages.yaml +35 -0
  13. package/assets/manifest.yaml +39 -0
  14. package/assets/review/base.yaml +111 -0
  15. package/assets/review/csharp.yaml +38 -0
  16. package/assets/review/dart.yaml +40 -0
  17. package/assets/review/go.yaml +40 -0
  18. package/assets/review/java.yaml +40 -0
  19. package/assets/review/python.yaml +41 -0
  20. package/assets/review/typescript.yaml +40 -0
  21. package/assets/schema/benchmark.schema.json +87 -0
  22. package/assets/schema/review.schema.json +73 -0
  23. package/assets/skills/benchmark/SKILL.md +66 -0
  24. package/assets/skills/pr-resolve/SKILL.md +58 -0
  25. package/assets/skills/pr-review/SKILL.md +66 -0
  26. package/dist/index.js +1339 -1247
  27. package/dist/index.js.map +1 -0
  28. package/package.json +58 -53
  29. package/dist/api/adr.d.ts +0 -48
  30. package/dist/api/adr.js +0 -139
  31. package/dist/api/app-store-iap.d.ts +0 -60
  32. package/dist/api/app-store-iap.js +0 -145
  33. package/dist/api/app-store.d.ts +0 -93
  34. package/dist/api/app-store.js +0 -206
  35. package/dist/api/chat.d.ts +0 -72
  36. package/dist/api/chat.js +0 -272
  37. package/dist/api/cross-product.d.ts +0 -33
  38. package/dist/api/cross-product.js +0 -127
  39. package/dist/api/financing.d.ts +0 -47
  40. package/dist/api/financing.js +0 -37
  41. package/dist/api/github.d.ts +0 -86
  42. package/dist/api/github.js +0 -203
  43. package/dist/api/growth.d.ts +0 -81
  44. package/dist/api/growth.js +0 -75
  45. package/dist/api/intelligence-normalize.d.ts +0 -25
  46. package/dist/api/intelligence-normalize.js +0 -103
  47. package/dist/api/intelligence.d.ts +0 -187
  48. package/dist/api/intelligence.js +0 -402
  49. package/dist/api/issues/approval-checker.d.ts +0 -22
  50. package/dist/api/issues/approval-checker.js +0 -141
  51. package/dist/api/issues/batch-operations.d.ts +0 -17
  52. package/dist/api/issues/batch-operations.js +0 -100
  53. package/dist/api/issues/get-issue.d.ts +0 -5
  54. package/dist/api/issues/get-issue.js +0 -47
  55. package/dist/api/issues/index.d.ts +0 -8
  56. package/dist/api/issues/index.js +0 -10
  57. package/dist/api/issues/issue-utils.d.ts +0 -25
  58. package/dist/api/issues/issue-utils.js +0 -133
  59. package/dist/api/issues/status-updater.d.ts +0 -68
  60. package/dist/api/issues/status-updater.js +0 -190
  61. package/dist/api/issues/test-cases.d.ts +0 -29
  62. package/dist/api/issues/test-cases.js +0 -185
  63. package/dist/api/issues/update-issue.d.ts +0 -25
  64. package/dist/api/issues/update-issue.js +0 -127
  65. package/dist/api/issues/user-stories.d.ts +0 -21
  66. package/dist/api/issues/user-stories.js +0 -163
  67. package/dist/api/mcp-client.d.ts +0 -22
  68. package/dist/api/mcp-client.js +0 -75
  69. package/dist/api/products/test-cases.d.ts +0 -18
  70. package/dist/api/products/test-cases.js +0 -51
  71. package/dist/api/products.d.ts +0 -15
  72. package/dist/api/products.js +0 -45
  73. package/dist/api/release-test-cases.d.ts +0 -7
  74. package/dist/api/release-test-cases.js +0 -59
  75. package/dist/api/releases.d.ts +0 -41
  76. package/dist/api/releases.js +0 -117
  77. package/dist/api/run-sheets.d.ts +0 -22
  78. package/dist/api/run-sheets.js +0 -13
  79. package/dist/api/storage.d.ts +0 -13
  80. package/dist/api/storage.js +0 -29
  81. package/dist/api/tasks.d.ts +0 -26
  82. package/dist/api/tasks.js +0 -81
  83. package/dist/api/test-reports.d.ts +0 -9
  84. package/dist/api/test-reports.js +0 -43
  85. package/dist/api/user-psychology.d.ts +0 -101
  86. package/dist/api/user-psychology.js +0 -143
  87. package/dist/api/web-deploy.d.ts +0 -67
  88. package/dist/api/web-deploy.js +0 -199
  89. package/dist/auth/auth-store.d.ts +0 -98
  90. package/dist/auth/auth-store.js +0 -194
  91. package/dist/auth/env-store.d.ts +0 -41
  92. package/dist/auth/env-store.js +0 -127
  93. package/dist/auth/login.d.ts +0 -18
  94. package/dist/auth/login.js +0 -179
  95. package/dist/commands/adr/index.d.ts +0 -13
  96. package/dist/commands/adr/index.js +0 -31
  97. package/dist/commands/agent-workflow/chat-worker.d.ts +0 -16
  98. package/dist/commands/agent-workflow/chat-worker.js +0 -465
  99. package/dist/commands/agent-workflow/index.d.ts +0 -13
  100. package/dist/commands/agent-workflow/index.js +0 -107
  101. package/dist/commands/agent-workflow/issue-worker.d.ts +0 -14
  102. package/dist/commands/agent-workflow/issue-worker.js +0 -65
  103. package/dist/commands/agent-workflow/processor.d.ts +0 -95
  104. package/dist/commands/agent-workflow/processor.js +0 -519
  105. package/dist/commands/analyze-logs/index.d.ts +0 -7
  106. package/dist/commands/analyze-logs/index.js +0 -34
  107. package/dist/commands/api-docs/index.d.ts +0 -18
  108. package/dist/commands/api-docs/index.js +0 -41
  109. package/dist/commands/app-store/index.d.ts +0 -12
  110. package/dist/commands/app-store/index.js +0 -69
  111. package/dist/commands/architecture-diagram/index.d.ts +0 -8
  112. package/dist/commands/architecture-diagram/index.js +0 -10
  113. package/dist/commands/build/detect-project.d.ts +0 -52
  114. package/dist/commands/build/detect-project.js +0 -277
  115. package/dist/commands/build/index.d.ts +0 -66
  116. package/dist/commands/build/index.js +0 -544
  117. package/dist/commands/chat-serve/chat-server.d.ts +0 -114
  118. package/dist/commands/chat-serve/chat-server.js +0 -339
  119. package/dist/commands/chat-serve/index.d.ts +0 -20
  120. package/dist/commands/chat-serve/index.js +0 -58
  121. package/dist/commands/checklists/index.d.ts +0 -16
  122. package/dist/commands/checklists/index.js +0 -187
  123. package/dist/commands/checklists/tools.d.ts +0 -17
  124. package/dist/commands/checklists/tools.js +0 -19
  125. package/dist/commands/class-diagram/index.d.ts +0 -7
  126. package/dist/commands/class-diagram/index.js +0 -9
  127. package/dist/commands/code-review/index.d.ts +0 -2
  128. package/dist/commands/code-review/index.js +0 -37
  129. package/dist/commands/code-review/reviewer.d.ts +0 -3
  130. package/dist/commands/code-review/reviewer.js +0 -205
  131. package/dist/commands/config/index.d.ts +0 -16
  132. package/dist/commands/config/index.js +0 -60
  133. package/dist/commands/data-flow/index.d.ts +0 -19
  134. package/dist/commands/data-flow/index.js +0 -55
  135. package/dist/commands/diagram-shared/index.d.ts +0 -21
  136. package/dist/commands/diagram-shared/index.js +0 -37
  137. package/dist/commands/discover/index.d.ts +0 -14
  138. package/dist/commands/discover/index.js +0 -29
  139. package/dist/commands/er-diagram/index.d.ts +0 -19
  140. package/dist/commands/er-diagram/index.js +0 -55
  141. package/dist/commands/features/index.d.ts +0 -15
  142. package/dist/commands/features/index.js +0 -34
  143. package/dist/commands/financing-deck/index.d.ts +0 -8
  144. package/dist/commands/financing-deck/index.js +0 -66
  145. package/dist/commands/find-architecture/index.d.ts +0 -15
  146. package/dist/commands/find-architecture/index.js +0 -50
  147. package/dist/commands/find-bugs/index.d.ts +0 -13
  148. package/dist/commands/find-bugs/index.js +0 -48
  149. package/dist/commands/find-features/index.d.ts +0 -14
  150. package/dist/commands/find-features/index.js +0 -42
  151. package/dist/commands/find-smells/index.d.ts +0 -23
  152. package/dist/commands/find-smells/index.js +0 -74
  153. package/dist/commands/flowchart/index.d.ts +0 -8
  154. package/dist/commands/flowchart/index.js +0 -10
  155. package/dist/commands/growth-analysis/index.d.ts +0 -7
  156. package/dist/commands/growth-analysis/index.js +0 -89
  157. package/dist/commands/init/index.d.ts +0 -5
  158. package/dist/commands/init/index.js +0 -152
  159. package/dist/commands/init/prompts.d.ts +0 -9
  160. package/dist/commands/init/prompts.js +0 -128
  161. package/dist/commands/init/templates.d.ts +0 -9
  162. package/dist/commands/init/templates.js +0 -264
  163. package/dist/commands/intelligence/index.d.ts +0 -15
  164. package/dist/commands/intelligence/index.js +0 -138
  165. package/dist/commands/issue-analysis/index.d.ts +0 -5
  166. package/dist/commands/issue-analysis/index.js +0 -9
  167. package/dist/commands/pr-resolve/index.d.ts +0 -13
  168. package/dist/commands/pr-resolve/index.js +0 -50
  169. package/dist/commands/pr-review/index.d.ts +0 -12
  170. package/dist/commands/pr-review/index.js +0 -47
  171. package/dist/commands/product-techniques/index.d.ts +0 -15
  172. package/dist/commands/product-techniques/index.js +0 -37
  173. package/dist/commands/product-test-cases/index.d.ts +0 -12
  174. package/dist/commands/product-test-cases/index.js +0 -40
  175. package/dist/commands/quality-benchmark/index.d.ts +0 -45
  176. package/dist/commands/quality-benchmark/index.js +0 -247
  177. package/dist/commands/recipes/index.d.ts +0 -17
  178. package/dist/commands/recipes/index.js +0 -40
  179. package/dist/commands/refactor/refactor.d.ts +0 -2
  180. package/dist/commands/refactor/refactor.js +0 -134
  181. package/dist/commands/release-sync/index.d.ts +0 -5
  182. package/dist/commands/release-sync/index.js +0 -38
  183. package/dist/commands/run-sheet/index.d.ts +0 -6
  184. package/dist/commands/run-sheet/index.js +0 -48
  185. package/dist/commands/screen-flow/index.d.ts +0 -18
  186. package/dist/commands/screen-flow/index.js +0 -54
  187. package/dist/commands/sequence-diagram/index.d.ts +0 -19
  188. package/dist/commands/sequence-diagram/index.js +0 -55
  189. package/dist/commands/session-serve/index.d.ts +0 -32
  190. package/dist/commands/session-serve/index.js +0 -100
  191. package/dist/commands/session-turn/index.d.ts +0 -73
  192. package/dist/commands/session-turn/index.js +0 -254
  193. package/dist/commands/smoke-test/index.d.ts +0 -5
  194. package/dist/commands/smoke-test/index.js +0 -40
  195. package/dist/commands/state-diagram/index.d.ts +0 -7
  196. package/dist/commands/state-diagram/index.js +0 -9
  197. package/dist/commands/sync-aws/index.d.ts +0 -16
  198. package/dist/commands/sync-aws/index.js +0 -214
  199. package/dist/commands/sync-datadog/index.d.ts +0 -16
  200. package/dist/commands/sync-datadog/index.js +0 -236
  201. package/dist/commands/sync-github-issues/index.d.ts +0 -11
  202. package/dist/commands/sync-github-issues/index.js +0 -42
  203. package/dist/commands/sync-github-pull-requests/index.d.ts +0 -11
  204. package/dist/commands/sync-github-pull-requests/index.js +0 -42
  205. package/dist/commands/sync-org-repos/index.d.ts +0 -12
  206. package/dist/commands/sync-org-repos/index.js +0 -60
  207. package/dist/commands/sync-sentry-issues/index.d.ts +0 -14
  208. package/dist/commands/sync-sentry-issues/index.js +0 -73
  209. package/dist/commands/sync-terraform/index.d.ts +0 -16
  210. package/dist/commands/sync-terraform/index.js +0 -248
  211. package/dist/commands/task-worker/index.d.ts +0 -8
  212. package/dist/commands/task-worker/index.js +0 -34
  213. package/dist/commands/task-worker/processor.d.ts +0 -23
  214. package/dist/commands/task-worker/processor.js +0 -84
  215. package/dist/commands/technical-design/index.d.ts +0 -5
  216. package/dist/commands/technical-design/index.js +0 -9
  217. package/dist/commands/test-cases-analysis/index.d.ts +0 -5
  218. package/dist/commands/test-cases-analysis/index.js +0 -9
  219. package/dist/commands/user-psychology/index.d.ts +0 -7
  220. package/dist/commands/user-psychology/index.js +0 -51
  221. package/dist/commands/user-stories-analysis/index.d.ts +0 -5
  222. package/dist/commands/user-stories-analysis/index.js +0 -9
  223. package/dist/commands/workflow/config/phase-configs.d.ts +0 -5
  224. package/dist/commands/workflow/config/phase-configs.js +0 -132
  225. package/dist/commands/workflow/core/index.d.ts +0 -8
  226. package/dist/commands/workflow/core/index.js +0 -12
  227. package/dist/commands/workflow/core/issue-filter.d.ts +0 -16
  228. package/dist/commands/workflow/core/issue-filter.js +0 -47
  229. package/dist/commands/workflow/core/pipeline-evaluator.d.ts +0 -24
  230. package/dist/commands/workflow/core/pipeline-evaluator.js +0 -32
  231. package/dist/commands/workflow/core/state-manager.d.ts +0 -24
  232. package/dist/commands/workflow/core/state-manager.js +0 -42
  233. package/dist/commands/workflow/core/workflow-logger.d.ts +0 -23
  234. package/dist/commands/workflow/core/workflow-logger.js +0 -77
  235. package/dist/commands/workflow/executors/phase-executor.d.ts +0 -8
  236. package/dist/commands/workflow/executors/phase-executor.js +0 -338
  237. package/dist/commands/workflow/index.d.ts +0 -2
  238. package/dist/commands/workflow/index.js +0 -34
  239. package/dist/commands/workflow/issue-coordinator.d.ts +0 -18
  240. package/dist/commands/workflow/issue-coordinator.js +0 -161
  241. package/dist/commands/workflow/phase-orchestrator.d.ts +0 -26
  242. package/dist/commands/workflow/phase-orchestrator.js +0 -699
  243. package/dist/commands/workflow/processor.d.ts +0 -47
  244. package/dist/commands/workflow/processor.js +0 -149
  245. package/dist/config/issue-status.d.ts +0 -29
  246. package/dist/config/issue-status.js +0 -44
  247. package/dist/config.d.ts +0 -3
  248. package/dist/config.js +0 -79
  249. package/dist/constants.d.ts +0 -10
  250. package/dist/constants.js +0 -36
  251. package/dist/errors/index.d.ts +0 -68
  252. package/dist/errors/index.js +0 -129
  253. package/dist/index.d.ts +0 -4
  254. package/dist/phases/adr-generation/agent.d.ts +0 -6
  255. package/dist/phases/adr-generation/agent.js +0 -69
  256. package/dist/phases/adr-generation/index.d.ts +0 -15
  257. package/dist/phases/adr-generation/index.js +0 -66
  258. package/dist/phases/adr-generation/parse.d.ts +0 -12
  259. package/dist/phases/adr-generation/parse.js +0 -123
  260. package/dist/phases/adr-generation/prompts.d.ts +0 -8
  261. package/dist/phases/adr-generation/prompts.js +0 -35
  262. package/dist/phases/analyze-logs/agent.d.ts +0 -11
  263. package/dist/phases/analyze-logs/agent.js +0 -66
  264. package/dist/phases/analyze-logs/index.d.ts +0 -23
  265. package/dist/phases/analyze-logs/index.js +0 -152
  266. package/dist/phases/analyze-logs/prompts.d.ts +0 -3
  267. package/dist/phases/analyze-logs/prompts.js +0 -27
  268. package/dist/phases/api-docs/index.d.ts +0 -47
  269. package/dist/phases/api-docs/index.js +0 -254
  270. package/dist/phases/api-docs/mcp-server.d.ts +0 -25
  271. package/dist/phases/api-docs/mcp-server.js +0 -82
  272. package/dist/phases/api-docs/prompts.d.ts +0 -16
  273. package/dist/phases/api-docs/prompts.js +0 -65
  274. package/dist/phases/api-docs/types.d.ts +0 -22
  275. package/dist/phases/api-docs/types.js +0 -10
  276. package/dist/phases/app-store-generation/agent.d.ts +0 -2
  277. package/dist/phases/app-store-generation/agent.js +0 -177
  278. package/dist/phases/app-store-generation/assets/inter-latin-ext.woff2 +0 -0
  279. package/dist/phases/app-store-generation/assets/inter-latin.woff2 +0 -0
  280. package/dist/phases/app-store-generation/context.d.ts +0 -21
  281. package/dist/phases/app-store-generation/context.js +0 -78
  282. package/dist/phases/app-store-generation/index.d.ts +0 -20
  283. package/dist/phases/app-store-generation/index.js +0 -157
  284. package/dist/phases/app-store-generation/inter-font.d.ts +0 -20
  285. package/dist/phases/app-store-generation/inter-font.js +0 -49
  286. package/dist/phases/app-store-generation/prompts.d.ts +0 -43
  287. package/dist/phases/app-store-generation/prompts.js +0 -73
  288. package/dist/phases/app-store-generation/screenshot-composer.d.ts +0 -41
  289. package/dist/phases/app-store-generation/screenshot-composer.js +0 -516
  290. package/dist/phases/app-store-generation/uploader.d.ts +0 -19
  291. package/dist/phases/app-store-generation/uploader.js +0 -150
  292. package/dist/phases/architecture-diagram/index.d.ts +0 -15
  293. package/dist/phases/architecture-diagram/index.js +0 -51
  294. package/dist/phases/autonomous/index.d.ts +0 -32
  295. package/dist/phases/autonomous/index.js +0 -412
  296. package/dist/phases/autonomous/prompts.d.ts +0 -5
  297. package/dist/phases/autonomous/prompts.js +0 -31
  298. package/dist/phases/branch-planning/context.d.ts +0 -14
  299. package/dist/phases/branch-planning/context.js +0 -43
  300. package/dist/phases/branch-planning/index.d.ts +0 -25
  301. package/dist/phases/branch-planning/index.js +0 -404
  302. package/dist/phases/branch-planning/outcome.d.ts +0 -28
  303. package/dist/phases/branch-planning/outcome.js +0 -115
  304. package/dist/phases/branch-planning/prompts.d.ts +0 -41
  305. package/dist/phases/branch-planning/prompts.js +0 -157
  306. package/dist/phases/bug-fixing/analyzer.d.ts +0 -17
  307. package/dist/phases/bug-fixing/analyzer.js +0 -247
  308. package/dist/phases/bug-fixing/context-fetcher.d.ts +0 -22
  309. package/dist/phases/bug-fixing/context-fetcher.js +0 -137
  310. package/dist/phases/bug-fixing/index.d.ts +0 -7
  311. package/dist/phases/bug-fixing/index.js +0 -7
  312. package/dist/phases/bug-fixing/mcp-server.d.ts +0 -18
  313. package/dist/phases/bug-fixing/mcp-server.js +0 -19
  314. package/dist/phases/bug-fixing/prompts.d.ts +0 -2
  315. package/dist/phases/bug-fixing/prompts.js +0 -9
  316. package/dist/phases/chat-processor/context.d.ts +0 -38
  317. package/dist/phases/chat-processor/context.js +0 -91
  318. package/dist/phases/chat-processor/index.d.ts +0 -49
  319. package/dist/phases/chat-processor/index.js +0 -482
  320. package/dist/phases/chat-processor/product-context.d.ts +0 -36
  321. package/dist/phases/chat-processor/product-context.js +0 -113
  322. package/dist/phases/chat-processor/product-prompts.d.ts +0 -4
  323. package/dist/phases/chat-processor/product-prompts.js +0 -65
  324. package/dist/phases/chat-processor/product-tools.d.ts +0 -8
  325. package/dist/phases/chat-processor/product-tools.js +0 -11
  326. package/dist/phases/chat-processor/prompts.d.ts +0 -35
  327. package/dist/phases/chat-processor/prompts.js +0 -213
  328. package/dist/phases/chat-processor/tools.d.ts +0 -8
  329. package/dist/phases/chat-processor/tools.js +0 -11
  330. package/dist/phases/class-diagram/index.d.ts +0 -14
  331. package/dist/phases/class-diagram/index.js +0 -76
  332. package/dist/phases/code-implementation/branch-pr-creator.d.ts +0 -31
  333. package/dist/phases/code-implementation/branch-pr-creator.js +0 -172
  334. package/dist/phases/code-implementation/context.d.ts +0 -17
  335. package/dist/phases/code-implementation/context.js +0 -88
  336. package/dist/phases/code-implementation/index.d.ts +0 -33
  337. package/dist/phases/code-implementation/index.js +0 -926
  338. package/dist/phases/code-implementation/outcome.d.ts +0 -47
  339. package/dist/phases/code-implementation/outcome.js +0 -53
  340. package/dist/phases/code-implementation/prompts.d.ts +0 -8
  341. package/dist/phases/code-implementation/prompts.js +0 -166
  342. package/dist/phases/code-implementation-verification/agent.d.ts +0 -32
  343. package/dist/phases/code-implementation-verification/agent.js +0 -225
  344. package/dist/phases/code-implementation-verification/index.d.ts +0 -27
  345. package/dist/phases/code-implementation-verification/index.js +0 -121
  346. package/dist/phases/code-implementation-verification/prompts.d.ts +0 -10
  347. package/dist/phases/code-implementation-verification/prompts.js +0 -90
  348. package/dist/phases/code-refine/context.d.ts +0 -99
  349. package/dist/phases/code-refine/context.js +0 -457
  350. package/dist/phases/code-refine/index.d.ts +0 -59
  351. package/dist/phases/code-refine/index.js +0 -348
  352. package/dist/phases/code-refine/prompts.d.ts +0 -5
  353. package/dist/phases/code-refine/prompts.js +0 -162
  354. package/dist/phases/code-refine/refine-iteration.d.ts +0 -33
  355. package/dist/phases/code-refine/refine-iteration.js +0 -166
  356. package/dist/phases/code-refine/retry-handler.d.ts +0 -17
  357. package/dist/phases/code-refine/retry-handler.js +0 -87
  358. package/dist/phases/code-refine-verification/github.d.ts +0 -54
  359. package/dist/phases/code-refine-verification/github.js +0 -328
  360. package/dist/phases/code-refine-verification/index.d.ts +0 -11
  361. package/dist/phases/code-refine-verification/index.js +0 -260
  362. package/dist/phases/code-refine-verification/llm-analyzer.d.ts +0 -22
  363. package/dist/phases/code-refine-verification/llm-analyzer.js +0 -152
  364. package/dist/phases/code-refine-verification/prompts.d.ts +0 -5
  365. package/dist/phases/code-refine-verification/prompts.js +0 -119
  366. package/dist/phases/code-refine-verification/types.d.ts +0 -74
  367. package/dist/phases/code-refine-verification/types.js +0 -4
  368. package/dist/phases/code-review/context.d.ts +0 -96
  369. package/dist/phases/code-review/context.js +0 -278
  370. package/dist/phases/code-review/diff-utils.d.ts +0 -36
  371. package/dist/phases/code-review/diff-utils.js +0 -100
  372. package/dist/phases/code-review/index.d.ts +0 -40
  373. package/dist/phases/code-review/index.js +0 -627
  374. package/dist/phases/code-testing/analyzer.d.ts +0 -19
  375. package/dist/phases/code-testing/analyzer.js +0 -215
  376. package/dist/phases/code-testing/context-fetcher.d.ts +0 -16
  377. package/dist/phases/code-testing/context-fetcher.js +0 -83
  378. package/dist/phases/code-testing/index.d.ts +0 -2
  379. package/dist/phases/code-testing/index.js +0 -2
  380. package/dist/phases/code-testing/prompts.d.ts +0 -3
  381. package/dist/phases/code-testing/prompts.js +0 -63
  382. package/dist/phases/data-flow/index.d.ts +0 -28
  383. package/dist/phases/data-flow/index.js +0 -286
  384. package/dist/phases/data-flow/mcp-server.d.ts +0 -85
  385. package/dist/phases/data-flow/mcp-server.js +0 -140
  386. package/dist/phases/data-flow/prompts.d.ts +0 -14
  387. package/dist/phases/data-flow/prompts.js +0 -36
  388. package/dist/phases/data-flow/types.d.ts +0 -71
  389. package/dist/phases/data-flow/types.js +0 -86
  390. package/dist/phases/diagram-shared/clone-repos.d.ts +0 -63
  391. package/dist/phases/diagram-shared/clone-repos.js +0 -153
  392. package/dist/phases/diagram-shared/generate.d.ts +0 -42
  393. package/dist/phases/diagram-shared/generate.js +0 -162
  394. package/dist/phases/diagram-shared/graph.d.ts +0 -62
  395. package/dist/phases/diagram-shared/graph.js +0 -169
  396. package/dist/phases/diagram-shared/mcp.d.ts +0 -35
  397. package/dist/phases/diagram-shared/mcp.js +0 -68
  398. package/dist/phases/diagram-shared/prompts.d.ts +0 -23
  399. package/dist/phases/diagram-shared/prompts.js +0 -35
  400. package/dist/phases/discover-services/index.d.ts +0 -29
  401. package/dist/phases/discover-services/index.js +0 -528
  402. package/dist/phases/er-diagram/index.d.ts +0 -28
  403. package/dist/phases/er-diagram/index.js +0 -290
  404. package/dist/phases/er-diagram/mcp-server.d.ts +0 -77
  405. package/dist/phases/er-diagram/mcp-server.js +0 -144
  406. package/dist/phases/er-diagram/prompts.d.ts +0 -14
  407. package/dist/phases/er-diagram/prompts.js +0 -36
  408. package/dist/phases/er-diagram/types.d.ts +0 -76
  409. package/dist/phases/er-diagram/types.js +0 -84
  410. package/dist/phases/features/index.d.ts +0 -65
  411. package/dist/phases/features/index.js +0 -292
  412. package/dist/phases/features/mcp-server.d.ts +0 -61
  413. package/dist/phases/features/mcp-server.js +0 -165
  414. package/dist/phases/features/prompts.d.ts +0 -32
  415. package/dist/phases/features/prompts.js +0 -92
  416. package/dist/phases/features/types.d.ts +0 -34
  417. package/dist/phases/features/types.js +0 -15
  418. package/dist/phases/financing-deck/agent.d.ts +0 -1
  419. package/dist/phases/financing-deck/agent.js +0 -96
  420. package/dist/phases/financing-deck/context.d.ts +0 -13
  421. package/dist/phases/financing-deck/context.js +0 -69
  422. package/dist/phases/financing-deck/index.d.ts +0 -15
  423. package/dist/phases/financing-deck/index.js +0 -89
  424. package/dist/phases/financing-deck/prompts.d.ts +0 -2
  425. package/dist/phases/financing-deck/prompts.js +0 -94
  426. package/dist/phases/find-architecture/index.d.ts +0 -47
  427. package/dist/phases/find-architecture/index.js +0 -268
  428. package/dist/phases/find-architecture/prompts.d.ts +0 -32
  429. package/dist/phases/find-architecture/prompts.js +0 -129
  430. package/dist/phases/find-architecture/state.d.ts +0 -21
  431. package/dist/phases/find-architecture/state.js +0 -17
  432. package/dist/phases/find-architecture/types.d.ts +0 -55
  433. package/dist/phases/find-architecture/types.js +0 -69
  434. package/dist/phases/find-bugs/index.d.ts +0 -33
  435. package/dist/phases/find-bugs/index.js +0 -238
  436. package/dist/phases/find-bugs/prompts.d.ts +0 -22
  437. package/dist/phases/find-bugs/prompts.js +0 -101
  438. package/dist/phases/find-bugs/state.d.ts +0 -19
  439. package/dist/phases/find-bugs/state.js +0 -13
  440. package/dist/phases/find-bugs/types.d.ts +0 -21
  441. package/dist/phases/find-bugs/types.js +0 -16
  442. package/dist/phases/find-features/index.d.ts +0 -40
  443. package/dist/phases/find-features/index.js +0 -328
  444. package/dist/phases/find-features/prompts.d.ts +0 -43
  445. package/dist/phases/find-features/prompts.js +0 -138
  446. package/dist/phases/find-features/state.d.ts +0 -25
  447. package/dist/phases/find-features/state.js +0 -22
  448. package/dist/phases/find-features/types.d.ts +0 -27
  449. package/dist/phases/find-features/types.js +0 -16
  450. package/dist/phases/find-shared/baseline.d.ts +0 -45
  451. package/dist/phases/find-shared/baseline.js +0 -56
  452. package/dist/phases/find-shared/custom-rules.d.ts +0 -39
  453. package/dist/phases/find-shared/custom-rules.js +0 -75
  454. package/dist/phases/find-shared/detect-context.d.ts +0 -40
  455. package/dist/phases/find-shared/detect-context.js +0 -247
  456. package/dist/phases/find-shared/git.d.ts +0 -24
  457. package/dist/phases/find-shared/git.js +0 -60
  458. package/dist/phases/find-shared/mcp.d.ts +0 -54
  459. package/dist/phases/find-shared/mcp.js +0 -127
  460. package/dist/phases/find-shared/rule-config.d.ts +0 -37
  461. package/dist/phases/find-shared/rule-config.js +0 -67
  462. package/dist/phases/find-shared/rule-packs.d.ts +0 -65
  463. package/dist/phases/find-shared/rule-packs.js +0 -124
  464. package/dist/phases/find-shared/scan-state.d.ts +0 -33
  465. package/dist/phases/find-shared/scan-state.js +0 -112
  466. package/dist/phases/find-shared/scoped-read.d.ts +0 -12
  467. package/dist/phases/find-shared/scoped-read.js +0 -33
  468. package/dist/phases/find-smells/index.d.ts +0 -50
  469. package/dist/phases/find-smells/index.js +0 -305
  470. package/dist/phases/find-smells/prompts.d.ts +0 -31
  471. package/dist/phases/find-smells/prompts.js +0 -130
  472. package/dist/phases/find-smells/state.d.ts +0 -21
  473. package/dist/phases/find-smells/state.js +0 -17
  474. package/dist/phases/find-smells/types.d.ts +0 -51
  475. package/dist/phases/find-smells/types.js +0 -64
  476. package/dist/phases/flow-shared/clone-repos.d.ts +0 -63
  477. package/dist/phases/flow-shared/clone-repos.js +0 -153
  478. package/dist/phases/flowchart/index.d.ts +0 -15
  479. package/dist/phases/flowchart/index.js +0 -50
  480. package/dist/phases/functional-testing/analyzer.d.ts +0 -46
  481. package/dist/phases/functional-testing/analyzer.js +0 -622
  482. package/dist/phases/functional-testing/context-fetcher.d.ts +0 -16
  483. package/dist/phases/functional-testing/context-fetcher.js +0 -83
  484. package/dist/phases/functional-testing/http-fallback.d.ts +0 -10
  485. package/dist/phases/functional-testing/http-fallback.js +0 -156
  486. package/dist/phases/functional-testing/index.d.ts +0 -4
  487. package/dist/phases/functional-testing/index.js +0 -4
  488. package/dist/phases/functional-testing/mcp-server.d.ts +0 -9
  489. package/dist/phases/functional-testing/mcp-server.js +0 -13
  490. package/dist/phases/functional-testing/prompts.d.ts +0 -2
  491. package/dist/phases/functional-testing/prompts.js +0 -58
  492. package/dist/phases/functional-testing/test-report-creator.d.ts +0 -68
  493. package/dist/phases/functional-testing/test-report-creator.js +0 -306
  494. package/dist/phases/functional-testing/test-retry-handler.d.ts +0 -16
  495. package/dist/phases/functional-testing/test-retry-handler.js +0 -70
  496. package/dist/phases/growth-analysis/agent.d.ts +0 -2
  497. package/dist/phases/growth-analysis/agent.js +0 -107
  498. package/dist/phases/growth-analysis/context.d.ts +0 -23
  499. package/dist/phases/growth-analysis/context.js +0 -137
  500. package/dist/phases/growth-analysis/index.d.ts +0 -32
  501. package/dist/phases/growth-analysis/index.js +0 -226
  502. package/dist/phases/growth-analysis/prompts.d.ts +0 -2
  503. package/dist/phases/growth-analysis/prompts.js +0 -45
  504. package/dist/phases/intelligence-analysis/agent.d.ts +0 -2
  505. package/dist/phases/intelligence-analysis/agent.js +0 -338
  506. package/dist/phases/intelligence-analysis/context.d.ts +0 -23
  507. package/dist/phases/intelligence-analysis/context.js +0 -142
  508. package/dist/phases/intelligence-analysis/index.d.ts +0 -58
  509. package/dist/phases/intelligence-analysis/index.js +0 -244
  510. package/dist/phases/intelligence-analysis/prompts.d.ts +0 -2
  511. package/dist/phases/intelligence-analysis/prompts.js +0 -62
  512. package/dist/phases/issue-analysis/agent.d.ts +0 -21
  513. package/dist/phases/issue-analysis/agent.js +0 -153
  514. package/dist/phases/issue-analysis/context.d.ts +0 -20
  515. package/dist/phases/issue-analysis/context.js +0 -93
  516. package/dist/phases/issue-analysis/index.d.ts +0 -8
  517. package/dist/phases/issue-analysis/index.js +0 -147
  518. package/dist/phases/issue-analysis/outcome.d.ts +0 -10
  519. package/dist/phases/issue-analysis/outcome.js +0 -42
  520. package/dist/phases/issue-analysis/prompts.d.ts +0 -8
  521. package/dist/phases/issue-analysis/prompts.js +0 -99
  522. package/dist/phases/issue-analysis-verification/agent.d.ts +0 -33
  523. package/dist/phases/issue-analysis-verification/agent.js +0 -124
  524. package/dist/phases/issue-analysis-verification/index.d.ts +0 -27
  525. package/dist/phases/issue-analysis-verification/index.js +0 -79
  526. package/dist/phases/issue-analysis-verification/prompts.d.ts +0 -9
  527. package/dist/phases/issue-analysis-verification/prompts.js +0 -75
  528. package/dist/phases/output-contracts.d.ts +0 -7
  529. package/dist/phases/output-contracts.js +0 -1201
  530. package/dist/phases/pr-execution/context.d.ts +0 -32
  531. package/dist/phases/pr-execution/context.js +0 -246
  532. package/dist/phases/pr-execution/file-assigner.d.ts +0 -57
  533. package/dist/phases/pr-execution/file-assigner.js +0 -287
  534. package/dist/phases/pr-execution/index.d.ts +0 -22
  535. package/dist/phases/pr-execution/index.js +0 -401
  536. package/dist/phases/pr-execution/outcome.d.ts +0 -24
  537. package/dist/phases/pr-execution/outcome.js +0 -34
  538. package/dist/phases/pr-execution/pr-executor.d.ts +0 -42
  539. package/dist/phases/pr-execution/pr-executor.js +0 -78
  540. package/dist/phases/pr-execution/prompts.d.ts +0 -27
  541. package/dist/phases/pr-execution/prompts.js +0 -131
  542. package/dist/phases/pr-resolve/checklist-learner.d.ts +0 -28
  543. package/dist/phases/pr-resolve/checklist-learner.js +0 -153
  544. package/dist/phases/pr-resolve/github-reply.d.ts +0 -16
  545. package/dist/phases/pr-resolve/github-reply.js +0 -75
  546. package/dist/phases/pr-resolve/index.d.ts +0 -33
  547. package/dist/phases/pr-resolve/index.js +0 -272
  548. package/dist/phases/pr-resolve/prompts.d.ts +0 -17
  549. package/dist/phases/pr-resolve/prompts.js +0 -107
  550. package/dist/phases/pr-resolve/types.d.ts +0 -18
  551. package/dist/phases/pr-resolve/types.js +0 -14
  552. package/dist/phases/pr-resolve/workspace.d.ts +0 -45
  553. package/dist/phases/pr-resolve/workspace.js +0 -174
  554. package/dist/phases/pr-review/index.d.ts +0 -27
  555. package/dist/phases/pr-review/index.js +0 -209
  556. package/dist/phases/pr-review/prompts.d.ts +0 -5
  557. package/dist/phases/pr-review/prompts.js +0 -87
  558. package/dist/phases/pr-shared/agent-utils.d.ts +0 -47
  559. package/dist/phases/pr-shared/agent-utils.js +0 -112
  560. package/dist/phases/pr-shared/context.d.ts +0 -24
  561. package/dist/phases/pr-shared/context.js +0 -78
  562. package/dist/phases/pr-shared/status.d.ts +0 -18
  563. package/dist/phases/pr-shared/status.js +0 -37
  564. package/dist/phases/pr-splitting/context.d.ts +0 -28
  565. package/dist/phases/pr-splitting/context.js +0 -182
  566. package/dist/phases/pr-splitting/import-dep-validator.d.ts +0 -67
  567. package/dist/phases/pr-splitting/import-dep-validator.js +0 -255
  568. package/dist/phases/pr-splitting/index.d.ts +0 -36
  569. package/dist/phases/pr-splitting/index.js +0 -413
  570. package/dist/phases/pr-splitting/outcome.d.ts +0 -24
  571. package/dist/phases/pr-splitting/outcome.js +0 -114
  572. package/dist/phases/pr-splitting/prompts.d.ts +0 -43
  573. package/dist/phases/pr-splitting/prompts.js +0 -154
  574. package/dist/phases/product-techniques/index.d.ts +0 -52
  575. package/dist/phases/product-techniques/index.js +0 -268
  576. package/dist/phases/product-techniques/mcp-server.d.ts +0 -41
  577. package/dist/phases/product-techniques/mcp-server.js +0 -96
  578. package/dist/phases/product-techniques/prompts.d.ts +0 -19
  579. package/dist/phases/product-techniques/prompts.js +0 -66
  580. package/dist/phases/product-techniques/types.d.ts +0 -13
  581. package/dist/phases/product-techniques/types.js +0 -13
  582. package/dist/phases/product-test-cases/index.d.ts +0 -25
  583. package/dist/phases/product-test-cases/index.js +0 -174
  584. package/dist/phases/product-test-cases/prompts.d.ts +0 -24
  585. package/dist/phases/product-test-cases/prompts.js +0 -80
  586. package/dist/phases/product-test-cases/types.d.ts +0 -17
  587. package/dist/phases/product-test-cases/types.js +0 -27
  588. package/dist/phases/pull-request/creator.d.ts +0 -30
  589. package/dist/phases/pull-request/creator.js +0 -319
  590. package/dist/phases/pull-request/handler.d.ts +0 -15
  591. package/dist/phases/pull-request/handler.js +0 -92
  592. package/dist/phases/quality-benchmark/gate.d.ts +0 -50
  593. package/dist/phases/quality-benchmark/gate.js +0 -91
  594. package/dist/phases/quality-benchmark/index.d.ts +0 -65
  595. package/dist/phases/quality-benchmark/index.js +0 -208
  596. package/dist/phases/quality-benchmark/mcp-server.d.ts +0 -46
  597. package/dist/phases/quality-benchmark/mcp-server.js +0 -252
  598. package/dist/phases/quality-benchmark/parsers.d.ts +0 -45
  599. package/dist/phases/quality-benchmark/parsers.js +0 -1311
  600. package/dist/phases/quality-benchmark/prompts.d.ts +0 -31
  601. package/dist/phases/quality-benchmark/prompts.js +0 -154
  602. package/dist/phases/quality-benchmark/rubric.md +0 -1211
  603. package/dist/phases/quality-benchmark/tool-catalog.d.ts +0 -33
  604. package/dist/phases/quality-benchmark/tool-catalog.js +0 -693
  605. package/dist/phases/quality-benchmark/tool-runner.d.ts +0 -69
  606. package/dist/phases/quality-benchmark/tool-runner.js +0 -399
  607. package/dist/phases/quality-benchmark/types.d.ts +0 -319
  608. package/dist/phases/quality-benchmark/types.js +0 -23
  609. package/dist/phases/quality-benchmark/workspace.d.ts +0 -31
  610. package/dist/phases/quality-benchmark/workspace.js +0 -110
  611. package/dist/phases/recipes/index.d.ts +0 -63
  612. package/dist/phases/recipes/index.js +0 -358
  613. package/dist/phases/recipes/mcp-server.d.ts +0 -66
  614. package/dist/phases/recipes/mcp-server.js +0 -229
  615. package/dist/phases/recipes/prompts.d.ts +0 -35
  616. package/dist/phases/recipes/prompts.js +0 -105
  617. package/dist/phases/recipes/types.d.ts +0 -42
  618. package/dist/phases/recipes/types.js +0 -16
  619. package/dist/phases/release-sync/github.d.ts +0 -66
  620. package/dist/phases/release-sync/github.js +0 -140
  621. package/dist/phases/release-sync/index.d.ts +0 -24
  622. package/dist/phases/release-sync/index.js +0 -156
  623. package/dist/phases/release-sync/snapshot.d.ts +0 -27
  624. package/dist/phases/release-sync/snapshot.js +0 -158
  625. package/dist/phases/run-sheet/agent.d.ts +0 -49
  626. package/dist/phases/run-sheet/agent.js +0 -156
  627. package/dist/phases/run-sheet/index.d.ts +0 -57
  628. package/dist/phases/run-sheet/index.js +0 -392
  629. package/dist/phases/screen-flow/index.d.ts +0 -26
  630. package/dist/phases/screen-flow/index.js +0 -349
  631. package/dist/phases/screen-flow/mcp-server.d.ts +0 -201
  632. package/dist/phases/screen-flow/mcp-server.js +0 -272
  633. package/dist/phases/screen-flow/prompts.d.ts +0 -19
  634. package/dist/phases/screen-flow/prompts.js +0 -43
  635. package/dist/phases/screen-flow/theme.d.ts +0 -19
  636. package/dist/phases/screen-flow/theme.js +0 -193
  637. package/dist/phases/screen-flow/types.d.ts +0 -137
  638. package/dist/phases/screen-flow/types.js +0 -81
  639. package/dist/phases/sequence-diagram/index.d.ts +0 -30
  640. package/dist/phases/sequence-diagram/index.js +0 -290
  641. package/dist/phases/sequence-diagram/mcp-server.d.ts +0 -64
  642. package/dist/phases/sequence-diagram/mcp-server.js +0 -134
  643. package/dist/phases/sequence-diagram/prompts.d.ts +0 -14
  644. package/dist/phases/sequence-diagram/prompts.js +0 -36
  645. package/dist/phases/sequence-diagram/types.d.ts +0 -52
  646. package/dist/phases/sequence-diagram/types.js +0 -93
  647. package/dist/phases/smoke-test/agent.d.ts +0 -12
  648. package/dist/phases/smoke-test/agent.js +0 -93
  649. package/dist/phases/smoke-test/index.d.ts +0 -22
  650. package/dist/phases/smoke-test/index.js +0 -241
  651. package/dist/phases/smoke-test/prompts.d.ts +0 -15
  652. package/dist/phases/smoke-test/prompts.js +0 -35
  653. package/dist/phases/state-diagram/index.d.ts +0 -15
  654. package/dist/phases/state-diagram/index.js +0 -53
  655. package/dist/phases/sync-github-issues/index.d.ts +0 -41
  656. package/dist/phases/sync-github-issues/index.js +0 -187
  657. package/dist/phases/sync-github-issues/state.d.ts +0 -26
  658. package/dist/phases/sync-github-issues/state.js +0 -18
  659. package/dist/phases/sync-github-issues/types.d.ts +0 -35
  660. package/dist/phases/sync-github-issues/types.js +0 -6
  661. package/dist/phases/sync-github-pull-requests/index.d.ts +0 -23
  662. package/dist/phases/sync-github-pull-requests/index.js +0 -210
  663. package/dist/phases/sync-github-pull-requests/state.d.ts +0 -24
  664. package/dist/phases/sync-github-pull-requests/state.js +0 -16
  665. package/dist/phases/sync-github-pull-requests/types.d.ts +0 -22
  666. package/dist/phases/sync-github-pull-requests/types.js +0 -1
  667. package/dist/phases/sync-org-repos/index.d.ts +0 -28
  668. package/dist/phases/sync-org-repos/index.js +0 -133
  669. package/dist/phases/sync-sentry-issues/index.d.ts +0 -29
  670. package/dist/phases/sync-sentry-issues/index.js +0 -153
  671. package/dist/phases/sync-sentry-issues/sentry-client.d.ts +0 -66
  672. package/dist/phases/sync-sentry-issues/sentry-client.js +0 -221
  673. package/dist/phases/sync-sentry-issues/state.d.ts +0 -23
  674. package/dist/phases/sync-sentry-issues/state.js +0 -18
  675. package/dist/phases/sync-sentry-issues/types.d.ts +0 -46
  676. package/dist/phases/sync-sentry-issues/types.js +0 -6
  677. package/dist/phases/sync-shared/mcp.d.ts +0 -81
  678. package/dist/phases/sync-shared/mcp.js +0 -111
  679. package/dist/phases/task/agent.d.ts +0 -10
  680. package/dist/phases/task/agent.js +0 -83
  681. package/dist/phases/task/context.d.ts +0 -16
  682. package/dist/phases/task/context.js +0 -50
  683. package/dist/phases/task/index.d.ts +0 -17
  684. package/dist/phases/task/index.js +0 -54
  685. package/dist/phases/task/prompts.d.ts +0 -9
  686. package/dist/phases/task/prompts.js +0 -21
  687. package/dist/phases/technical-design/context.d.ts +0 -12
  688. package/dist/phases/technical-design/context.js +0 -39
  689. package/dist/phases/technical-design/index.d.ts +0 -21
  690. package/dist/phases/technical-design/index.js +0 -456
  691. package/dist/phases/technical-design/outcome.d.ts +0 -25
  692. package/dist/phases/technical-design/outcome.js +0 -41
  693. package/dist/phases/technical-design/prompts.d.ts +0 -8
  694. package/dist/phases/technical-design/prompts.js +0 -210
  695. package/dist/phases/technical-design-verification/agent.d.ts +0 -53
  696. package/dist/phases/technical-design-verification/agent.js +0 -186
  697. package/dist/phases/technical-design-verification/index.d.ts +0 -38
  698. package/dist/phases/technical-design-verification/index.js +0 -152
  699. package/dist/phases/technical-design-verification/prompts.d.ts +0 -12
  700. package/dist/phases/technical-design-verification/prompts.js +0 -143
  701. package/dist/phases/test-cases-analysis/agent.d.ts +0 -9
  702. package/dist/phases/test-cases-analysis/agent.js +0 -105
  703. package/dist/phases/test-cases-analysis/context.d.ts +0 -15
  704. package/dist/phases/test-cases-analysis/context.js +0 -86
  705. package/dist/phases/test-cases-analysis/formatters.d.ts +0 -6
  706. package/dist/phases/test-cases-analysis/formatters.js +0 -35
  707. package/dist/phases/test-cases-analysis/index.d.ts +0 -9
  708. package/dist/phases/test-cases-analysis/index.js +0 -175
  709. package/dist/phases/test-cases-analysis/outcome.d.ts +0 -27
  710. package/dist/phases/test-cases-analysis/outcome.js +0 -146
  711. package/dist/phases/test-cases-analysis/prompts.d.ts +0 -7
  712. package/dist/phases/test-cases-analysis/prompts.js +0 -171
  713. package/dist/phases/user-psychology/agent.d.ts +0 -16
  714. package/dist/phases/user-psychology/agent.js +0 -105
  715. package/dist/phases/user-psychology/context.d.ts +0 -10
  716. package/dist/phases/user-psychology/context.js +0 -65
  717. package/dist/phases/user-psychology/index.d.ts +0 -18
  718. package/dist/phases/user-psychology/index.js +0 -96
  719. package/dist/phases/user-psychology/prompts.d.ts +0 -2
  720. package/dist/phases/user-psychology/prompts.js +0 -41
  721. package/dist/phases/user-stories-analysis/agent.d.ts +0 -9
  722. package/dist/phases/user-stories-analysis/agent.js +0 -105
  723. package/dist/phases/user-stories-analysis/context.d.ts +0 -15
  724. package/dist/phases/user-stories-analysis/context.js +0 -86
  725. package/dist/phases/user-stories-analysis/formatters.d.ts +0 -6
  726. package/dist/phases/user-stories-analysis/formatters.js +0 -32
  727. package/dist/phases/user-stories-analysis/index.d.ts +0 -9
  728. package/dist/phases/user-stories-analysis/index.js +0 -175
  729. package/dist/phases/user-stories-analysis/outcome.d.ts +0 -27
  730. package/dist/phases/user-stories-analysis/outcome.js +0 -146
  731. package/dist/phases/user-stories-analysis/prompts.d.ts +0 -7
  732. package/dist/phases/user-stories-analysis/prompts.js +0 -194
  733. package/dist/services/audit-logs.d.ts +0 -73
  734. package/dist/services/audit-logs.js +0 -174
  735. package/dist/services/branches.d.ts +0 -103
  736. package/dist/services/branches.js +0 -391
  737. package/dist/services/checklist.d.ts +0 -100
  738. package/dist/services/checklist.js +0 -259
  739. package/dist/services/coaching/coaching-agent.d.ts +0 -39
  740. package/dist/services/coaching/coaching-agent.js +0 -308
  741. package/dist/services/coaching/coaching-loop.d.ts +0 -62
  742. package/dist/services/coaching/coaching-loop.js +0 -265
  743. package/dist/services/coaching/index.d.ts +0 -8
  744. package/dist/services/coaching/index.js +0 -8
  745. package/dist/services/coaching/phase-coaching.d.ts +0 -47
  746. package/dist/services/coaching/phase-coaching.js +0 -60
  747. package/dist/services/coaching/self-rating.d.ts +0 -26
  748. package/dist/services/coaching/self-rating.js +0 -153
  749. package/dist/services/feedbacks.d.ts +0 -57
  750. package/dist/services/feedbacks.js +0 -264
  751. package/dist/services/phase-hooks/bindings-fetcher.d.ts +0 -21
  752. package/dist/services/phase-hooks/bindings-fetcher.js +0 -53
  753. package/dist/services/phase-hooks/hook-executor.d.ts +0 -36
  754. package/dist/services/phase-hooks/hook-executor.js +0 -167
  755. package/dist/services/phase-hooks/hook-logging.d.ts +0 -14
  756. package/dist/services/phase-hooks/hook-logging.js +0 -41
  757. package/dist/services/phase-hooks/hook-runner.d.ts +0 -19
  758. package/dist/services/phase-hooks/hook-runner.js +0 -83
  759. package/dist/services/phase-hooks/index.d.ts +0 -10
  760. package/dist/services/phase-hooks/index.js +0 -9
  761. package/dist/services/phase-hooks/plugin-loader.d.ts +0 -31
  762. package/dist/services/phase-hooks/plugin-loader.js +0 -207
  763. package/dist/services/phase-hooks/types.d.ts +0 -69
  764. package/dist/services/phase-hooks/types.js +0 -8
  765. package/dist/services/phase-ratings.d.ts +0 -70
  766. package/dist/services/phase-ratings.js +0 -143
  767. package/dist/services/product-logs.d.ts +0 -31
  768. package/dist/services/product-logs.js +0 -94
  769. package/dist/services/pull-requests.d.ts +0 -57
  770. package/dist/services/pull-requests.js +0 -186
  771. package/dist/services/quality-reports.d.ts +0 -45
  772. package/dist/services/quality-reports.js +0 -93
  773. package/dist/services/repo-config.d.ts +0 -17
  774. package/dist/services/repo-config.js +0 -50
  775. package/dist/services/skill-resolver.d.ts +0 -46
  776. package/dist/services/skill-resolver.js +0 -123
  777. package/dist/services/video/device-frames.d.ts +0 -34
  778. package/dist/services/video/device-frames.js +0 -513
  779. package/dist/services/video/index.d.ts +0 -66
  780. package/dist/services/video/index.js +0 -238
  781. package/dist/services/video/retry.d.ts +0 -20
  782. package/dist/services/video/retry.js +0 -76
  783. package/dist/services/video/screenshot-generator.d.ts +0 -69
  784. package/dist/services/video/screenshot-generator.js +0 -259
  785. package/dist/services/video/tts-generator.d.ts +0 -40
  786. package/dist/services/video/tts-generator.js +0 -121
  787. package/dist/services/video/video-assembler.d.ts +0 -45
  788. package/dist/services/video/video-assembler.js +0 -351
  789. package/dist/services/video/video-uploader.d.ts +0 -28
  790. package/dist/services/video/video-uploader.js +0 -108
  791. package/dist/skills/phase/adr-generation/SKILL.md +0 -51
  792. package/dist/skills/phase/analyze-logs/SKILL.md +0 -24
  793. package/dist/skills/phase/app-store-generation/SKILL.md +0 -60
  794. package/dist/skills/phase/architecture-diagram/SKILL.md +0 -41
  795. package/dist/skills/phase/autonomous/SKILL.md +0 -52
  796. package/dist/skills/phase/branch-planning/SKILL.md +0 -55
  797. package/dist/skills/phase/bug-fixing/SKILL.md +0 -47
  798. package/dist/skills/phase/class-diagram/SKILL.md +0 -44
  799. package/dist/skills/phase/code-implementation/SKILL.md +0 -68
  800. package/dist/skills/phase/code-implementation-verification/SKILL.md +0 -76
  801. package/dist/skills/phase/code-refine/SKILL.md +0 -62
  802. package/dist/skills/phase/code-testing/SKILL.md +0 -78
  803. package/dist/skills/phase/data-flow/SKILL.md +0 -82
  804. package/dist/skills/phase/er-diagram/SKILL.md +0 -71
  805. package/dist/skills/phase/flowchart/SKILL.md +0 -38
  806. package/dist/skills/phase/functional-testing/SKILL.md +0 -62
  807. package/dist/skills/phase/growth-analysis/SKILL.md +0 -97
  808. package/dist/skills/phase/incremental-sync/SKILL.md +0 -59
  809. package/dist/skills/phase/intelligence-analysis/SKILL.md +0 -52
  810. package/dist/skills/phase/issue-analysis/SKILL.md +0 -73
  811. package/dist/skills/phase/issue-analysis-verification/SKILL.md +0 -61
  812. package/dist/skills/phase/pr-execution/SKILL.md +0 -69
  813. package/dist/skills/phase/pr-splitting/SKILL.md +0 -78
  814. package/dist/skills/phase/screen-flow/SKILL.md +0 -78
  815. package/dist/skills/phase/sequence-diagram/SKILL.md +0 -67
  816. package/dist/skills/phase/smoke-test/SKILL.md +0 -80
  817. package/dist/skills/phase/state-diagram/SKILL.md +0 -38
  818. package/dist/skills/phase/task/SKILL.md +0 -19
  819. package/dist/skills/phase/technical-design/SKILL.md +0 -75
  820. package/dist/skills/phase/technical-design-verification/SKILL.md +0 -43
  821. package/dist/skills/phase/test-cases-analysis/SKILL.md +0 -88
  822. package/dist/skills/phase/user-psychology/SKILL.md +0 -135
  823. package/dist/skills/phase/user-stories-analysis/SKILL.md +0 -118
  824. package/dist/supabase/client.d.ts +0 -34
  825. package/dist/supabase/client.js +0 -123
  826. package/dist/system/session-manager.d.ts +0 -67
  827. package/dist/system/session-manager.js +0 -300
  828. package/dist/system/sleep-notification.d.ts +0 -15
  829. package/dist/system/sleep-notification.js +0 -108
  830. package/dist/system/sleep-prevention.d.ts +0 -20
  831. package/dist/system/sleep-prevention.js +0 -112
  832. package/dist/tools/bootstrap.d.ts +0 -45
  833. package/dist/tools/bootstrap.js +0 -50
  834. package/dist/types/external-sources.d.ts +0 -22
  835. package/dist/types/external-sources.js +0 -23
  836. package/dist/types/index.d.ts +0 -206
  837. package/dist/types/index.js +0 -1
  838. package/dist/types/issues.d.ts +0 -37
  839. package/dist/types/issues.js +0 -1
  840. package/dist/types/llm-responses.d.ts +0 -114
  841. package/dist/types/llm-responses.js +0 -9
  842. package/dist/types/pipeline.d.ts +0 -28
  843. package/dist/types/pipeline.js +0 -4
  844. package/dist/updater/auto-updater.d.ts +0 -39
  845. package/dist/updater/auto-updater.js +0 -134
  846. package/dist/utils/conflict-resolver.d.ts +0 -49
  847. package/dist/utils/conflict-resolver.js +0 -201
  848. package/dist/utils/formatters.d.ts +0 -42
  849. package/dist/utils/formatters.js +0 -166
  850. package/dist/utils/git-branch-manager-async.d.ts +0 -127
  851. package/dist/utils/git-branch-manager-async.js +0 -425
  852. package/dist/utils/git-branch-manager.d.ts +0 -160
  853. package/dist/utils/git-branch-manager.js +0 -613
  854. package/dist/utils/git-push.d.ts +0 -43
  855. package/dist/utils/git-push.js +0 -136
  856. package/dist/utils/github-repo-info.d.ts +0 -26
  857. package/dist/utils/github-repo-info.js +0 -45
  858. package/dist/utils/image-downloader.d.ts +0 -32
  859. package/dist/utils/image-downloader.js +0 -152
  860. package/dist/utils/issue-phase-cli.d.ts +0 -26
  861. package/dist/utils/issue-phase-cli.js +0 -44
  862. package/dist/utils/json-extract.d.ts +0 -6
  863. package/dist/utils/json-extract.js +0 -44
  864. package/dist/utils/json-extractor.d.ts +0 -27
  865. package/dist/utils/json-extractor.js +0 -102
  866. package/dist/utils/logger.d.ts +0 -35
  867. package/dist/utils/logger.js +0 -167
  868. package/dist/utils/pipeline-logger.d.ts +0 -8
  869. package/dist/utils/pipeline-logger.js +0 -38
  870. package/dist/utils/validation.d.ts +0 -68
  871. package/dist/utils/validation.js +0 -229
  872. package/dist/utils/workflow-utils.d.ts +0 -22
  873. package/dist/utils/workflow-utils.js +0 -48
  874. package/dist/workspace/session-workspace.d.ts +0 -43
  875. package/dist/workspace/session-workspace.js +0 -90
  876. package/dist/workspace/workspace-manager.d.ts +0 -105
  877. package/dist/workspace/workspace-manager.js +0 -280
@@ -1,1311 +0,0 @@
1
- /**
2
- * Tool output parsers. Each parser extracts the minimum information the
3
- * LLM needs to score the dimension — either counts (Tier 1), counts plus
4
- * top findings (Tier 2), or domain-specific metrics (Tier 3).
5
- *
6
- * Full raw outputs are saved to disk by the tool-runner and never enter
7
- * the LLM context — these parsers operate on the stdout/stderr strings
8
- * captured during execution.
9
- *
10
- * Severity mapping:
11
- * tool-specific → our 4-tier enum (critical | high | medium | low)
12
- *
13
- * All parsers must be:
14
- * - Defensive: never throw. Return `parsed: false` (via a counts-zero
15
- * summary) if the output is malformed.
16
- * - Cheap: simple JSON parse + small map. No regex over megabytes.
17
- * - Stable: same input → same output (no randomness, no clocks).
18
- */
19
- import { TOOL_CATALOG_BY_ID } from './tool-catalog.js';
20
- // ---------------------------------------------------------------------------
21
- // Helpers
22
- // ---------------------------------------------------------------------------
23
- function safeJson(s) {
24
- if (!s) {
25
- return null;
26
- }
27
- try {
28
- return JSON.parse(s);
29
- }
30
- catch {
31
- return null;
32
- }
33
- }
34
- /**
35
- * Parse a newline-delimited JSON stream (one JSON value per line).
36
- * Used by cargo clippy --message-format json and govulncheck -json.
37
- */
38
- function safeJsonLines(s) {
39
- if (!s) {
40
- return [];
41
- }
42
- const out = [];
43
- for (const line of s.split(/\r?\n/)) {
44
- const trimmed = line.trim();
45
- if (!trimmed || (trimmed[0] !== '{' && trimmed[0] !== '[')) {
46
- continue;
47
- }
48
- try {
49
- out.push(JSON.parse(trimmed));
50
- }
51
- catch {
52
- // skip non-JSON lines (some tools mix banners with JSON)
53
- }
54
- }
55
- return out;
56
- }
57
- /** First subscore from the catalog for a tool id (used as the finding tag). */
58
- function primarySubscore(toolId) {
59
- const entry = TOOL_CATALOG_BY_ID.get(toolId);
60
- if (!entry || entry.subscores.length === 0) {
61
- return 'code_quality.lint';
62
- }
63
- return entry.subscores[0];
64
- }
65
- function clampSnippet(s) {
66
- if (!s) {
67
- return undefined;
68
- }
69
- return s.length > 200 ? `${s.slice(0, 197)}...` : s;
70
- }
71
- function severityRank(s) {
72
- return s === 'critical' ? 4 : s === 'high' ? 3 : s === 'medium' ? 2 : 1;
73
- }
74
- function topBySeverity(findings, n = 10) {
75
- return [...findings]
76
- .sort((a, b) => severityRank(b.severity) - severityRank(a.severity))
77
- .slice(0, n);
78
- }
79
- function countBySeverity(findings) {
80
- const c = { critical: 0, high: 0, medium: 0, low: 0, total: findings.length };
81
- for (const f of findings) {
82
- c[f.severity]++;
83
- }
84
- return c;
85
- }
86
- function emptyCounts() {
87
- return {
88
- tool_id: 'unknown',
89
- summary: { tier: 'counts', counts: { errors: 0, warnings: 0, info: 0 } },
90
- oneliner: 'no output parsed',
91
- };
92
- }
93
- function relPath(file, ctx) {
94
- if (file.startsWith(ctx.repo_root)) {
95
- return file.slice(ctx.repo_root.length).replace(/^[/\\]/, '');
96
- }
97
- return file;
98
- }
99
- // ---------------------------------------------------------------------------
100
- // Tier 1 — counts only
101
- // ---------------------------------------------------------------------------
102
- const eslintParser = (stdout) => {
103
- const data = safeJson(stdout);
104
- if (!Array.isArray(data)) {
105
- return { ...emptyCounts(), tool_id: 'eslint' };
106
- }
107
- let errors = 0;
108
- let warnings = 0;
109
- for (const file of data) {
110
- for (const m of file.messages ?? []) {
111
- if (m.severity === 2) {
112
- errors++;
113
- }
114
- else if (m.severity === 1) {
115
- warnings++;
116
- }
117
- }
118
- }
119
- return {
120
- tool_id: 'eslint',
121
- summary: { tier: 'counts', counts: { errors, warnings, info: 0 } },
122
- oneliner: `${errors} errors, ${warnings} warnings`,
123
- };
124
- };
125
- const tscParser = (stdout, stderr) => {
126
- const body = `${stdout}\n${stderr}`;
127
- const errorLines = body.match(/^[^\n]*error TS\d+/gm) ?? [];
128
- const errors = errorLines.length;
129
- return {
130
- tool_id: 'tsc-typecheck',
131
- summary: { tier: 'counts', counts: { errors, warnings: 0, info: 0 } },
132
- oneliner: `${errors} type errors`,
133
- };
134
- };
135
- const ruffParser = (stdout) => {
136
- const data = safeJson(stdout);
137
- if (!Array.isArray(data)) {
138
- return { ...emptyCounts(), tool_id: 'ruff' };
139
- }
140
- let errors = 0;
141
- let warnings = 0;
142
- for (const v of data) {
143
- const code = v.code ?? '';
144
- // E/F prefix in ruff (and most flake8-like tools) = error severity.
145
- if (/^[EF]/.test(code)) {
146
- errors++;
147
- }
148
- else {
149
- warnings++;
150
- }
151
- }
152
- return {
153
- tool_id: 'ruff',
154
- summary: { tier: 'counts', counts: { errors, warnings, info: 0 } },
155
- oneliner: `${errors} errors, ${warnings} warnings`,
156
- };
157
- };
158
- const mypyParser = (stdout) => {
159
- const lines = stdout.split(/\r?\n/);
160
- let errors = 0;
161
- let warnings = 0;
162
- let info = 0;
163
- for (const line of lines) {
164
- if (/:\s*error:/.test(line)) {
165
- errors++;
166
- }
167
- else if (/:\s*warning:/.test(line)) {
168
- warnings++;
169
- }
170
- else if (/:\s*note:/.test(line)) {
171
- info++;
172
- }
173
- }
174
- return {
175
- tool_id: 'mypy',
176
- summary: { tier: 'counts', counts: { errors, warnings, info } },
177
- oneliner: `${errors} errors, ${warnings} warnings`,
178
- };
179
- };
180
- const golangciLintParser = (stdout) => {
181
- const data = safeJson(stdout);
182
- const issues = data?.Issues ?? [];
183
- let errors = 0;
184
- let warnings = 0;
185
- for (const i of issues) {
186
- if ((i.Severity ?? '').toLowerCase() === 'error') {
187
- errors++;
188
- }
189
- else {
190
- warnings++;
191
- }
192
- }
193
- return {
194
- tool_id: 'golangci-lint',
195
- summary: { tier: 'counts', counts: { errors, warnings, info: 0 } },
196
- oneliner: `${errors} errors, ${warnings} warnings`,
197
- };
198
- };
199
- const clippyParser = (stdout) => {
200
- const events = safeJsonLines(stdout);
201
- let errors = 0;
202
- let warnings = 0;
203
- for (const e of events) {
204
- if (e.reason !== 'compiler-message') {
205
- continue;
206
- }
207
- const lvl = e.message?.level;
208
- if (lvl === 'error' || lvl === 'error: internal compiler error') {
209
- errors++;
210
- }
211
- else if (lvl === 'warning') {
212
- warnings++;
213
- }
214
- }
215
- return {
216
- tool_id: 'clippy',
217
- summary: { tier: 'counts', counts: { errors, warnings, info: 0 } },
218
- oneliner: `${errors} errors, ${warnings} warnings`,
219
- };
220
- };
221
- const rubocopParser = (stdout) => {
222
- const data = safeJson(stdout);
223
- if (!data) {
224
- return { ...emptyCounts(), tool_id: 'rubocop' };
225
- }
226
- let errors = 0;
227
- let warnings = 0;
228
- for (const f of data.files ?? []) {
229
- for (const o of f.offenses ?? []) {
230
- const sev = (o.severity ?? '').toLowerCase();
231
- if (sev === 'error' || sev === 'fatal') {
232
- errors++;
233
- }
234
- else {
235
- warnings++;
236
- }
237
- }
238
- }
239
- return {
240
- tool_id: 'rubocop',
241
- summary: { tier: 'counts', counts: { errors, warnings, info: 0 } },
242
- oneliner: `${errors} errors, ${warnings} warnings`,
243
- };
244
- };
245
- const depcheckParser = (stdout) => {
246
- const data = safeJson(stdout);
247
- if (!data) {
248
- return { ...emptyCounts(), tool_id: 'depcheck' };
249
- }
250
- const unused = (data.dependencies?.length ?? 0) + (data.devDependencies?.length ?? 0);
251
- return {
252
- tool_id: 'depcheck',
253
- summary: {
254
- tier: 'counts',
255
- counts: { errors: unused, warnings: 0, info: 0 },
256
- },
257
- oneliner: `${unused} unused dependencies`,
258
- };
259
- };
260
- const npmOutdatedParser = (stdout) => {
261
- const data = safeJson(stdout);
262
- if (!data) {
263
- return {
264
- tool_id: 'npm-outdated',
265
- summary: { tier: 'counts', counts: { errors: 0, warnings: 0, info: 0 } },
266
- oneliner: 'no outdated dependencies',
267
- };
268
- }
269
- const count = Object.keys(data).length;
270
- return {
271
- tool_id: 'npm-outdated',
272
- summary: {
273
- tier: 'counts',
274
- counts: { errors: 0, warnings: count, info: 0 },
275
- },
276
- oneliner: `${count} outdated dependencies`,
277
- };
278
- };
279
- const goModOutdatedParser = (stdout) => {
280
- const items = safeJsonLines(stdout);
281
- const count = items.filter((i) => i.Update).length;
282
- return {
283
- tool_id: 'go-mod-outdated',
284
- summary: {
285
- tier: 'counts',
286
- counts: { errors: 0, warnings: count, info: 0 },
287
- },
288
- oneliner: `${count} outdated modules`,
289
- };
290
- };
291
- const cargoOutdatedParser = (stdout) => {
292
- const data = safeJson(stdout);
293
- const items = data?.dependencies ?? [];
294
- const count = items.filter((d) => d.project && d.latest && d.project !== d.latest).length;
295
- return {
296
- tool_id: 'cargo-outdated',
297
- summary: {
298
- tier: 'counts',
299
- counts: { errors: 0, warnings: count, info: 0 },
300
- },
301
- oneliner: `${count} outdated crates`,
302
- };
303
- };
304
- const dotnetListOutdatedParser = (stdout) => {
305
- // `dotnet list package --outdated --format json` →
306
- // { projects: [{ frameworks: [{ topLevelPackages: [{ resolvedVersion, latestVersion }] }] }] }
307
- const data = safeJson(stdout);
308
- let count = 0;
309
- for (const proj of data?.projects ?? []) {
310
- for (const fw of proj.frameworks ?? []) {
311
- for (const pkg of fw.topLevelPackages ?? []) {
312
- if (pkg.latestVersion &&
313
- pkg.resolvedVersion &&
314
- pkg.latestVersion !== pkg.resolvedVersion) {
315
- count++;
316
- }
317
- }
318
- }
319
- }
320
- return {
321
- tool_id: 'dotnet-list-outdated',
322
- summary: {
323
- tier: 'counts',
324
- counts: { errors: 0, warnings: count, info: 0 },
325
- },
326
- oneliner: `${count} outdated NuGet packages`,
327
- };
328
- };
329
- const dartAnalyzeParser = (stdout) => {
330
- // `dart analyze --format=machine` emits one finding per line, pipe-separated:
331
- // SEVERITY|TYPE|ERROR_CODE|FILE|LINE|COLUMN|LENGTH|MESSAGE
332
- // SEVERITY is INFO | WARNING | ERROR. Message pipes are backslash-escaped, so
333
- // reading the first field (the severity) is unambiguous.
334
- let errors = 0;
335
- let warnings = 0;
336
- let info = 0;
337
- for (const line of stdout.split(/\r?\n/)) {
338
- const pipe = line.indexOf('|');
339
- if (pipe === -1) {
340
- continue; // not a machine-format finding line (banner / blank)
341
- }
342
- const sev = line.slice(0, pipe).trim().toUpperCase();
343
- if (sev === 'ERROR') {
344
- errors++;
345
- }
346
- else if (sev === 'WARNING') {
347
- warnings++;
348
- }
349
- else if (sev === 'INFO') {
350
- info++;
351
- }
352
- }
353
- return {
354
- tool_id: 'dart-analyze',
355
- summary: { tier: 'counts', counts: { errors, warnings, info } },
356
- oneliner: `${errors} errors, ${warnings} warnings`,
357
- };
358
- };
359
- const dartPubOutdatedParser = (stdout) => {
360
- // `dart pub outdated --json` →
361
- // { packages: [{ package, current: {version} | null, latest: {version} | null }] }
362
- const data = safeJson(stdout);
363
- const pkgs = data?.packages ?? [];
364
- const count = pkgs.filter((p) => {
365
- const cur = p.current?.version;
366
- const latest = p.latest?.version;
367
- return Boolean(cur) && Boolean(latest) && cur !== latest;
368
- }).length;
369
- return {
370
- tool_id: 'dart-pub-outdated',
371
- summary: {
372
- tier: 'counts',
373
- counts: { errors: 0, warnings: count, info: 0 },
374
- },
375
- oneliner: `${count} outdated packages`,
376
- };
377
- };
378
- // ---------------------------------------------------------------------------
379
- // Tier 2 — counts + top-N findings (severity + file:line preserved)
380
- // ---------------------------------------------------------------------------
381
- function mapSemgrepSeverity(s) {
382
- switch ((s ?? '').toUpperCase()) {
383
- case 'ERROR':
384
- return 'high';
385
- case 'WARNING':
386
- return 'medium';
387
- case 'INFO':
388
- return 'low';
389
- default:
390
- return 'medium';
391
- }
392
- }
393
- const semgrepParser = (stdout, _stderr, ctx) => {
394
- const data = safeJson(stdout);
395
- const results = data?.results ?? [];
396
- const findings = results.map((r) => {
397
- const cwe = r.extra?.metadata?.cwe;
398
- const cweArr = Array.isArray(cwe) ? cwe : cwe ? [cwe] : undefined;
399
- const sev = mapSemgrepSeverity(r.extra?.severity);
400
- // Bump SAST findings of suspected high-severity rules to critical
401
- const id = r.check_id ?? '';
402
- const severity = sev === 'high' && /sqli|rce|deserialization|secret/.test(id)
403
- ? 'critical'
404
- : sev;
405
- return {
406
- file: relPath(r.path ?? '', ctx),
407
- line: r.start?.line ?? 1,
408
- issue: r.extra?.message ?? id,
409
- severity,
410
- snippet: clampSnippet(r.extra?.lines),
411
- source: 'tool:semgrep',
412
- rule_id: id || undefined,
413
- cwe: cweArr,
414
- subscore_key: primarySubscore('semgrep'),
415
- };
416
- });
417
- return {
418
- tool_id: 'semgrep',
419
- summary: {
420
- tier: 'findings',
421
- counts: countBySeverity(findings),
422
- top_findings: topBySeverity(findings),
423
- },
424
- oneliner: `${findings.length} SAST findings`,
425
- };
426
- };
427
- function mapBanditSeverity(s) {
428
- switch ((s ?? '').toUpperCase()) {
429
- case 'HIGH':
430
- return 'high';
431
- case 'MEDIUM':
432
- return 'medium';
433
- case 'LOW':
434
- return 'low';
435
- default:
436
- return 'medium';
437
- }
438
- }
439
- const banditParser = (stdout, _stderr, ctx) => {
440
- const data = safeJson(stdout);
441
- const results = data?.results ?? [];
442
- const findings = results.map((r) => ({
443
- file: relPath(r.filename ?? '', ctx),
444
- line: r.line_number ?? 1,
445
- issue: r.issue_text ?? r.test_id ?? 'bandit issue',
446
- severity: mapBanditSeverity(r.issue_severity),
447
- snippet: clampSnippet(r.code),
448
- source: 'tool:bandit',
449
- rule_id: r.test_id,
450
- cwe: r.cwe?.id ? [`CWE-${r.cwe.id}`] : undefined,
451
- subscore_key: primarySubscore('bandit'),
452
- }));
453
- return {
454
- tool_id: 'bandit',
455
- summary: {
456
- tier: 'findings',
457
- counts: countBySeverity(findings),
458
- top_findings: topBySeverity(findings),
459
- },
460
- oneliner: `${findings.length} security findings`,
461
- };
462
- };
463
- const gosecParser = (stdout, _stderr, ctx) => {
464
- const data = safeJson(stdout);
465
- const issues = data?.Issues ?? [];
466
- const findings = issues.map((i) => ({
467
- file: relPath(i.file ?? '', ctx),
468
- line: parseInt((i.line ?? '1').split('-')[0] ?? '1', 10) || 1,
469
- issue: i.details ?? i.rule_id ?? 'gosec issue',
470
- severity: mapBanditSeverity(i.severity), // same HIGH/MEDIUM/LOW scheme
471
- snippet: clampSnippet(i.code),
472
- source: 'tool:gosec',
473
- rule_id: i.rule_id,
474
- cwe: i.cwe?.ID ? [`CWE-${i.cwe.ID}`] : undefined,
475
- subscore_key: primarySubscore('gosec'),
476
- }));
477
- return {
478
- tool_id: 'gosec',
479
- summary: {
480
- tier: 'findings',
481
- counts: countBySeverity(findings),
482
- top_findings: topBySeverity(findings),
483
- },
484
- oneliner: `${findings.length} security findings`,
485
- };
486
- };
487
- const brakemanParser = (stdout, _stderr, ctx) => {
488
- const data = safeJson(stdout);
489
- const warnings = data?.warnings ?? [];
490
- const findings = warnings.map((w) => {
491
- const conf = (w.confidence ?? '').toLowerCase();
492
- const severity = conf === 'high' ? 'high' : conf === 'medium' ? 'medium' : 'low';
493
- return {
494
- file: relPath(w.file ?? '', ctx),
495
- line: w.line ?? 1,
496
- issue: w.message ?? w.warning_type ?? 'brakeman warning',
497
- severity,
498
- snippet: clampSnippet(w.code),
499
- source: 'tool:brakeman',
500
- rule_id: w.warning_type,
501
- subscore_key: primarySubscore('brakeman'),
502
- };
503
- });
504
- return {
505
- tool_id: 'brakeman',
506
- summary: {
507
- tier: 'findings',
508
- counts: countBySeverity(findings),
509
- top_findings: topBySeverity(findings),
510
- },
511
- oneliner: `${findings.length} Rails security findings`,
512
- };
513
- };
514
- const gitleaksParser = (stdout, _stderr, ctx) => {
515
- // gitleaks emits a JSON array of leaks. With --redact the secret value is
516
- // replaced; we still get file/line/rule.
517
- const data = safeJson(stdout);
518
- const leaks = Array.isArray(data) ? data : [];
519
- const findings = leaks.map((l) => ({
520
- file: relPath(l.File ?? '', ctx),
521
- line: l.StartLine ?? 1,
522
- issue: l.Description ?? l.RuleID ?? 'secret leak',
523
- // Every gitleaks hit is treated as critical — secrets in source are a P0.
524
- severity: 'critical',
525
- snippet: clampSnippet(l.Match),
526
- source: 'tool:gitleaks',
527
- rule_id: l.RuleID,
528
- subscore_key: primarySubscore('gitleaks'),
529
- }));
530
- return {
531
- tool_id: 'gitleaks',
532
- summary: {
533
- tier: 'findings',
534
- counts: countBySeverity(findings),
535
- top_findings: topBySeverity(findings),
536
- },
537
- oneliner: `${findings.length} secret leaks`,
538
- };
539
- };
540
- function mapNpmSeverity(s) {
541
- switch ((s ?? '').toLowerCase()) {
542
- case 'critical':
543
- return 'critical';
544
- case 'high':
545
- return 'high';
546
- case 'moderate':
547
- return 'medium';
548
- case 'low':
549
- case 'info':
550
- return 'low';
551
- default:
552
- return 'medium';
553
- }
554
- }
555
- function npmAuditCommon(toolId) {
556
- return (stdout) => {
557
- // npm/pnpm/yarn audit JSON has nested vulnerability map; we read just the
558
- // metadata.vulnerabilities object which is { critical, high, moderate, low }
559
- const data = safeJson(stdout);
560
- const meta = data?.metadata?.vulnerabilities;
561
- const critical = meta?.critical ?? 0;
562
- const high = meta?.high ?? 0;
563
- const medium = meta?.moderate ?? 0;
564
- const low = meta?.low ?? 0;
565
- const total = critical + high + medium + low;
566
- // Build top findings from the vulnerabilities map. These are package-level
567
- // (no file:line), so we synthesise file = "package.json" and line = 1.
568
- const vulns = Object.entries(data?.vulnerabilities ?? {});
569
- const findings = vulns.map(([pkg, v]) => {
570
- const via = (v.via ?? []).find((x) => typeof x !== 'string');
571
- return {
572
- file: 'package.json',
573
- line: 1,
574
- issue: `${pkg}: ${via?.title ?? 'known vulnerability'}`,
575
- severity: mapNpmSeverity(v.severity),
576
- source: `tool:${toolId}`,
577
- rule_id: pkg,
578
- subscore_key: primarySubscore(toolId),
579
- };
580
- });
581
- return {
582
- tool_id: toolId,
583
- summary: {
584
- tier: 'findings',
585
- counts: { critical, high, medium, low, total },
586
- top_findings: topBySeverity(findings),
587
- },
588
- oneliner: `${total} vulnerable packages (${critical} critical, ${high} high)`,
589
- };
590
- };
591
- }
592
- const npmAuditParser = npmAuditCommon('npm-audit');
593
- const pnpmAuditParser = npmAuditCommon('pnpm-audit');
594
- const yarnAuditParser = npmAuditCommon('yarn-audit');
595
- function mapOsvSeverity(score) {
596
- if (score === undefined) {
597
- return 'medium';
598
- }
599
- if (score >= 9) {
600
- return 'critical';
601
- }
602
- if (score >= 7) {
603
- return 'high';
604
- }
605
- if (score >= 4) {
606
- return 'medium';
607
- }
608
- return 'low';
609
- }
610
- const pipAuditParser = (stdout) => {
611
- const data = safeJson(stdout);
612
- const deps = data?.dependencies ?? [];
613
- const findings = [];
614
- for (const d of deps) {
615
- for (const v of d.vulns ?? []) {
616
- findings.push({
617
- file: 'requirements.txt',
618
- line: 1,
619
- issue: `${d.name}: ${v.description ?? v.id ?? 'vulnerable'}`,
620
- severity: 'high', // pip-audit doesn't surface CVSS in JSON; assume high
621
- source: 'tool:pip-audit',
622
- rule_id: v.id,
623
- subscore_key: primarySubscore('pip-audit'),
624
- });
625
- }
626
- }
627
- return {
628
- tool_id: 'pip-audit',
629
- summary: {
630
- tier: 'findings',
631
- counts: countBySeverity(findings),
632
- top_findings: topBySeverity(findings),
633
- },
634
- oneliner: `${findings.length} vulnerable packages`,
635
- };
636
- };
637
- const govulncheckParser = (stdout) => {
638
- // govulncheck -json emits a stream; vulnerabilities are events with
639
- // {finding: {osv, fixed_version, trace: [{module, package, function, position}]}}
640
- const events = safeJsonLines(stdout);
641
- const findings = [];
642
- for (const e of events) {
643
- const f = e.finding;
644
- if (!f) {
645
- continue;
646
- }
647
- const tr = f.trace?.[0];
648
- findings.push({
649
- file: tr?.position?.filename ?? tr?.module ?? 'go.mod',
650
- line: tr?.position?.line ?? 1,
651
- issue: `${tr?.package ?? tr?.module ?? 'module'}: ${f.osv ?? 'vulnerable'}`,
652
- severity: 'high',
653
- source: 'tool:govulncheck',
654
- rule_id: f.osv,
655
- subscore_key: primarySubscore('govulncheck'),
656
- });
657
- }
658
- return {
659
- tool_id: 'govulncheck',
660
- summary: {
661
- tier: 'findings',
662
- counts: countBySeverity(findings),
663
- top_findings: topBySeverity(findings),
664
- },
665
- oneliner: `${findings.length} Go vulnerabilities`,
666
- };
667
- };
668
- const cargoAuditParser = (stdout) => {
669
- const data = safeJson(stdout);
670
- const list = data?.vulnerabilities?.list ?? [];
671
- const findings = list.map((v) => ({
672
- file: 'Cargo.toml',
673
- line: 1,
674
- issue: `${v.package?.name ?? 'crate'}: ${v.advisory?.title ?? v.advisory?.id ?? 'vulnerable'}`,
675
- severity: 'high',
676
- source: 'tool:cargo-audit',
677
- rule_id: v.advisory?.id,
678
- subscore_key: primarySubscore('cargo-audit'),
679
- }));
680
- return {
681
- tool_id: 'cargo-audit',
682
- summary: {
683
- tier: 'findings',
684
- counts: countBySeverity(findings),
685
- top_findings: topBySeverity(findings),
686
- },
687
- oneliner: `${findings.length} Rust crate vulnerabilities`,
688
- };
689
- };
690
- const cargoDenyParser = (stdout) => {
691
- const events = safeJsonLines(stdout);
692
- const findings = [];
693
- for (const e of events) {
694
- if (e.type !== 'diagnostic') {
695
- continue;
696
- }
697
- const sev = (e.fields?.severity ?? '').toLowerCase();
698
- if (sev !== 'error' && sev !== 'warning') {
699
- continue;
700
- }
701
- findings.push({
702
- file: 'Cargo.toml',
703
- line: 1,
704
- issue: e.fields?.message ?? 'cargo-deny violation',
705
- severity: sev === 'error' ? 'high' : 'medium',
706
- source: 'tool:cargo-deny',
707
- rule_id: e.fields?.advisory,
708
- subscore_key: primarySubscore('cargo-deny'),
709
- });
710
- }
711
- return {
712
- tool_id: 'cargo-deny',
713
- summary: {
714
- tier: 'findings',
715
- counts: countBySeverity(findings),
716
- top_findings: topBySeverity(findings),
717
- },
718
- oneliner: `${findings.length} cargo-deny violations`,
719
- };
720
- };
721
- const osvScannerParser = (stdout, _stderr, ctx) => {
722
- const data = safeJson(stdout);
723
- const results = data?.results ?? [];
724
- const findings = [];
725
- for (const r of results) {
726
- const path = r.source?.path ?? 'manifest';
727
- for (const p of r.packages ?? []) {
728
- for (const v of p.vulnerabilities ?? []) {
729
- // The CVSS score is encoded as a string; pull the first numeric.
730
- const scoreStr = v.severity?.[0]?.score ?? '';
731
- const m = scoreStr.match(/(\d+(\.\d+)?)/);
732
- const score = m ? parseFloat(m[1]) : undefined;
733
- findings.push({
734
- file: relPath(path, ctx),
735
- line: 1,
736
- issue: `${p.package?.name ?? 'package'}: ${v.summary ?? v.id ?? 'vulnerable'}`,
737
- severity: mapOsvSeverity(score),
738
- source: 'tool:osv-scanner',
739
- rule_id: v.id,
740
- subscore_key: primarySubscore('osv-scanner'),
741
- });
742
- }
743
- }
744
- }
745
- return {
746
- tool_id: 'osv-scanner',
747
- summary: {
748
- tier: 'findings',
749
- counts: countBySeverity(findings),
750
- top_findings: topBySeverity(findings),
751
- },
752
- oneliner: `${findings.length} cross-language vulnerabilities`,
753
- };
754
- };
755
- const bundlerAuditParser = (stdout) => {
756
- // bundler-audit JSON format: { results: [{ gem, advisory: { id, title, ... } }] }
757
- const data = safeJson(stdout);
758
- const results = data?.results ?? [];
759
- const findings = results.map((r) => ({
760
- file: 'Gemfile.lock',
761
- line: 1,
762
- issue: `${r.gem?.name ?? 'gem'}: ${r.advisory?.title ?? r.advisory?.id ?? 'vulnerable'}`,
763
- severity: 'high',
764
- source: 'tool:bundler-audit',
765
- rule_id: r.advisory?.id,
766
- subscore_key: primarySubscore('bundler-audit'),
767
- }));
768
- return {
769
- tool_id: 'bundler-audit',
770
- summary: {
771
- tier: 'findings',
772
- counts: countBySeverity(findings),
773
- top_findings: topBySeverity(findings),
774
- },
775
- oneliner: `${findings.length} Ruby gem vulnerabilities`,
776
- };
777
- };
778
- function mapDotnetSeverity(s) {
779
- switch ((s ?? '').toLowerCase()) {
780
- case 'critical':
781
- return 'critical';
782
- case 'high':
783
- return 'high';
784
- case 'moderate':
785
- return 'medium';
786
- case 'low':
787
- return 'low';
788
- default:
789
- return 'medium';
790
- }
791
- }
792
- const dotnetListVulnerableParser = (stdout, _stderr, ctx) => {
793
- // `dotnet list package --vulnerable --include-transitive --format json` →
794
- // { projects: [{ path, frameworks: [{ topLevelPackages, transitivePackages }] }] }
795
- // where each package has { id, resolvedVersion, vulnerabilities: [{ severity, advisoryurl }] }
796
- const data = safeJson(stdout);
797
- const findings = [];
798
- for (const proj of data?.projects ?? []) {
799
- const file = relPath(proj.path ?? 'csproj', ctx);
800
- for (const fw of proj.frameworks ?? []) {
801
- const pkgs = [
802
- ...(fw.topLevelPackages ?? []),
803
- ...(fw.transitivePackages ?? []),
804
- ];
805
- for (const pkg of pkgs) {
806
- for (const v of pkg.vulnerabilities ?? []) {
807
- findings.push({
808
- file,
809
- line: 1,
810
- issue: `${pkg.id ?? 'package'}@${pkg.resolvedVersion ?? '?'}: ${v.advisoryurl ?? 'known vulnerability'}`,
811
- severity: mapDotnetSeverity(v.severity),
812
- source: 'tool:dotnet-list-vulnerable',
813
- rule_id: v.advisoryurl,
814
- subscore_key: primarySubscore('dotnet-list-vulnerable'),
815
- });
816
- }
817
- }
818
- }
819
- }
820
- return {
821
- tool_id: 'dotnet-list-vulnerable',
822
- summary: {
823
- tier: 'findings',
824
- counts: countBySeverity(findings),
825
- top_findings: topBySeverity(findings),
826
- },
827
- oneliner: `${findings.length} vulnerable NuGet packages`,
828
- };
829
- };
830
- const vultureParser = (stdout, _stderr, ctx) => {
831
- // vulture text output: `path:line: unused X 'name' (confidence%)`
832
- const findings = [];
833
- for (const line of stdout.split(/\r?\n/)) {
834
- const m = line.match(/^(.+?):(\d+):\s*(.+?)\s*\((\d+)%\s*confidence\)/);
835
- if (!m) {
836
- continue;
837
- }
838
- findings.push({
839
- file: relPath(m[1], ctx),
840
- line: parseInt(m[2], 10),
841
- issue: m[3],
842
- severity: 'low',
843
- source: 'tool:vulture',
844
- subscore_key: primarySubscore('vulture'),
845
- });
846
- }
847
- return {
848
- tool_id: 'vulture',
849
- summary: {
850
- tier: 'findings',
851
- counts: countBySeverity(findings),
852
- top_findings: topBySeverity(findings, 20),
853
- },
854
- oneliner: `${findings.length} dead-code candidates`,
855
- };
856
- };
857
- const madgeParser = (stdout, _stderr, ctx) => {
858
- const data = safeJson(stdout);
859
- if (!data) {
860
- return {
861
- tool_id: 'madge',
862
- summary: {
863
- tier: 'findings',
864
- counts: countBySeverity([]),
865
- top_findings: [],
866
- },
867
- oneliner: 'no circular dependencies',
868
- };
869
- }
870
- // Newer madge --circular --json returns array of cycles (each = array of files).
871
- const cycles = Array.isArray(data) ? data : Object.values(data);
872
- const findings = cycles.map((cycle) => ({
873
- file: relPath(cycle[0] ?? '', ctx),
874
- line: 1,
875
- issue: `Circular import chain: ${cycle.map((f) => relPath(f, ctx)).join(' -> ')}`,
876
- severity: 'medium',
877
- source: 'tool:madge',
878
- subscore_key: primarySubscore('madge'),
879
- }));
880
- return {
881
- tool_id: 'madge',
882
- summary: {
883
- tier: 'findings',
884
- counts: countBySeverity(findings),
885
- top_findings: topBySeverity(findings),
886
- },
887
- oneliner: `${findings.length} circular dependencies`,
888
- };
889
- };
890
- const jscpdParser = (stdout, _stderr, ctx) => {
891
- // jscpd writes JSON to a file, but its stdout (when --output specified) can
892
- // also include the report. We accept either.
893
- const data = safeJson(stdout);
894
- const stats = data?.statistics?.total;
895
- const dupPct = stats?.percentage ?? 0;
896
- const cloneCount = stats?.clones ?? 0;
897
- const dupes = data?.duplicates ?? [];
898
- const findings = dupes.map((d) => ({
899
- file: relPath(d.firstFile?.name ?? '', ctx),
900
- line: d.firstFile?.start ?? 1,
901
- issue: `Duplicated with ${relPath(d.secondFile?.name ?? '', ctx)}:${d.secondFile?.start ?? 1} (${d.lines ?? 0} lines)`,
902
- severity: 'low',
903
- source: 'tool:jscpd',
904
- subscore_key: primarySubscore('jscpd'),
905
- }));
906
- return {
907
- tool_id: 'jscpd',
908
- summary: {
909
- tier: 'metrics',
910
- metrics: {
911
- duplication_pct: dupPct,
912
- clones: cloneCount,
913
- top_clones: topBySeverity(findings, 10),
914
- },
915
- },
916
- oneliner: `${dupPct.toFixed(1)}% duplicated (${cloneCount} clones)`,
917
- };
918
- };
919
- const gocycloParser = (stdout, _stderr, ctx) => {
920
- // -json returns [{ complexity, package, function, file, line }]
921
- // -over 15 means only functions above 15 are reported.
922
- const data = safeJson(stdout);
923
- const items = data ?? [];
924
- const findings = items.map((i) => ({
925
- file: relPath(i.file ?? '', ctx),
926
- line: i.line ?? 1,
927
- issue: `${i.function ?? 'function'} has cyclomatic complexity ${i.complexity ?? '?'}`,
928
- severity: (i.complexity ?? 0) >= 25 ? 'high' : 'medium',
929
- source: 'tool:gocyclo',
930
- subscore_key: primarySubscore('gocyclo'),
931
- }));
932
- return {
933
- tool_id: 'gocyclo',
934
- summary: {
935
- tier: 'findings',
936
- counts: countBySeverity(findings),
937
- top_findings: topBySeverity(findings),
938
- },
939
- oneliner: `${findings.length} high-complexity functions`,
940
- };
941
- };
942
- // ---------------------------------------------------------------------------
943
- // Dependency graph (madge --json) — a bounded module graph for visualization
944
- // ---------------------------------------------------------------------------
945
- /** Max nodes kept in the persisted graph (cycle nodes prioritised). */
946
- const MAX_GRAPH_NODES = 80;
947
- /** Last two path segments — enough to disambiguate without the full path. */
948
- function shortLabel(path) {
949
- const parts = path.split('/');
950
- return parts.slice(-2).join('/');
951
- }
952
- /**
953
- * Nodes that participate in an import cycle, via iterative Tarjan SCC (any SCC
954
- * of size > 1, plus self-loops). Iterative to stay safe on large repos.
955
- */
956
- function findCycleNodes(adj) {
957
- const index = new Map();
958
- const low = new Map();
959
- const onStack = new Set();
960
- const stack = [];
961
- const cycleNodes = new Set();
962
- let idx = 0;
963
- for (const start of adj.keys()) {
964
- if (index.has(start)) {
965
- continue;
966
- }
967
- const work = [{ node: start, i: 0 }];
968
- while (work.length > 0) {
969
- const frame = work[work.length - 1];
970
- const node = frame.node;
971
- if (frame.i === 0) {
972
- index.set(node, idx);
973
- low.set(node, idx);
974
- idx++;
975
- stack.push(node);
976
- onStack.add(node);
977
- }
978
- const succs = adj.get(node) ?? [];
979
- if (frame.i < succs.length) {
980
- const w = succs[frame.i];
981
- frame.i++;
982
- if (!index.has(w)) {
983
- work.push({ node: w, i: 0 });
984
- }
985
- else if (onStack.has(w)) {
986
- low.set(node, Math.min(low.get(node) ?? 0, index.get(w) ?? 0));
987
- }
988
- }
989
- else {
990
- if (low.get(node) === index.get(node)) {
991
- const scc = [];
992
- let w = '';
993
- do {
994
- w = stack.pop();
995
- onStack.delete(w);
996
- scc.push(w);
997
- } while (w !== node);
998
- if (scc.length > 1) {
999
- for (const n of scc) {
1000
- cycleNodes.add(n);
1001
- }
1002
- }
1003
- else if ((adj.get(node) ?? []).includes(node)) {
1004
- cycleNodes.add(node);
1005
- }
1006
- }
1007
- work.pop();
1008
- const parent = work[work.length - 1]?.node;
1009
- if (parent !== undefined) {
1010
- low.set(parent, Math.min(low.get(parent) ?? 0, low.get(node) ?? 0));
1011
- }
1012
- }
1013
- }
1014
- }
1015
- return cycleNodes;
1016
- }
1017
- /**
1018
- * Build a bounded dependency graph from madge's adjacency map. Cycle nodes are
1019
- * always kept; the remaining slots go to the highest-degree modules. Edges are
1020
- * restricted to kept nodes.
1021
- */
1022
- export function buildDependencyGraph(adjObj) {
1023
- // Normalise: every referenced module is a node (targets may have no key).
1024
- const adj = new Map();
1025
- for (const [k, deps] of Object.entries(adjObj)) {
1026
- const list = Array.isArray(deps) ? deps : [];
1027
- if (!adj.has(k)) {
1028
- adj.set(k, []);
1029
- }
1030
- adj.get(k).push(...list);
1031
- for (const d of list) {
1032
- if (!adj.has(d)) {
1033
- adj.set(d, []);
1034
- }
1035
- }
1036
- }
1037
- const fanOut = new Map();
1038
- const fanIn = new Map();
1039
- for (const [k, deps] of adj) {
1040
- fanOut.set(k, deps.length);
1041
- for (const d of deps) {
1042
- fanIn.set(d, (fanIn.get(d) ?? 0) + 1);
1043
- }
1044
- }
1045
- const cycleNodes = findCycleNodes(adj);
1046
- const allIds = [...adj.keys()];
1047
- const degree = (id) => (fanIn.get(id) ?? 0) + (fanOut.get(id) ?? 0);
1048
- // Prioritise cycle nodes, then highest-degree modules, capped at the limit
1049
- // so even a large strongly-connected cluster can't blow past the bound.
1050
- const ranked = [...allIds].sort((a, b) => {
1051
- const ca = cycleNodes.has(a) ? 1 : 0;
1052
- const cb = cycleNodes.has(b) ? 1 : 0;
1053
- return ca !== cb ? cb - ca : degree(b) - degree(a);
1054
- });
1055
- const kept = new Set(ranked.slice(0, MAX_GRAPH_NODES));
1056
- const nodes = [...kept].map((id) => ({
1057
- id,
1058
- label: shortLabel(id),
1059
- fan_in: fanIn.get(id) ?? 0,
1060
- fan_out: fanOut.get(id) ?? 0,
1061
- in_cycle: cycleNodes.has(id),
1062
- }));
1063
- const edges = [];
1064
- const seen = new Set();
1065
- for (const [from, deps] of adj) {
1066
- if (!kept.has(from)) {
1067
- continue;
1068
- }
1069
- for (const to of deps) {
1070
- if (!kept.has(to) || from === to) {
1071
- continue;
1072
- }
1073
- const key = `${from}\n${to}`;
1074
- if (seen.has(key)) {
1075
- continue;
1076
- }
1077
- seen.add(key);
1078
- edges.push({ from, to });
1079
- }
1080
- }
1081
- return {
1082
- nodes,
1083
- edges,
1084
- total_modules: allIds.length,
1085
- truncated: allIds.length > kept.size,
1086
- };
1087
- }
1088
- const madgeGraphParser = (stdout) => {
1089
- const adjObj = safeJson(stdout);
1090
- const graph = adjObj
1091
- ? buildDependencyGraph(adjObj)
1092
- : { nodes: [], edges: [], total_modules: 0, truncated: false };
1093
- const cycleCount = graph.nodes.filter((n) => n.in_cycle).length;
1094
- return {
1095
- tool_id: 'madge-graph',
1096
- summary: { tier: 'metrics', metrics: { graph } },
1097
- oneliner: `${graph.total_modules} modules, ${cycleCount} in cycles`,
1098
- };
1099
- };
1100
- // ---------------------------------------------------------------------------
1101
- // Tier 3 — structured metrics
1102
- // ---------------------------------------------------------------------------
1103
- const sccParser = (stdout) => {
1104
- const data = safeJson(stdout);
1105
- if (!Array.isArray(data)) {
1106
- return {
1107
- tool_id: 'scc',
1108
- summary: { tier: 'metrics', metrics: {} },
1109
- oneliner: 'no LOC stats',
1110
- };
1111
- }
1112
- const totalLines = data.reduce((s, e) => s + (e.Lines ?? 0), 0);
1113
- const totalCode = data.reduce((s, e) => s + (e.Code ?? 0), 0);
1114
- const totalFiles = data.reduce((s, e) => s + (e.Files ?? 0), 0);
1115
- const byLang = data
1116
- .map((e) => ({
1117
- language: e.Name ?? 'unknown',
1118
- lines: e.Lines ?? 0,
1119
- code: e.Code ?? 0,
1120
- files: e.Files ?? 0,
1121
- }))
1122
- .sort((a, b) => b.code - a.code)
1123
- .slice(0, 10);
1124
- return {
1125
- tool_id: 'scc',
1126
- summary: {
1127
- tier: 'metrics',
1128
- metrics: {
1129
- total_lines: totalLines,
1130
- total_code_lines: totalCode,
1131
- total_files: totalFiles,
1132
- languages: byLang,
1133
- },
1134
- },
1135
- oneliner: `${totalCode.toLocaleString()} code lines across ${totalFiles} files`,
1136
- };
1137
- };
1138
- const lizardParser = (stdout) => {
1139
- // Lizard --xml output is structured XML; we use a minimal text extraction
1140
- // since we asked for thresholds (-C 15 -L 80). The summary line at the end
1141
- // has the format: "Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt ..."
1142
- // We do a defensive pass.
1143
- const lastLines = stdout.split(/\r?\n/).slice(-20).join('\n');
1144
- const m = lastLines.match(/Total\s+nloc[\s\S]+?(\d+)\s+(\d+\.?\d*)\s+(\d+\.?\d*)\s+(\d+\.?\d*)\s+(\d+)/);
1145
- let totalNloc = 0;
1146
- let avgNloc = 0;
1147
- let avgCcn = 0;
1148
- let funcCount = 0;
1149
- if (m) {
1150
- totalNloc = parseInt(m[1], 10);
1151
- avgNloc = parseFloat(m[2]);
1152
- avgCcn = parseFloat(m[3]);
1153
- funcCount = parseInt(m[5], 10);
1154
- }
1155
- // Count warnings (functions exceeding thresholds)
1156
- const warningCount = (stdout.match(/warnings? \(/g) || []).length;
1157
- return {
1158
- tool_id: 'lizard',
1159
- summary: {
1160
- tier: 'metrics',
1161
- metrics: {
1162
- total_nloc: totalNloc,
1163
- avg_nloc_per_function: avgNloc,
1164
- avg_cyclomatic_complexity: avgCcn,
1165
- function_count: funcCount,
1166
- flagged_functions: warningCount,
1167
- },
1168
- },
1169
- oneliner: `avg CCN ${avgCcn.toFixed(1)}, ${warningCount} flagged functions`,
1170
- };
1171
- };
1172
- const radonParser = (stdout) => {
1173
- // radon cc -j produces { "<file>": [ { complexity, rank, ... }, ... ] }
1174
- const data = safeJson(stdout);
1175
- const buckets = {
1176
- A: 0,
1177
- B: 0,
1178
- C: 0,
1179
- D: 0,
1180
- E: 0,
1181
- F: 0,
1182
- };
1183
- let total = 0;
1184
- let maxCcn = 0;
1185
- for (const entries of Object.values(data ?? {})) {
1186
- for (const e of entries) {
1187
- total++;
1188
- const r = (e.rank ?? '').toUpperCase();
1189
- if (r in buckets) {
1190
- buckets[r]++;
1191
- }
1192
- if ((e.complexity ?? 0) > maxCcn) {
1193
- maxCcn = e.complexity ?? 0;
1194
- }
1195
- }
1196
- }
1197
- return {
1198
- tool_id: 'radon',
1199
- summary: {
1200
- tier: 'metrics',
1201
- metrics: {
1202
- total_functions: total,
1203
- max_complexity: maxCcn,
1204
- rank_buckets: buckets,
1205
- },
1206
- },
1207
- oneliner: `${total} functions, ${buckets.D + buckets.E + buckets.F} above C-rank`,
1208
- };
1209
- };
1210
- const licenseCheckerParser = (stdout) => {
1211
- const data = safeJson(stdout);
1212
- if (!data) {
1213
- return {
1214
- tool_id: 'license-checker',
1215
- summary: { tier: 'metrics', metrics: {} },
1216
- oneliner: 'no license data',
1217
- };
1218
- }
1219
- const dist = {};
1220
- let total = 0;
1221
- for (const v of Object.values(data)) {
1222
- const l = v.licenses;
1223
- const lic = typeof l === 'string' ? l : Array.isArray(l) ? l.join('+') : 'UNKNOWN';
1224
- dist[lic] = (dist[lic] ?? 0) + 1;
1225
- total++;
1226
- }
1227
- // Pull suspicious license classes
1228
- const restricted = Object.entries(dist)
1229
- .filter(([k]) => /GPL|AGPL|SSPL/i.test(k))
1230
- .reduce((s, [, n]) => s + n, 0);
1231
- return {
1232
- tool_id: 'license-checker',
1233
- summary: {
1234
- tier: 'metrics',
1235
- metrics: {
1236
- total_packages: total,
1237
- license_distribution: dist,
1238
- restricted_licenses: restricted,
1239
- },
1240
- },
1241
- oneliner: `${total} packages, ${restricted} under restrictive licenses`,
1242
- };
1243
- };
1244
- // ---------------------------------------------------------------------------
1245
- // Registry
1246
- // ---------------------------------------------------------------------------
1247
- export const PARSERS = {
1248
- // Tier 1
1249
- eslint: eslintParser,
1250
- 'tsc-typecheck': tscParser,
1251
- ruff: ruffParser,
1252
- mypy: mypyParser,
1253
- 'golangci-lint': golangciLintParser,
1254
- clippy: clippyParser,
1255
- rubocop: rubocopParser,
1256
- depcheck: depcheckParser,
1257
- 'npm-outdated': npmOutdatedParser,
1258
- 'go-mod-outdated': goModOutdatedParser,
1259
- 'cargo-outdated': cargoOutdatedParser,
1260
- 'dotnet-list-outdated': dotnetListOutdatedParser,
1261
- 'dart-analyze': dartAnalyzeParser,
1262
- 'dart-pub-outdated': dartPubOutdatedParser,
1263
- // Tier 2
1264
- semgrep: semgrepParser,
1265
- bandit: banditParser,
1266
- gosec: gosecParser,
1267
- brakeman: brakemanParser,
1268
- gitleaks: gitleaksParser,
1269
- 'npm-audit': npmAuditParser,
1270
- 'pnpm-audit': pnpmAuditParser,
1271
- 'yarn-audit': yarnAuditParser,
1272
- 'pip-audit': pipAuditParser,
1273
- govulncheck: govulncheckParser,
1274
- 'cargo-audit': cargoAuditParser,
1275
- 'cargo-deny': cargoDenyParser,
1276
- 'osv-scanner': osvScannerParser,
1277
- 'bundler-audit': bundlerAuditParser,
1278
- 'dotnet-list-vulnerable': dotnetListVulnerableParser,
1279
- vulture: vultureParser,
1280
- madge: madgeParser,
1281
- gocyclo: gocycloParser,
1282
- // Mixed (T3 metrics + T2 sub-findings)
1283
- jscpd: jscpdParser,
1284
- 'madge-graph': madgeGraphParser,
1285
- // Tier 3
1286
- scc: sccParser,
1287
- lizard: lizardParser,
1288
- radon: radonParser,
1289
- 'license-checker': licenseCheckerParser,
1290
- };
1291
- /** Run the parser for a tool, defensively swallowing errors. */
1292
- export function parseToolOutput(toolId, stdout, stderr, ctx) {
1293
- const fn = PARSERS[toolId];
1294
- if (!fn) {
1295
- return {
1296
- tool_id: toolId,
1297
- summary: { tier: 'counts', counts: { errors: 0, warnings: 0, info: 0 } },
1298
- oneliner: `no parser for ${toolId}`,
1299
- };
1300
- }
1301
- try {
1302
- return fn(stdout, stderr, ctx);
1303
- }
1304
- catch (err) {
1305
- return {
1306
- tool_id: toolId,
1307
- summary: { tier: 'counts', counts: { errors: 0, warnings: 0, info: 0 } },
1308
- oneliner: `parser error: ${err instanceof Error ? err.message : String(err)}`,
1309
- };
1310
- }
1311
- }