edsger 0.50.0 → 0.52.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 (470) hide show
  1. package/.claude/settings.local.json +23 -3
  2. package/.env.local +12 -0
  3. package/README.md +25 -25
  4. package/dist/api/chat.d.ts +7 -7
  5. package/dist/api/chat.js +13 -13
  6. package/dist/api/cross-product.d.ts +10 -10
  7. package/dist/api/cross-product.js +30 -30
  8. package/dist/api/github.d.ts +5 -5
  9. package/dist/api/github.js +10 -10
  10. package/dist/api/intelligence.d.ts +3 -3
  11. package/dist/api/issues/approval-checker.d.ts +20 -0
  12. package/dist/api/{features → issues}/approval-checker.js +16 -16
  13. package/dist/api/issues/get-issue.d.ts +5 -0
  14. package/dist/api/issues/get-issue.js +21 -0
  15. package/dist/api/issues/index.d.ts +8 -0
  16. package/dist/api/issues/index.js +10 -0
  17. package/dist/api/issues/issue-utils.d.ts +23 -0
  18. package/dist/api/issues/issue-utils.js +80 -0
  19. package/dist/api/issues/status-updater.d.ts +41 -0
  20. package/dist/api/{features → issues}/status-updater.js +23 -23
  21. package/dist/api/{features → issues}/test-cases.d.ts +7 -7
  22. package/dist/api/{features → issues}/test-cases.js +12 -12
  23. package/dist/api/issues/update-issue.d.ts +20 -0
  24. package/dist/api/{features/update-feature.js → issues/update-issue.js} +22 -22
  25. package/dist/api/{features → issues}/user-stories.d.ts +5 -5
  26. package/dist/api/{features → issues}/user-stories.js +8 -8
  27. package/dist/api/products.d.ts +1 -1
  28. package/dist/api/tasks.d.ts +1 -1
  29. package/dist/api/test-reports.d.ts +2 -2
  30. package/dist/api/test-reports.js +4 -4
  31. package/dist/auth/login.js +1 -1
  32. package/dist/commands/agent-workflow/chat-worker.d.ts +7 -7
  33. package/dist/commands/agent-workflow/chat-worker.js +50 -50
  34. package/dist/commands/agent-workflow/index.d.ts +2 -2
  35. package/dist/commands/agent-workflow/index.js +3 -3
  36. package/dist/commands/agent-workflow/{feature-worker.d.ts → issue-worker.d.ts} +4 -4
  37. package/dist/commands/agent-workflow/{feature-worker.js → issue-worker.js} +12 -12
  38. package/dist/commands/agent-workflow/processor.d.ts +9 -9
  39. package/dist/commands/agent-workflow/processor.js +90 -90
  40. package/dist/commands/build/index.js +2 -2
  41. package/dist/commands/find-bugs/index.d.ts +11 -0
  42. package/dist/commands/find-bugs/index.js +39 -0
  43. package/dist/commands/find-features/index.d.ts +14 -0
  44. package/dist/commands/find-features/index.js +42 -0
  45. package/dist/commands/find-smells/index.d.ts +21 -0
  46. package/dist/commands/find-smells/index.js +65 -0
  47. package/dist/commands/init/prompts.js +1 -1
  48. package/dist/commands/init/templates.d.ts +1 -1
  49. package/dist/commands/init/templates.js +4 -4
  50. package/dist/commands/workflow/config/phase-configs.js +17 -17
  51. package/dist/commands/workflow/core/index.d.ts +1 -1
  52. package/dist/commands/workflow/core/index.js +2 -2
  53. package/dist/commands/workflow/core/issue-filter.d.ts +16 -0
  54. package/dist/commands/workflow/core/issue-filter.js +47 -0
  55. package/dist/commands/workflow/core/state-manager.d.ts +10 -10
  56. package/dist/commands/workflow/core/state-manager.js +10 -10
  57. package/dist/commands/workflow/core/workflow-logger.d.ts +9 -9
  58. package/dist/commands/workflow/core/workflow-logger.js +21 -21
  59. package/dist/commands/workflow/executors/phase-executor.d.ts +2 -2
  60. package/dist/commands/workflow/executors/phase-executor.js +32 -32
  61. package/dist/commands/workflow/issue-coordinator.d.ts +18 -0
  62. package/dist/commands/workflow/{feature-coordinator.js → issue-coordinator.js} +29 -29
  63. package/dist/commands/workflow/phase-orchestrator.d.ts +2 -2
  64. package/dist/commands/workflow/phase-orchestrator.js +82 -82
  65. package/dist/commands/workflow/processor.d.ts +7 -7
  66. package/dist/commands/workflow/processor.js +44 -44
  67. package/dist/config/{feature-status.d.ts → issue-status.d.ts} +14 -14
  68. package/dist/config/{feature-status.js → issue-status.js} +14 -14
  69. package/dist/errors/index.d.ts +6 -6
  70. package/dist/errors/index.js +11 -11
  71. package/dist/index.js +90 -1
  72. package/dist/phases/app-store-generation/context.js +6 -6
  73. package/dist/phases/app-store-generation/index.js +2 -2
  74. package/dist/phases/app-store-generation/prompts.js +2 -2
  75. package/dist/phases/autonomous/index.d.ts +3 -3
  76. package/dist/phases/autonomous/index.js +37 -37
  77. package/dist/phases/autonomous/prompts.d.ts +2 -2
  78. package/dist/phases/autonomous/prompts.js +4 -4
  79. package/dist/phases/branch-planning/context.d.ts +3 -3
  80. package/dist/phases/branch-planning/context.js +12 -12
  81. package/dist/phases/branch-planning/index.d.ts +3 -3
  82. package/dist/phases/branch-planning/index.js +32 -32
  83. package/dist/phases/branch-planning/outcome.d.ts +5 -5
  84. package/dist/phases/branch-planning/outcome.js +12 -12
  85. package/dist/phases/branch-planning/prompts.d.ts +3 -3
  86. package/dist/phases/branch-planning/prompts.js +13 -13
  87. package/dist/phases/bug-fixing/analyzer.d.ts +2 -2
  88. package/dist/phases/bug-fixing/analyzer.js +13 -13
  89. package/dist/phases/bug-fixing/context-fetcher.d.ts +3 -3
  90. package/dist/phases/bug-fixing/context-fetcher.js +18 -18
  91. package/dist/phases/bug-fixing/mcp-server.js +17 -18
  92. package/dist/phases/chat-processor/context.d.ts +5 -5
  93. package/dist/phases/chat-processor/context.js +17 -17
  94. package/dist/phases/chat-processor/index.d.ts +4 -4
  95. package/dist/phases/chat-processor/index.js +17 -17
  96. package/dist/phases/chat-processor/product-context.d.ts +3 -3
  97. package/dist/phases/chat-processor/product-context.js +16 -16
  98. package/dist/phases/chat-processor/product-prompts.d.ts +1 -1
  99. package/dist/phases/chat-processor/product-prompts.js +10 -10
  100. package/dist/phases/chat-processor/product-tools.d.ts +2 -2
  101. package/dist/phases/chat-processor/product-tools.js +33 -33
  102. package/dist/phases/chat-processor/prompts.d.ts +3 -3
  103. package/dist/phases/chat-processor/prompts.js +22 -22
  104. package/dist/phases/chat-processor/tools.js +46 -46
  105. package/dist/phases/code-implementation/branch-pr-creator.d.ts +3 -3
  106. package/dist/phases/code-implementation/branch-pr-creator.js +5 -5
  107. package/dist/phases/code-implementation/context.d.ts +3 -3
  108. package/dist/phases/code-implementation/context.js +18 -18
  109. package/dist/phases/code-implementation/index.d.ts +4 -4
  110. package/dist/phases/code-implementation/index.js +88 -88
  111. package/dist/phases/code-implementation/outcome.d.ts +3 -3
  112. package/dist/phases/code-implementation/outcome.js +6 -6
  113. package/dist/phases/code-implementation/prompts.d.ts +1 -1
  114. package/dist/phases/code-implementation/prompts.js +6 -6
  115. package/dist/phases/code-implementation-verification/agent.d.ts +3 -3
  116. package/dist/phases/code-implementation-verification/agent.js +5 -5
  117. package/dist/phases/code-implementation-verification/index.d.ts +3 -3
  118. package/dist/phases/code-implementation-verification/index.js +11 -11
  119. package/dist/phases/code-implementation-verification/prompts.d.ts +3 -3
  120. package/dist/phases/code-implementation-verification/prompts.js +7 -7
  121. package/dist/phases/code-refine/context.d.ts +8 -8
  122. package/dist/phases/code-refine/context.js +29 -29
  123. package/dist/phases/code-refine/index.d.ts +2 -2
  124. package/dist/phases/code-refine/index.js +20 -20
  125. package/dist/phases/code-refine/prompts.d.ts +1 -1
  126. package/dist/phases/code-refine/prompts.js +3 -3
  127. package/dist/phases/code-refine/refine-iteration.d.ts +1 -1
  128. package/dist/phases/code-refine/refine-iteration.js +4 -4
  129. package/dist/phases/code-refine/retry-handler.js +2 -2
  130. package/dist/phases/code-refine-verification/index.js +10 -10
  131. package/dist/phases/code-refine-verification/types.d.ts +2 -2
  132. package/dist/phases/code-review/context.d.ts +8 -8
  133. package/dist/phases/code-review/context.js +25 -25
  134. package/dist/phases/code-review/diff-utils.d.ts +1 -1
  135. package/dist/phases/code-review/diff-utils.js +1 -1
  136. package/dist/phases/code-review/index.d.ts +2 -2
  137. package/dist/phases/code-review/index.js +26 -26
  138. package/dist/phases/code-testing/analyzer.d.ts +2 -2
  139. package/dist/phases/code-testing/analyzer.js +18 -18
  140. package/dist/phases/code-testing/context-fetcher.d.ts +3 -3
  141. package/dist/phases/code-testing/context-fetcher.js +16 -16
  142. package/dist/phases/code-testing/prompts.d.ts +1 -1
  143. package/dist/phases/code-testing/prompts.js +5 -5
  144. package/dist/phases/find-bugs/index.d.ts +30 -0
  145. package/dist/phases/find-bugs/index.js +216 -0
  146. package/dist/phases/find-bugs/prompts.d.ts +22 -0
  147. package/dist/phases/find-bugs/prompts.js +101 -0
  148. package/dist/phases/find-bugs/state.d.ts +19 -0
  149. package/dist/phases/find-bugs/state.js +13 -0
  150. package/dist/phases/find-bugs/types.d.ts +21 -0
  151. package/dist/phases/find-bugs/types.js +16 -0
  152. package/dist/phases/find-features/index.d.ts +40 -0
  153. package/dist/phases/find-features/index.js +279 -0
  154. package/dist/phases/find-features/prompts.d.ts +43 -0
  155. package/dist/phases/find-features/prompts.js +138 -0
  156. package/dist/phases/find-features/state.d.ts +25 -0
  157. package/dist/phases/find-features/state.js +22 -0
  158. package/dist/phases/find-features/types.d.ts +27 -0
  159. package/dist/phases/find-features/types.js +16 -0
  160. package/dist/phases/find-shared/git.d.ts +24 -0
  161. package/dist/phases/find-shared/git.js +60 -0
  162. package/dist/phases/find-shared/mcp.d.ts +33 -0
  163. package/dist/phases/find-shared/mcp.js +69 -0
  164. package/dist/phases/find-shared/scan-state.d.ts +33 -0
  165. package/dist/phases/find-shared/scan-state.js +112 -0
  166. package/dist/phases/find-smells/index.d.ts +47 -0
  167. package/dist/phases/find-smells/index.js +278 -0
  168. package/dist/phases/find-smells/prompts.d.ts +30 -0
  169. package/dist/phases/find-smells/prompts.js +129 -0
  170. package/dist/phases/find-smells/state.d.ts +21 -0
  171. package/dist/phases/find-smells/state.js +17 -0
  172. package/dist/phases/find-smells/types.d.ts +51 -0
  173. package/dist/phases/find-smells/types.js +64 -0
  174. package/dist/phases/functional-testing/analyzer.d.ts +2 -2
  175. package/dist/phases/functional-testing/analyzer.js +40 -40
  176. package/dist/phases/functional-testing/context-fetcher.d.ts +3 -3
  177. package/dist/phases/functional-testing/context-fetcher.js +16 -16
  178. package/dist/phases/functional-testing/http-fallback.d.ts +2 -2
  179. package/dist/phases/functional-testing/http-fallback.js +9 -9
  180. package/dist/phases/functional-testing/mcp-server.js +23 -24
  181. package/dist/phases/functional-testing/prompts.d.ts +1 -1
  182. package/dist/phases/functional-testing/prompts.js +4 -4
  183. package/dist/phases/functional-testing/test-report-creator.d.ts +2 -2
  184. package/dist/phases/functional-testing/test-report-creator.js +10 -10
  185. package/dist/phases/functional-testing/test-retry-handler.js +3 -3
  186. package/dist/phases/growth-analysis/context.js +6 -6
  187. package/dist/phases/growth-analysis/index.js +2 -2
  188. package/dist/phases/growth-analysis/prompts.js +2 -2
  189. package/dist/phases/intelligence-analysis/context.js +7 -7
  190. package/dist/phases/intelligence-analysis/index.js +3 -3
  191. package/dist/phases/{feature-analysis → issue-analysis}/agent.js +1 -1
  192. package/dist/phases/issue-analysis/context.d.ts +24 -0
  193. package/dist/phases/{feature-analysis → issue-analysis}/context.js +30 -30
  194. package/dist/phases/issue-analysis/index.d.ts +8 -0
  195. package/dist/phases/{feature-analysis → issue-analysis}/index.js +29 -29
  196. package/dist/phases/issue-analysis/outcome.d.ts +40 -0
  197. package/dist/phases/{feature-analysis → issue-analysis}/outcome.js +17 -17
  198. package/dist/phases/{feature-analysis → issue-analysis}/prompts.d.ts +3 -3
  199. package/dist/phases/{feature-analysis → issue-analysis}/prompts.js +12 -12
  200. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/agent.d.ts +2 -2
  201. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/agent.js +1 -1
  202. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/index.d.ts +5 -5
  203. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/index.js +9 -9
  204. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/prompts.d.ts +2 -2
  205. package/dist/phases/{feature-analysis-verification → issue-analysis-verification}/prompts.js +7 -7
  206. package/dist/phases/output-contracts.js +37 -37
  207. package/dist/phases/pr-execution/context.d.ts +3 -3
  208. package/dist/phases/pr-execution/context.js +14 -14
  209. package/dist/phases/pr-execution/index.d.ts +2 -2
  210. package/dist/phases/pr-execution/index.js +22 -22
  211. package/dist/phases/pr-execution/outcome.d.ts +4 -4
  212. package/dist/phases/pr-execution/outcome.js +6 -6
  213. package/dist/phases/pr-execution/prompts.d.ts +4 -4
  214. package/dist/phases/pr-execution/prompts.js +6 -6
  215. package/dist/phases/pr-resolve/checklist-learner.js +2 -2
  216. package/dist/phases/pr-review/index.d.ts +1 -1
  217. package/dist/phases/pr-review/index.js +1 -1
  218. package/dist/phases/pr-review/prompts.d.ts +1 -1
  219. package/dist/phases/pr-review/prompts.js +1 -1
  220. package/dist/phases/pr-shared/context.d.ts +3 -3
  221. package/dist/phases/pr-shared/context.js +3 -3
  222. package/dist/phases/pr-splitting/context.d.ts +3 -3
  223. package/dist/phases/pr-splitting/context.js +16 -16
  224. package/dist/phases/pr-splitting/index.d.ts +4 -4
  225. package/dist/phases/pr-splitting/index.js +29 -29
  226. package/dist/phases/pr-splitting/outcome.d.ts +3 -3
  227. package/dist/phases/pr-splitting/outcome.js +7 -7
  228. package/dist/phases/pr-splitting/prompts.d.ts +3 -3
  229. package/dist/phases/pr-splitting/prompts.js +11 -11
  230. package/dist/phases/pull-request/creator.d.ts +4 -4
  231. package/dist/phases/pull-request/creator.js +25 -25
  232. package/dist/phases/pull-request/handler.d.ts +3 -3
  233. package/dist/phases/pull-request/handler.js +16 -16
  234. package/dist/phases/release-sync/index.js +2 -2
  235. package/dist/phases/run-sheet/agent.js +1 -2
  236. package/dist/phases/run-sheet/index.js +3 -3
  237. package/dist/phases/smoke-test/index.js +2 -2
  238. package/dist/phases/technical-design/context.d.ts +3 -3
  239. package/dist/phases/technical-design/context.js +11 -11
  240. package/dist/phases/technical-design/index.d.ts +2 -2
  241. package/dist/phases/technical-design/index.js +27 -27
  242. package/dist/phases/technical-design/outcome.d.ts +4 -4
  243. package/dist/phases/technical-design/outcome.js +6 -6
  244. package/dist/phases/technical-design/prompts.d.ts +2 -2
  245. package/dist/phases/technical-design/prompts.js +10 -10
  246. package/dist/phases/technical-design-verification/agent.d.ts +3 -3
  247. package/dist/phases/technical-design-verification/agent.js +4 -4
  248. package/dist/phases/technical-design-verification/index.d.ts +4 -4
  249. package/dist/phases/technical-design-verification/index.js +12 -12
  250. package/dist/phases/technical-design-verification/prompts.d.ts +3 -3
  251. package/dist/phases/technical-design-verification/prompts.js +6 -6
  252. package/dist/phases/test-cases-analysis/context.d.ts +5 -5
  253. package/dist/phases/test-cases-analysis/context.js +18 -18
  254. package/dist/phases/test-cases-analysis/formatters.js +7 -7
  255. package/dist/phases/test-cases-analysis/index.d.ts +1 -1
  256. package/dist/phases/test-cases-analysis/index.js +21 -21
  257. package/dist/phases/test-cases-analysis/outcome.d.ts +7 -7
  258. package/dist/phases/test-cases-analysis/outcome.js +13 -13
  259. package/dist/phases/test-cases-analysis/prompts.d.ts +3 -3
  260. package/dist/phases/test-cases-analysis/prompts.js +6 -6
  261. package/dist/phases/user-stories-analysis/context.d.ts +5 -5
  262. package/dist/phases/user-stories-analysis/context.js +18 -18
  263. package/dist/phases/user-stories-analysis/formatters.js +7 -7
  264. package/dist/phases/user-stories-analysis/index.d.ts +1 -1
  265. package/dist/phases/user-stories-analysis/index.js +21 -21
  266. package/dist/phases/user-stories-analysis/outcome.d.ts +7 -7
  267. package/dist/phases/user-stories-analysis/outcome.js +13 -13
  268. package/dist/phases/user-stories-analysis/prompts.d.ts +3 -3
  269. package/dist/phases/user-stories-analysis/prompts.js +10 -10
  270. package/dist/services/audit-logs.d.ts +10 -10
  271. package/dist/services/audit-logs.js +12 -12
  272. package/dist/services/branches.d.ts +6 -6
  273. package/dist/services/branches.js +16 -16
  274. package/dist/services/checklist.d.ts +3 -3
  275. package/dist/services/checklist.js +11 -11
  276. package/dist/services/coaching/coaching-agent.js +2 -2
  277. package/dist/services/coaching/coaching-loop.d.ts +1 -1
  278. package/dist/services/coaching/coaching-loop.js +2 -2
  279. package/dist/services/coaching/phase-coaching.d.ts +2 -2
  280. package/dist/services/coaching/phase-coaching.js +3 -3
  281. package/dist/services/coaching/self-rating.js +1 -1
  282. package/dist/services/feedbacks.d.ts +4 -4
  283. package/dist/services/feedbacks.js +8 -8
  284. package/dist/services/phase-hooks/bindings-fetcher.d.ts +4 -4
  285. package/dist/services/phase-hooks/bindings-fetcher.js +8 -8
  286. package/dist/services/phase-hooks/hook-executor.js +1 -1
  287. package/dist/services/phase-hooks/hook-logging.d.ts +2 -2
  288. package/dist/services/phase-hooks/hook-logging.js +4 -4
  289. package/dist/services/phase-hooks/hook-runner.d.ts +1 -1
  290. package/dist/services/phase-hooks/hook-runner.js +4 -4
  291. package/dist/services/phase-hooks/types.d.ts +3 -3
  292. package/dist/services/phase-ratings.d.ts +7 -7
  293. package/dist/services/phase-ratings.js +8 -8
  294. package/dist/services/pull-requests.d.ts +4 -4
  295. package/dist/services/pull-requests.js +11 -11
  296. package/dist/services/skill-resolver.d.ts +1 -1
  297. package/dist/services/skill-resolver.js +1 -1
  298. package/dist/skills/phase/app-store-generation/SKILL.md +9 -9
  299. package/dist/skills/phase/autonomous/SKILL.md +2 -2
  300. package/dist/skills/phase/branch-planning/SKILL.md +12 -12
  301. package/dist/skills/phase/bug-fixing/SKILL.md +1 -1
  302. package/dist/skills/phase/code-implementation/SKILL.md +6 -6
  303. package/dist/skills/phase/code-implementation-verification/SKILL.md +3 -3
  304. package/dist/skills/phase/code-testing/SKILL.md +5 -5
  305. package/dist/skills/phase/functional-testing/SKILL.md +3 -3
  306. package/dist/skills/phase/growth-analysis/SKILL.md +8 -8
  307. package/dist/skills/phase/incremental-sync/SKILL.md +6 -6
  308. package/dist/skills/phase/intelligence-analysis/SKILL.md +7 -7
  309. package/dist/skills/phase/{feature-analysis → issue-analysis}/SKILL.md +8 -8
  310. package/dist/skills/phase/pr-execution/SKILL.md +7 -7
  311. package/dist/skills/phase/pr-splitting/SKILL.md +14 -14
  312. package/dist/skills/phase/smoke-test/SKILL.md +1 -1
  313. package/dist/skills/phase/technical-design/SKILL.md +5 -5
  314. package/dist/skills/phase/test-cases-analysis/SKILL.md +4 -4
  315. package/dist/skills/phase/user-stories-analysis/SKILL.md +13 -13
  316. package/dist/system/session-manager.d.ts +3 -3
  317. package/dist/system/session-manager.js +3 -3
  318. package/dist/system/sleep-notification.js +2 -2
  319. package/dist/system/sleep-prevention.js +1 -1
  320. package/dist/types/index.d.ts +21 -21
  321. package/dist/types/{features.d.ts → issues.d.ts} +3 -3
  322. package/dist/types/pipeline.d.ts +4 -4
  323. package/dist/updater/auto-updater.d.ts +2 -2
  324. package/dist/updater/auto-updater.js +3 -3
  325. package/dist/utils/conflict-resolver.d.ts +1 -1
  326. package/dist/utils/conflict-resolver.js +5 -5
  327. package/dist/utils/formatters.d.ts +4 -4
  328. package/dist/utils/formatters.js +29 -29
  329. package/dist/utils/git-branch-manager-async.d.ts +6 -6
  330. package/dist/utils/git-branch-manager-async.js +41 -41
  331. package/dist/utils/git-branch-manager.d.ts +11 -11
  332. package/dist/utils/git-branch-manager.js +42 -42
  333. package/dist/utils/image-downloader.d.ts +4 -4
  334. package/dist/utils/image-downloader.js +17 -17
  335. package/dist/utils/pipeline-logger.d.ts +1 -1
  336. package/dist/utils/pipeline-logger.js +5 -5
  337. package/dist/workspace/workspace-manager.d.ts +17 -17
  338. package/dist/workspace/workspace-manager.js +21 -21
  339. package/package.json +1 -1
  340. package/vitest.config.ts +4 -0
  341. package/dist/api/__tests__/app-store.test.d.ts +0 -7
  342. package/dist/api/__tests__/app-store.test.js +0 -60
  343. package/dist/api/__tests__/intelligence.test.d.ts +0 -11
  344. package/dist/api/__tests__/intelligence.test.js +0 -315
  345. package/dist/api/features/__tests__/feature-utils.test.d.ts +0 -4
  346. package/dist/api/features/__tests__/feature-utils.test.js +0 -370
  347. package/dist/api/features/__tests__/status-updater.test.d.ts +0 -4
  348. package/dist/api/features/__tests__/status-updater.test.js +0 -88
  349. package/dist/api/features/approval-checker.d.ts +0 -20
  350. package/dist/api/features/feature-utils.d.ts +0 -23
  351. package/dist/api/features/feature-utils.js +0 -80
  352. package/dist/api/features/get-feature.d.ts +0 -5
  353. package/dist/api/features/get-feature.js +0 -21
  354. package/dist/api/features/index.d.ts +0 -8
  355. package/dist/api/features/index.js +0 -10
  356. package/dist/api/features/status-updater.d.ts +0 -41
  357. package/dist/api/features/update-feature.d.ts +0 -20
  358. package/dist/commands/build/__tests__/build.test.d.ts +0 -5
  359. package/dist/commands/build/__tests__/build.test.js +0 -206
  360. package/dist/commands/build/__tests__/detect-project.test.d.ts +0 -6
  361. package/dist/commands/build/__tests__/detect-project.test.js +0 -160
  362. package/dist/commands/build/__tests__/run-build.test.d.ts +0 -6
  363. package/dist/commands/build/__tests__/run-build.test.js +0 -433
  364. package/dist/commands/intelligence/__tests__/command.test.d.ts +0 -4
  365. package/dist/commands/intelligence/__tests__/command.test.js +0 -48
  366. package/dist/commands/workflow/core/__tests__/feature-filter.test.d.ts +0 -5
  367. package/dist/commands/workflow/core/__tests__/feature-filter.test.js +0 -316
  368. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.d.ts +0 -4
  369. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.js +0 -397
  370. package/dist/commands/workflow/core/__tests__/state-manager.test.d.ts +0 -4
  371. package/dist/commands/workflow/core/__tests__/state-manager.test.js +0 -384
  372. package/dist/commands/workflow/core/feature-filter.d.ts +0 -16
  373. package/dist/commands/workflow/core/feature-filter.js +0 -47
  374. package/dist/commands/workflow/feature-coordinator.d.ts +0 -18
  375. package/dist/config/__tests__/config.test.d.ts +0 -4
  376. package/dist/config/__tests__/config.test.js +0 -286
  377. package/dist/config/__tests__/feature-status.test.d.ts +0 -4
  378. package/dist/config/__tests__/feature-status.test.js +0 -111
  379. package/dist/errors/__tests__/index.test.d.ts +0 -4
  380. package/dist/errors/__tests__/index.test.js +0 -349
  381. package/dist/phases/app-store-generation/__tests__/agent.test.d.ts +0 -5
  382. package/dist/phases/app-store-generation/__tests__/agent.test.js +0 -142
  383. package/dist/phases/app-store-generation/__tests__/context.test.d.ts +0 -4
  384. package/dist/phases/app-store-generation/__tests__/context.test.js +0 -284
  385. package/dist/phases/app-store-generation/__tests__/prompts.test.d.ts +0 -4
  386. package/dist/phases/app-store-generation/__tests__/prompts.test.js +0 -122
  387. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.d.ts +0 -5
  388. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.js +0 -826
  389. package/dist/phases/code-review/__tests__/diff-utils.test.js +0 -101
  390. package/dist/phases/feature-analysis/context.d.ts +0 -24
  391. package/dist/phases/feature-analysis/index.d.ts +0 -8
  392. package/dist/phases/feature-analysis/outcome.d.ts +0 -40
  393. package/dist/phases/intelligence-analysis/__tests__/context.test.d.ts +0 -4
  394. package/dist/phases/intelligence-analysis/__tests__/context.test.js +0 -192
  395. package/dist/phases/intelligence-analysis/__tests__/matching.test.d.ts +0 -13
  396. package/dist/phases/intelligence-analysis/__tests__/matching.test.js +0 -154
  397. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.d.ts +0 -5
  398. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.js +0 -378
  399. package/dist/phases/intelligence-analysis/__tests__/prompts.test.d.ts +0 -4
  400. package/dist/phases/intelligence-analysis/__tests__/prompts.test.js +0 -33
  401. package/dist/phases/pr-execution/__tests__/file-assigner.test.d.ts +0 -1
  402. package/dist/phases/pr-execution/__tests__/file-assigner.test.js +0 -303
  403. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.d.ts +0 -1
  404. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.js +0 -157
  405. package/dist/phases/pr-resolve/__tests__/prompts.test.d.ts +0 -1
  406. package/dist/phases/pr-resolve/__tests__/prompts.test.js +0 -116
  407. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.d.ts +0 -1
  408. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.js +0 -138
  409. package/dist/phases/pr-resolve/__tests__/types.test.d.ts +0 -1
  410. package/dist/phases/pr-resolve/__tests__/types.test.js +0 -43
  411. package/dist/phases/pr-resolve/__tests__/workspace.test.d.ts +0 -1
  412. package/dist/phases/pr-resolve/__tests__/workspace.test.js +0 -111
  413. package/dist/phases/pr-review/__tests__/prompts.test.d.ts +0 -1
  414. package/dist/phases/pr-review/__tests__/prompts.test.js +0 -49
  415. package/dist/phases/pr-review/__tests__/review-comments.test.d.ts +0 -1
  416. package/dist/phases/pr-review/__tests__/review-comments.test.js +0 -110
  417. package/dist/phases/pr-shared/__tests__/agent-utils.test.d.ts +0 -1
  418. package/dist/phases/pr-shared/__tests__/agent-utils.test.js +0 -91
  419. package/dist/phases/pr-shared/__tests__/context.test.d.ts +0 -1
  420. package/dist/phases/pr-shared/__tests__/context.test.js +0 -94
  421. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.d.ts +0 -1
  422. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.js +0 -331
  423. package/dist/phases/run-sheet/render.d.ts +0 -60
  424. package/dist/phases/run-sheet/render.js +0 -297
  425. package/dist/phases/smoke-test/__tests__/agent.test.d.ts +0 -4
  426. package/dist/phases/smoke-test/__tests__/agent.test.js +0 -84
  427. package/dist/phases/smoke-test/__tests__/github.test.d.ts +0 -9
  428. package/dist/phases/smoke-test/__tests__/github.test.js +0 -120
  429. package/dist/phases/smoke-test/__tests__/snapshot.test.d.ts +0 -8
  430. package/dist/phases/smoke-test/__tests__/snapshot.test.js +0 -93
  431. package/dist/phases/smoke-test/github.d.ts +0 -54
  432. package/dist/phases/smoke-test/github.js +0 -101
  433. package/dist/phases/smoke-test/snapshot.d.ts +0 -27
  434. package/dist/phases/smoke-test/snapshot.js +0 -157
  435. package/dist/services/coaching/__tests__/coaching-agent.test.d.ts +0 -1
  436. package/dist/services/coaching/__tests__/coaching-agent.test.js +0 -74
  437. package/dist/services/coaching/__tests__/coaching-loop.test.d.ts +0 -1
  438. package/dist/services/coaching/__tests__/coaching-loop.test.js +0 -59
  439. package/dist/services/coaching/__tests__/self-rating.test.d.ts +0 -1
  440. package/dist/services/coaching/__tests__/self-rating.test.js +0 -188
  441. package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.d.ts +0 -4
  442. package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.js +0 -133
  443. package/dist/services/lifecycle-agent/__tests__/transition-rules.test.d.ts +0 -4
  444. package/dist/services/lifecycle-agent/__tests__/transition-rules.test.js +0 -336
  445. package/dist/services/lifecycle-agent/index.d.ts +0 -24
  446. package/dist/services/lifecycle-agent/index.js +0 -25
  447. package/dist/services/lifecycle-agent/phase-criteria.d.ts +0 -57
  448. package/dist/services/lifecycle-agent/phase-criteria.js +0 -335
  449. package/dist/services/lifecycle-agent/transition-rules.d.ts +0 -60
  450. package/dist/services/lifecycle-agent/transition-rules.js +0 -184
  451. package/dist/services/lifecycle-agent/types.d.ts +0 -190
  452. package/dist/services/lifecycle-agent/types.js +0 -12
  453. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.d.ts +0 -1
  454. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.js +0 -122
  455. package/dist/services/phase-hooks/__tests__/hook-executor.test.d.ts +0 -1
  456. package/dist/services/phase-hooks/__tests__/hook-executor.test.js +0 -321
  457. package/dist/services/phase-hooks/__tests__/hook-runner.test.d.ts +0 -1
  458. package/dist/services/phase-hooks/__tests__/hook-runner.test.js +0 -261
  459. package/dist/services/phase-hooks/__tests__/plugin-loader.test.d.ts +0 -1
  460. package/dist/services/phase-hooks/__tests__/plugin-loader.test.js +0 -158
  461. package/dist/services/video/__tests__/video-pipeline.test.d.ts +0 -6
  462. package/dist/services/video/__tests__/video-pipeline.test.js +0 -249
  463. package/dist/types/features.js +0 -1
  464. package/dist/workspace/__tests__/workspace-manager.test.d.ts +0 -7
  465. package/dist/workspace/__tests__/workspace-manager.test.js +0 -52
  466. /package/dist/api/{features → issues}/batch-operations.d.ts +0 -0
  467. /package/dist/api/{features → issues}/batch-operations.js +0 -0
  468. /package/dist/phases/{feature-analysis → issue-analysis}/agent.d.ts +0 -0
  469. /package/dist/skills/phase/{feature-analysis-verification → issue-analysis-verification}/SKILL.md +0 -0
  470. /package/dist/{phases/code-review/__tests__/diff-utils.test.d.ts → types/issues.js} +0 -0
@@ -1,4 +0,0 @@
1
- /**
2
- * Unit tests for smoke-test agent response parsing.
3
- */
4
- export {};
@@ -1,84 +0,0 @@
1
- /**
2
- * Unit tests for smoke-test agent response parsing.
3
- */
4
- import assert from 'node:assert';
5
- import { describe, it } from 'node:test';
6
- import { extractJson, findBalancedJsonObject } from '../agent.js';
7
- void describe('extractJson', () => {
8
- void it('parses a plain JSON object', () => {
9
- const raw = `{
10
- "summary": "one thing changed",
11
- "test_cases": [
12
- { "name": "login still works", "description": "step 1", "is_critical": true }
13
- ]
14
- }`;
15
- const parsed = extractJson(raw);
16
- assert.strictEqual(parsed.summary, 'one thing changed');
17
- assert.strictEqual(parsed.test_cases.length, 1);
18
- assert.strictEqual(parsed.test_cases[0].is_critical, true);
19
- });
20
- void it('strips ```json fences', () => {
21
- const raw = '```json\n{"summary":"x","test_cases":[{"name":"a","description":"b"}]}\n```';
22
- const parsed = extractJson(raw);
23
- assert.strictEqual(parsed.summary, 'x');
24
- assert.strictEqual(parsed.test_cases[0].name, 'a');
25
- });
26
- void it('strips unlabeled fences', () => {
27
- const raw = '```\n{"summary":"x","test_cases":[]}\n```';
28
- const parsed = extractJson(raw);
29
- assert.deepStrictEqual(parsed.test_cases, []);
30
- });
31
- void it('tolerates leading and trailing prose', () => {
32
- const raw = `Here you go:
33
- {"summary":"x","test_cases":[{"name":"a","description":"b"}]}
34
-
35
- Hope that helps.`;
36
- const parsed = extractJson(raw);
37
- assert.strictEqual(parsed.summary, 'x');
38
- });
39
- void it('throws when test_cases is missing', () => {
40
- assert.throws(() => extractJson('{"summary":"x"}'), /test_cases/);
41
- });
42
- void it('throws on invalid JSON', () => {
43
- assert.throws(() => extractJson('not json'));
44
- });
45
- void it('picks the first balanced object when prose contains decoy braces', () => {
46
- const raw = 'Note: { pseudo-json example } but the real answer is:\n' +
47
- '{"summary":"x","test_cases":[{"name":"a","description":"b"}]}\n' +
48
- 'Let me know if you want changes.';
49
- const parsed = extractJson(raw);
50
- assert.strictEqual(parsed.summary, 'x');
51
- assert.strictEqual(parsed.test_cases[0].name, 'a');
52
- });
53
- void it('preserves braces inside JSON string values', () => {
54
- const raw = '{"summary":"changes to {pricing} and {checkout}","test_cases":[{"name":"n","description":"d"}]}';
55
- const parsed = extractJson(raw);
56
- assert.strictEqual(parsed.summary, 'changes to {pricing} and {checkout}');
57
- });
58
- void it('throws when test_cases is not an array', () => {
59
- assert.throws(() => extractJson('{"summary":"x","test_cases":"nope"}'), /test_cases/);
60
- });
61
- });
62
- void describe('findBalancedJsonObject', () => {
63
- void it('returns null when there is no opening brace', () => {
64
- assert.strictEqual(findBalancedJsonObject('no braces here'), null);
65
- });
66
- void it('returns the first balanced top-level object', () => {
67
- assert.strictEqual(findBalancedJsonObject('prefix {"a": 1} and {"b": 2} suffix'), '{"a": 1}');
68
- });
69
- void it('handles nested braces', () => {
70
- const text = 'xxx {"a": {"b": {"c": 1}}} yyy';
71
- assert.strictEqual(findBalancedJsonObject(text), '{"a": {"b": {"c": 1}}}');
72
- });
73
- void it('ignores braces inside strings', () => {
74
- const text = '{"msg": "this has { and } inside", "ok": true}';
75
- assert.strictEqual(findBalancedJsonObject(text), text);
76
- });
77
- void it('handles escaped quotes inside strings', () => {
78
- const text = '{"msg": "she said \\"hi\\" {not object}"}';
79
- assert.strictEqual(findBalancedJsonObject(text), text);
80
- });
81
- void it('returns null on unbalanced input', () => {
82
- assert.strictEqual(findBalancedJsonObject('{"a": 1'), null);
83
- });
84
- });
@@ -1,9 +0,0 @@
1
- /**
2
- * Unit tests for smoke-test github helpers.
3
- *
4
- * Covers the pure functions that shape GitHub compare data into a
5
- * prompt-ready digest. Network-facing functions (fetchLatestTwoReleases,
6
- * fetchCompare) are exercised only indirectly — their output shape is
7
- * fed through buildDiffDigest / summariseStats here.
8
- */
9
- export {};
@@ -1,120 +0,0 @@
1
- /**
2
- * Unit tests for smoke-test github helpers.
3
- *
4
- * Covers the pure functions that shape GitHub compare data into a
5
- * prompt-ready digest. Network-facing functions (fetchLatestTwoReleases,
6
- * fetchCompare) are exercised only indirectly — their output shape is
7
- * fed through buildDiffDigest / summariseStats here.
8
- */
9
- import assert from 'node:assert';
10
- import { describe, it } from 'node:test';
11
- import { buildDiffDigest, summariseStats, } from '../github.js';
12
- function makeCompare(over = {}) {
13
- return {
14
- total_commits: 2,
15
- commits: [
16
- {
17
- sha: '1111111aaaaaaaa',
18
- commit: { message: 'feat: add checkout flow\n\nmore body', author: null },
19
- },
20
- {
21
- sha: '2222222bbbbbbbb',
22
- commit: { message: 'fix: null deref', author: { name: 'Ada' } },
23
- },
24
- ],
25
- files: [
26
- {
27
- filename: 'src/checkout.ts',
28
- status: 'modified',
29
- additions: 10,
30
- deletions: 2,
31
- changes: 12,
32
- patch: '@@ -1 +1 @@\n-old\n+new',
33
- },
34
- {
35
- filename: 'src/util.ts',
36
- status: 'added',
37
- additions: 5,
38
- deletions: 0,
39
- changes: 5,
40
- },
41
- ],
42
- ...over,
43
- };
44
- }
45
- void describe('summariseStats', () => {
46
- void it('sums additions, deletions, and file count', () => {
47
- const stats = summariseStats(makeCompare());
48
- assert.deepStrictEqual(stats, {
49
- files_changed: 2,
50
- additions: 15,
51
- deletions: 2,
52
- total_commits: 2,
53
- });
54
- });
55
- void it('handles an empty diff', () => {
56
- const stats = summariseStats({
57
- total_commits: 0,
58
- commits: [],
59
- files: [],
60
- });
61
- assert.deepStrictEqual(stats, {
62
- files_changed: 0,
63
- additions: 0,
64
- deletions: 0,
65
- total_commits: 0,
66
- });
67
- });
68
- });
69
- void describe('buildDiffDigest', () => {
70
- void it('includes commit subjects, file list, and patches', () => {
71
- const digest = buildDiffDigest(makeCompare());
72
- assert.match(digest, /Total commits: 2/);
73
- assert.match(digest, /1111111 feat: add checkout flow/);
74
- assert.match(digest, /2222222 fix: null deref/);
75
- assert.match(digest, /modified src\/checkout\.ts \(\+10\/-2\)/);
76
- assert.match(digest, /added src\/util\.ts \(\+5\/-0\)/);
77
- assert.match(digest, /--- src\/checkout\.ts ---/);
78
- assert.match(digest, /\+new/);
79
- });
80
- void it('truncates only the subject line of multi-line commit messages', () => {
81
- const digest = buildDiffDigest(makeCompare());
82
- // "more body" from the first commit's message body must not leak in.
83
- assert.ok(!digest.includes('more body'));
84
- });
85
- void it('caps the patch budget and appends a truncation marker', () => {
86
- const huge = 'x'.repeat(200_000);
87
- const compare = makeCompare({
88
- files: [
89
- {
90
- filename: 'src/big.ts',
91
- status: 'modified',
92
- additions: 1,
93
- deletions: 0,
94
- changes: 1,
95
- patch: huge,
96
- },
97
- ],
98
- });
99
- const digest = buildDiffDigest(compare);
100
- assert.match(digest, /\[truncated\]/);
101
- // Even with a 200k patch, digest stays bounded by the internal budget.
102
- assert.ok(digest.length < 200_000);
103
- });
104
- void it('skips files without patches in the patches section', () => {
105
- const compare = makeCompare({
106
- files: [
107
- {
108
- filename: 'vendored.min.js',
109
- status: 'added',
110
- additions: 1,
111
- deletions: 0,
112
- changes: 1,
113
- },
114
- ],
115
- });
116
- const digest = buildDiffDigest(compare);
117
- assert.ok(digest.includes('== Patches (truncated) =='));
118
- assert.ok(!digest.includes('--- vendored.min.js ---'));
119
- });
120
- });
@@ -1,8 +0,0 @@
1
- /**
2
- * Unit tests for snapshot-detection pure helpers.
3
- *
4
- * The network / SDK path (`detectSnapshotVersion`) is not covered here
5
- * — it's exercised end-to-end when the CLI runs — but the parser and
6
- * the plausibility check are critical and easy to cover.
7
- */
8
- export {};
@@ -1,93 +0,0 @@
1
- /**
2
- * Unit tests for snapshot-detection pure helpers.
3
- *
4
- * The network / SDK path (`detectSnapshotVersion`) is not covered here
5
- * — it's exercised end-to-end when the CLI runs — but the parser and
6
- * the plausibility check are critical and easy to cover.
7
- */
8
- import assert from 'node:assert';
9
- import { describe, it } from 'node:test';
10
- import { buildSnapshotDetectionPrompt, isPlausibleSnapshotTag, parseSnapshotDetection, } from '../snapshot.js';
11
- void describe('parseSnapshotDetection', () => {
12
- void it('parses a clean JSON object', () => {
13
- const raw = '{"snapshot_tag":"v2.0.0","source":"package.json","reasoning":"next ver"}';
14
- const parsed = parseSnapshotDetection(raw);
15
- assert.strictEqual(parsed.snapshot_tag, 'v2.0.0');
16
- assert.strictEqual(parsed.source, 'package.json');
17
- assert.match(parsed.reasoning, /next ver/);
18
- });
19
- void it('strips ```json fences', () => {
20
- const raw = '```json\n{"snapshot_tag":"v1.0.1","source":"VERSION","reasoning":"x"}\n```';
21
- const parsed = parseSnapshotDetection(raw);
22
- assert.strictEqual(parsed.snapshot_tag, 'v1.0.1');
23
- });
24
- void it('tolerates leading and trailing prose', () => {
25
- const raw = `I checked package.json:
26
- {"snapshot_tag":"v3.0.0","source":"package.json","reasoning":"bumped"}
27
- Done.`;
28
- const parsed = parseSnapshotDetection(raw);
29
- assert.strictEqual(parsed.snapshot_tag, 'v3.0.0');
30
- });
31
- void it('returns null snapshot_tag when model reports no snapshot', () => {
32
- const raw = '{"snapshot_tag": null, "source": null, "reasoning": "version matches latest release"}';
33
- const parsed = parseSnapshotDetection(raw);
34
- assert.strictEqual(parsed.snapshot_tag, null);
35
- assert.strictEqual(parsed.source, null);
36
- });
37
- void it('treats empty string snapshot_tag as null', () => {
38
- const raw = '{"snapshot_tag":"","source":null,"reasoning":"nothing found"}';
39
- const parsed = parseSnapshotDetection(raw);
40
- assert.strictEqual(parsed.snapshot_tag, null);
41
- });
42
- void it('falls back to balanced-brace extraction for surrounding prose', () => {
43
- const raw = 'Analysis: { could be v1 } — but the real answer is ' +
44
- '{"snapshot_tag":"v1.2.0","source":"CHANGELOG","reasoning":"unreleased section present"}';
45
- const parsed = parseSnapshotDetection(raw);
46
- assert.strictEqual(parsed.snapshot_tag, 'v1.2.0');
47
- assert.strictEqual(parsed.source, 'CHANGELOG');
48
- });
49
- void it('throws when no JSON object is present', () => {
50
- assert.throws(() => parseSnapshotDetection('no json at all'), /JSON/);
51
- });
52
- void it('supplies default reasoning when missing', () => {
53
- const raw = '{"snapshot_tag":"v1","source":"package.json"}';
54
- const parsed = parseSnapshotDetection(raw);
55
- assert.strictEqual(parsed.snapshot_tag, 'v1');
56
- assert.strictEqual(parsed.reasoning, '(no reasoning given)');
57
- });
58
- });
59
- void describe('isPlausibleSnapshotTag', () => {
60
- void it('accepts normal version tags', () => {
61
- assert.strictEqual(isPlausibleSnapshotTag('v2.0.0', 'v1.9.0'), true);
62
- assert.strictEqual(isPlausibleSnapshotTag('2.0.0-rc.1', '1.9.0'), true);
63
- assert.strictEqual(isPlausibleSnapshotTag('v1.2.3-SNAPSHOT', 'v1.2.2'), true);
64
- assert.strictEqual(isPlausibleSnapshotTag('release/2.0', 'release/1.9'), true);
65
- });
66
- void it('rejects tags identical to the latest release', () => {
67
- assert.strictEqual(isPlausibleSnapshotTag('v1.0.0', 'v1.0.0'), false);
68
- });
69
- void it('rejects empty or overlong tags', () => {
70
- assert.strictEqual(isPlausibleSnapshotTag('', 'v1'), false);
71
- assert.strictEqual(isPlausibleSnapshotTag('x'.repeat(101), 'v1'), false);
72
- });
73
- void it('rejects whitespace and shell metacharacters', () => {
74
- assert.strictEqual(isPlausibleSnapshotTag('v 2', 'v1'), false);
75
- assert.strictEqual(isPlausibleSnapshotTag('v2;rm -rf', 'v1'), false);
76
- assert.strictEqual(isPlausibleSnapshotTag('v2$PATH', 'v1'), false);
77
- });
78
- void it('rejects leading dot or dash, double dot, @{ reflog', () => {
79
- assert.strictEqual(isPlausibleSnapshotTag('.v2', 'v1'), false);
80
- assert.strictEqual(isPlausibleSnapshotTag('-v2', 'v1'), false);
81
- assert.strictEqual(isPlausibleSnapshotTag('v2..rc', 'v1'), false);
82
- assert.strictEqual(isPlausibleSnapshotTag('v2@{1}', 'v1'), false);
83
- });
84
- });
85
- void describe('buildSnapshotDetectionPrompt', () => {
86
- void it('injects the latest release tag into the prompt', () => {
87
- const prompt = buildSnapshotDetectionPrompt('v1.4.2');
88
- assert.match(prompt, /v1\.4\.2/);
89
- // Must ask for JSON output
90
- assert.match(prompt, /JSON/);
91
- assert.match(prompt, /snapshot_tag/);
92
- });
93
- });
@@ -1,54 +0,0 @@
1
- /**
2
- * GitHub release helpers for smoke-test generation, implemented on top of
3
- * @octokit/rest so we share retry / rate-limit / User-Agent behavior with the
4
- * rest of the packages/edsger codebase.
5
- */
6
- export interface GithubRelease {
7
- id: number;
8
- tag_name: string;
9
- name: string | null;
10
- body: string | null;
11
- html_url: string;
12
- published_at: string | null;
13
- draft: boolean;
14
- prerelease: boolean;
15
- }
16
- export interface CompareFile {
17
- filename: string;
18
- status: string;
19
- additions: number;
20
- deletions: number;
21
- changes: number;
22
- patch?: string;
23
- }
24
- export interface CompareCommit {
25
- sha: string;
26
- commit: {
27
- message: string;
28
- author?: {
29
- name?: string;
30
- } | null;
31
- };
32
- }
33
- export interface CompareResponse {
34
- total_commits: number;
35
- files: CompareFile[];
36
- commits: CompareCommit[];
37
- }
38
- export interface ReleasePair {
39
- latest: GithubRelease;
40
- previous: GithubRelease | null;
41
- }
42
- export declare function fetchLatestTwoReleases(owner: string, repo: string, token: string): Promise<ReleasePair>;
43
- export declare function getDefaultBranchHead(owner: string, repo: string, token: string): Promise<{
44
- branch: string;
45
- sha: string;
46
- }>;
47
- export declare function fetchCompare(owner: string, repo: string, base: string, head: string, token: string): Promise<CompareResponse>;
48
- export declare function buildDiffDigest(compare: CompareResponse): string;
49
- export declare function summariseStats(compare: CompareResponse): {
50
- files_changed: number;
51
- additions: number;
52
- deletions: number;
53
- total_commits: number;
54
- };
@@ -1,101 +0,0 @@
1
- /**
2
- * GitHub release helpers for smoke-test generation, implemented on top of
3
- * @octokit/rest so we share retry / rate-limit / User-Agent behavior with the
4
- * rest of the packages/edsger codebase.
5
- */
6
- import { Octokit } from '@octokit/rest';
7
- const MAX_PATCH_CHARS = 60_000;
8
- const MAX_COMMITS_INCLUDED = 40;
9
- function octokit(token) {
10
- return new Octokit({ auth: token, userAgent: 'edsger-cli' });
11
- }
12
- export async function fetchLatestTwoReleases(owner, repo, token) {
13
- const gh = octokit(token);
14
- const { data } = await gh.repos.listReleases({ owner, repo, per_page: 10 });
15
- const real = data.filter((r) => !r.draft);
16
- if (real.length === 0) {
17
- throw new Error(`Repository ${owner}/${repo} has no releases yet. Publish one first.`);
18
- }
19
- return { latest: real[0], previous: real[1] ?? null };
20
- }
21
- export async function getDefaultBranchHead(owner, repo, token) {
22
- const gh = octokit(token);
23
- const { data: repoInfo } = await gh.repos.get({ owner, repo });
24
- const branch = repoInfo.default_branch;
25
- const { data: branchInfo } = await gh.repos.getBranch({
26
- owner,
27
- repo,
28
- branch,
29
- });
30
- return { branch, sha: branchInfo.commit.sha };
31
- }
32
- export async function fetchCompare(owner, repo, base, head, token) {
33
- const gh = octokit(token);
34
- const { data } = await gh.repos.compareCommits({
35
- owner,
36
- repo,
37
- base,
38
- head,
39
- });
40
- // Octokit returns a richer shape; narrow to the subset we consume.
41
- return {
42
- total_commits: data.total_commits ?? 0,
43
- files: (data.files ?? []).map((f) => ({
44
- filename: f.filename,
45
- status: f.status,
46
- additions: f.additions ?? 0,
47
- deletions: f.deletions ?? 0,
48
- changes: f.changes ?? 0,
49
- patch: f.patch,
50
- })),
51
- commits: (data.commits ?? []).map((c) => ({
52
- sha: c.sha,
53
- commit: {
54
- message: c.commit?.message ?? '',
55
- author: c.commit?.author
56
- ? { name: c.commit.author.name ?? undefined }
57
- : null,
58
- },
59
- })),
60
- };
61
- }
62
- export function buildDiffDigest(compare) {
63
- const lines = [];
64
- lines.push(`Total commits: ${compare.total_commits}`);
65
- lines.push('\n== Commits ==');
66
- for (const c of compare.commits.slice(0, MAX_COMMITS_INCLUDED)) {
67
- const subject = (c.commit.message || '').split('\n')[0].slice(0, 200);
68
- lines.push(`- ${c.sha.slice(0, 7)} ${subject}`);
69
- }
70
- lines.push('\n== Files ==');
71
- for (const f of compare.files) {
72
- lines.push(`- ${f.status} ${f.filename} (+${f.additions}/-${f.deletions})`);
73
- }
74
- lines.push('\n== Patches (truncated) ==');
75
- let budget = MAX_PATCH_CHARS;
76
- for (const f of compare.files) {
77
- if (budget <= 0 || !f.patch) {
78
- continue;
79
- }
80
- const header = `\n--- ${f.filename} ---\n`;
81
- const piece = header + f.patch;
82
- if (piece.length > budget) {
83
- lines.push(piece.slice(0, budget));
84
- lines.push('\n...[truncated]');
85
- budget = 0;
86
- }
87
- else {
88
- lines.push(piece);
89
- budget -= piece.length;
90
- }
91
- }
92
- return lines.join('\n');
93
- }
94
- export function summariseStats(compare) {
95
- return {
96
- files_changed: compare.files.length,
97
- additions: compare.files.reduce((s, f) => s + f.additions, 0),
98
- deletions: compare.files.reduce((s, f) => s + f.deletions, 0),
99
- total_commits: compare.total_commits,
100
- };
101
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Snapshot detection: after the latest GitHub release already has a
3
- * smoke-test plan, inspect the cloned repo for a yet-to-be-released
4
- * "snapshot" version (next package.json version, an [Unreleased] entry
5
- * in CHANGELOG, an unreleased git tag, etc.) so we can prepare the
6
- * next smoke test before anyone cuts the tag on GitHub.
7
- */
8
- import { type EdsgerConfig } from '../../types/index.js';
9
- export interface SnapshotDetection {
10
- snapshot_tag: string | null;
11
- source: string | null;
12
- reasoning: string;
13
- }
14
- export declare function buildSnapshotDetectionPrompt(latestReleaseTag: string): string;
15
- export declare function parseSnapshotDetection(raw: string): SnapshotDetection;
16
- /**
17
- * Very loose sanity check on a proposed snapshot tag. We reject tags
18
- * that are obviously the same as the latest release or that contain
19
- * characters that would break downstream git / GitHub API calls.
20
- */
21
- export declare function isPlausibleSnapshotTag(candidate: string, latestReleaseTag: string): boolean;
22
- export declare function detectSnapshotVersion(options: {
23
- cwd: string;
24
- latestReleaseTag: string;
25
- config: EdsgerConfig;
26
- verbose?: boolean;
27
- }): Promise<SnapshotDetection>;
@@ -1,157 +0,0 @@
1
- /**
2
- * Snapshot detection: after the latest GitHub release already has a
3
- * smoke-test plan, inspect the cloned repo for a yet-to-be-released
4
- * "snapshot" version (next package.json version, an [Unreleased] entry
5
- * in CHANGELOG, an unreleased git tag, etc.) so we can prepare the
6
- * next smoke test before anyone cuts the tag on GitHub.
7
- */
8
- import { query } from '@anthropic-ai/claude-agent-sdk';
9
- import { DEFAULT_MODEL } from '../../constants.js';
10
- import { logDebug, logInfo } from '../../utils/logger.js';
11
- import { findBalancedJsonObject } from './agent.js';
12
- export function buildSnapshotDetectionPrompt(latestReleaseTag) {
13
- return `You are inspecting a code repository to decide whether an unreleased "snapshot" version is being prepared.
14
-
15
- The most recent shipped release on GitHub is tagged: **${latestReleaseTag}**
16
-
17
- Your job:
18
-
19
- 1. Read the repository's primary version source. In priority order:
20
- - package.json "version" field (JS/TS projects)
21
- - Cargo.toml [package] version (Rust)
22
- - pyproject.toml [project] / [tool.poetry] version (Python)
23
- - pom.xml <version> (Java / Maven)
24
- - VERSION file (plain text)
25
- 2. Read CHANGELOG.md / HISTORY.md / RELEASES.md for an [Unreleased] or similarly labelled section.
26
- 3. Run \`git tag --list\` and \`git tag --sort=-creatordate | head -5\` to look for tags newer than ${latestReleaseTag} that have not yet been cut as GitHub releases.
27
-
28
- Then decide:
29
- - If the primary version source is strictly greater than ${latestReleaseTag} (accounting for "v" prefixes and semver prerelease suffixes like \`-SNAPSHOT\`, \`-rc.1\`, \`-next.0\`), OR there is a newer unreleased git tag, report that string as \`snapshot_tag\`.
30
- - Otherwise report \`snapshot_tag: null\`.
31
- - Do NOT invent a version. Use the exact string from the source file. Preserve the repo's existing tag convention (e.g. if releases are \`v1.2.3\` but package.json says \`1.2.3\`, return \`v1.2.3\`).
32
-
33
- Respond with ONLY a JSON object — no prose, no markdown fences:
34
-
35
- {
36
- "snapshot_tag": "v2.0.0" | null,
37
- "source": "package.json" | "Cargo.toml" | "pyproject.toml" | "pom.xml" | "VERSION" | "CHANGELOG" | "git_tag" | null,
38
- "reasoning": "<one sentence>"
39
- }`;
40
- }
41
- export function parseSnapshotDetection(raw) {
42
- let body = raw.trim();
43
- const fence = body.match(/```(?:json)?\s*([\s\S]*?)```/);
44
- if (fence) {
45
- body = fence[1].trim();
46
- }
47
- let parsed;
48
- try {
49
- parsed = JSON.parse(body);
50
- }
51
- catch {
52
- const object = findBalancedJsonObject(body);
53
- if (!object) {
54
- throw new Error('No JSON object found in snapshot-detection output');
55
- }
56
- parsed = JSON.parse(object);
57
- }
58
- if (typeof parsed !== 'object' || parsed === null) {
59
- throw new Error('Snapshot detection returned non-object response');
60
- }
61
- const obj = parsed;
62
- const rawTag = obj.snapshot_tag;
63
- const snapshotTag = typeof rawTag === 'string' && rawTag.trim().length > 0
64
- ? rawTag.trim()
65
- : null;
66
- const source = typeof obj.source === 'string' ? obj.source : null;
67
- const reasoning = typeof obj.reasoning === 'string' ? obj.reasoning : '(no reasoning given)';
68
- return { snapshot_tag: snapshotTag, source, reasoning };
69
- }
70
- /**
71
- * Very loose sanity check on a proposed snapshot tag. We reject tags
72
- * that are obviously the same as the latest release or that contain
73
- * characters that would break downstream git / GitHub API calls.
74
- */
75
- export function isPlausibleSnapshotTag(candidate, latestReleaseTag) {
76
- if (candidate === latestReleaseTag) {
77
- return false;
78
- }
79
- if (candidate.length === 0 || candidate.length > 100) {
80
- return false;
81
- }
82
- if (/\s/.test(candidate)) {
83
- return false;
84
- }
85
- if (/^[-.]/.test(candidate) || candidate.includes('..') || candidate.includes('@{')) {
86
- return false;
87
- }
88
- return /^[A-Za-z0-9._\-+/@]+$/.test(candidate);
89
- }
90
- function userMessage(content) {
91
- return { type: 'user', message: { role: 'user', content } };
92
- }
93
- // eslint-disable-next-line @typescript-eslint/require-await -- async generator required by SDK interface
94
- async function* makePrompt(text) {
95
- yield userMessage(text);
96
- }
97
- // eslint-disable-next-line complexity -- agent loop with message-type handling
98
- export async function detectSnapshotVersion(options) {
99
- const { cwd, latestReleaseTag, config, verbose } = options;
100
- if (verbose) {
101
- logInfo(`Detecting snapshot version ahead of ${latestReleaseTag}...`);
102
- }
103
- let lastAssistant = '';
104
- let detection = null;
105
- for await (const message of query({
106
- prompt: makePrompt(buildSnapshotDetectionPrompt(latestReleaseTag)),
107
- options: {
108
- systemPrompt: {
109
- type: 'preset',
110
- preset: 'claude_code',
111
- },
112
- model: config.model || DEFAULT_MODEL,
113
- maxTurns: 10,
114
- permissionMode: 'bypassPermissions',
115
- cwd,
116
- },
117
- })) {
118
- if (message.type === 'assistant' && message.message?.content) {
119
- for (const content of message.message.content) {
120
- if (content.type === 'text') {
121
- lastAssistant += `${content.text}\n`;
122
- logDebug(content.text, verbose);
123
- }
124
- }
125
- }
126
- if (message.type === 'result') {
127
- const text = message.result || lastAssistant;
128
- try {
129
- detection = parseSnapshotDetection(text);
130
- }
131
- catch (err) {
132
- if (verbose) {
133
- logDebug(`Snapshot detection parse error: ${err instanceof Error ? err.message : String(err)}`, verbose);
134
- }
135
- }
136
- }
137
- }
138
- if (!detection) {
139
- return {
140
- snapshot_tag: null,
141
- source: null,
142
- reasoning: 'Could not parse detection response',
143
- };
144
- }
145
- // Validate the proposed tag before returning.
146
- if (detection.snapshot_tag !== null &&
147
- !isPlausibleSnapshotTag(detection.snapshot_tag, latestReleaseTag)) {
148
- if (verbose) {
149
- logInfo(`Rejecting implausible snapshot tag: ${JSON.stringify(detection.snapshot_tag)}`);
150
- }
151
- return {
152
- ...detection,
153
- snapshot_tag: null,
154
- };
155
- }
156
- return detection;
157
- }