@shepai/cli 1.37.3 → 1.39.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 (584) hide show
  1. package/README.md +1 -1
  2. package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts +1 -0
  3. package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -1
  4. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts +5 -4
  5. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -1
  6. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.js +36 -14
  7. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts +12 -3
  8. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -1
  9. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +88 -8
  10. package/dist/packages/core/src/application/use-cases/agents/review-feature.use-case.d.ts +35 -0
  11. package/dist/packages/core/src/application/use-cases/agents/review-feature.use-case.d.ts.map +1 -0
  12. package/dist/packages/core/src/application/use-cases/agents/review-feature.use-case.js +88 -0
  13. package/dist/packages/core/src/application/use-cases/features/get-feature-artifact.use-case.d.ts +19 -0
  14. package/dist/packages/core/src/application/use-cases/features/get-feature-artifact.use-case.d.ts.map +1 -0
  15. package/dist/packages/core/src/application/use-cases/features/get-feature-artifact.use-case.js +52 -0
  16. package/dist/packages/core/src/application/use-cases/features/get-research-artifact.use-case.d.ts +19 -0
  17. package/dist/packages/core/src/application/use-cases/features/get-research-artifact.use-case.d.ts.map +1 -0
  18. package/dist/packages/core/src/application/use-cases/features/get-research-artifact.use-case.js +52 -0
  19. package/dist/packages/core/src/domain/factories/spec-yaml-parser.d.ts.map +1 -1
  20. package/dist/packages/core/src/domain/factories/spec-yaml-parser.js +3 -1
  21. package/dist/packages/core/src/domain/generated/output.d.ts +186 -0
  22. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  23. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  24. package/dist/packages/core/src/infrastructure/di/container.js +16 -2
  25. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +51 -0
  26. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
  27. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.js +21 -2
  28. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +1 -0
  29. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -1
  30. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +3 -0
  31. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +1 -0
  32. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
  33. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +31 -1
  34. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +19 -3
  35. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
  36. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +101 -16
  37. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts +2 -1
  38. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts.map +1 -1
  39. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.js +59 -9
  40. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts.map +1 -1
  41. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.js +14 -1
  42. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts +3 -0
  43. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts.map +1 -1
  44. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.js +28 -1
  45. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts +3 -0
  46. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
  47. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.js +13 -0
  48. package/dist/packages/core/src/infrastructure/services/notifications/notification-bus.d.ts +2 -17
  49. package/dist/packages/core/src/infrastructure/services/notifications/notification-bus.d.ts.map +1 -1
  50. package/dist/packages/core/src/infrastructure/services/notifications/notification-bus.js +3 -27
  51. package/dist/src/presentation/cli/commands/agent/reject.command.js +1 -1
  52. package/dist/src/presentation/cli/commands/feat/reject.command.d.ts.map +1 -1
  53. package/dist/src/presentation/cli/commands/feat/reject.command.js +6 -4
  54. package/dist/src/presentation/cli/commands/feat/review.command.d.ts +3 -2
  55. package/dist/src/presentation/cli/commands/feat/review.command.d.ts.map +1 -1
  56. package/dist/src/presentation/cli/commands/feat/review.command.js +87 -12
  57. package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -1
  58. package/dist/src/presentation/cli/commands/feat/show.command.js +38 -3
  59. package/dist/src/presentation/tui/prompts/prd-review-question.prompt.d.ts +30 -0
  60. package/dist/src/presentation/tui/prompts/prd-review-question.prompt.d.ts.map +1 -0
  61. package/dist/src/presentation/tui/prompts/prd-review-question.prompt.js +23 -0
  62. package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.d.ts +29 -0
  63. package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.d.ts.map +1 -0
  64. package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.js +29 -0
  65. package/dist/src/presentation/tui/wizards/merge-review.wizard.d.ts +13 -0
  66. package/dist/src/presentation/tui/wizards/merge-review.wizard.d.ts.map +1 -0
  67. package/dist/src/presentation/tui/wizards/merge-review.wizard.js +43 -0
  68. package/dist/src/presentation/tui/wizards/plan-review.wizard.d.ts +13 -0
  69. package/dist/src/presentation/tui/wizards/plan-review.wizard.d.ts.map +1 -0
  70. package/dist/src/presentation/tui/wizards/plan-review.wizard.js +43 -0
  71. package/dist/src/presentation/tui/wizards/prd-review.wizard.d.ts +26 -0
  72. package/dist/src/presentation/tui/wizards/prd-review.wizard.d.ts.map +1 -0
  73. package/dist/src/presentation/tui/wizards/prd-review.wizard.js +42 -0
  74. package/dist/src/presentation/web/app/actions/approve-feature.d.ts +5 -0
  75. package/dist/src/presentation/web/app/actions/approve-feature.d.ts.map +1 -0
  76. package/dist/src/presentation/web/app/actions/approve-feature.js +27 -0
  77. package/dist/src/presentation/web/app/actions/create-feature.d.ts +22 -0
  78. package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -0
  79. package/dist/src/presentation/web/app/actions/create-feature.js +41 -0
  80. package/dist/src/presentation/web/app/actions/delete-feature.d.ts +6 -0
  81. package/dist/src/presentation/web/app/actions/delete-feature.d.ts.map +1 -0
  82. package/dist/src/presentation/web/app/actions/delete-feature.js +16 -0
  83. package/dist/src/presentation/web/app/actions/get-feature-artifact.d.ts +10 -0
  84. package/dist/src/presentation/web/app/actions/get-feature-artifact.d.ts.map +1 -0
  85. package/dist/src/presentation/web/app/actions/get-feature-artifact.js +43 -0
  86. package/dist/src/presentation/web/app/actions/get-research-artifact.d.ts +14 -0
  87. package/dist/src/presentation/web/app/actions/get-research-artifact.d.ts.map +1 -0
  88. package/dist/src/presentation/web/app/actions/get-research-artifact.js +25 -0
  89. package/dist/src/presentation/web/app/actions/open-folder.d.ts +6 -0
  90. package/dist/src/presentation/web/app/actions/open-folder.d.ts.map +1 -0
  91. package/dist/src/presentation/web/app/actions/open-folder.js +39 -0
  92. package/dist/src/presentation/web/app/actions/open-ide.d.ts +12 -0
  93. package/dist/src/presentation/web/app/actions/open-ide.d.ts.map +1 -0
  94. package/dist/src/presentation/web/app/actions/open-ide.js +22 -0
  95. package/dist/src/presentation/web/app/actions/open-shell.d.ts +12 -0
  96. package/dist/src/presentation/web/app/actions/open-shell.d.ts.map +1 -0
  97. package/dist/src/presentation/web/app/actions/open-shell.js +45 -0
  98. package/dist/src/presentation/web/app/actions/pick-folder.d.ts +5 -0
  99. package/dist/src/presentation/web/app/actions/pick-folder.d.ts.map +1 -0
  100. package/dist/src/presentation/web/app/actions/pick-folder.js +13 -0
  101. package/dist/src/presentation/web/app/api/agent-events/route.d.ts +1 -1
  102. package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
  103. package/dist/src/presentation/web/app/api/agent-events/route.js +2 -9
  104. package/dist/src/presentation/web/app/api/dialog/pick-files/route.d.ts +1 -9
  105. package/dist/src/presentation/web/app/api/dialog/pick-files/route.d.ts.map +1 -1
  106. package/dist/src/presentation/web/app/api/dialog/pick-files/route.js +3 -6
  107. package/dist/src/presentation/web/app/page.d.ts.map +1 -1
  108. package/dist/src/presentation/web/app/page.js +1 -0
  109. package/dist/src/presentation/web/components/common/add-repository-node/pick-folder.d.ts +1 -1
  110. package/dist/src/presentation/web/components/common/add-repository-node/pick-folder.d.ts.map +1 -1
  111. package/dist/src/presentation/web/components/common/add-repository-node/pick-folder.js +6 -7
  112. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +1 -1
  113. package/dist/src/presentation/web/components/common/feature-create-drawer/pick-files.d.ts +1 -1
  114. package/dist/src/presentation/web/components/common/feature-create-drawer/pick-files.d.ts.map +1 -1
  115. package/dist/src/presentation/web/components/common/feature-create-drawer/pick-files.js +6 -7
  116. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.d.ts.map +1 -1
  117. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.js +7 -7
  118. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts +4 -0
  119. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts.map +1 -1
  120. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.js +52 -14
  121. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts.map +1 -1
  122. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.js +2 -2
  123. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +2 -0
  124. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
  125. package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
  126. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +33 -2
  127. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map +1 -1
  128. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +10 -0
  129. package/dist/src/presentation/web/components/common/index.d.ts +3 -0
  130. package/dist/src/presentation/web/components/common/index.d.ts.map +1 -1
  131. package/dist/src/presentation/web/components/common/index.js +3 -0
  132. package/dist/src/presentation/web/components/common/notification-permission-banner/index.d.ts +2 -0
  133. package/dist/src/presentation/web/components/common/notification-permission-banner/index.d.ts.map +1 -0
  134. package/dist/src/presentation/web/components/common/notification-permission-banner/index.js +1 -0
  135. package/dist/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.d.ts +2 -0
  136. package/dist/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.d.ts.map +1 -0
  137. package/dist/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.js +33 -0
  138. package/dist/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.stories.d.ts +6 -0
  139. package/dist/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.stories.d.ts.map +1 -0
  140. package/dist/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.stories.js +24 -0
  141. package/dist/src/presentation/web/components/common/open-action-menu/config.d.ts +10 -0
  142. package/dist/src/presentation/web/components/common/open-action-menu/config.d.ts.map +1 -0
  143. package/dist/src/presentation/web/components/common/open-action-menu/config.js +1 -0
  144. package/dist/src/presentation/web/components/common/open-action-menu/index.d.ts +3 -0
  145. package/dist/src/presentation/web/components/common/open-action-menu/index.d.ts.map +1 -0
  146. package/dist/src/presentation/web/components/common/open-action-menu/index.js +1 -0
  147. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.d.ts +3 -0
  148. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.d.ts.map +1 -0
  149. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.js +18 -0
  150. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts +14 -0
  151. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts.map +1 -0
  152. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.js +54 -0
  153. package/dist/src/presentation/web/components/common/prd-questionnaire/index.d.ts +4 -0
  154. package/dist/src/presentation/web/components/common/prd-questionnaire/index.d.ts.map +1 -0
  155. package/dist/src/presentation/web/components/common/prd-questionnaire/index.js +2 -0
  156. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.d.ts +41 -0
  157. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.d.ts.map +1 -0
  158. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.js +1 -0
  159. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-drawer.d.ts +3 -0
  160. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-drawer.d.ts.map +1 -0
  161. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-drawer.js +7 -0
  162. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.d.ts +3 -0
  163. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.d.ts.map +1 -0
  164. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.js +42 -0
  165. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.d.ts +26 -0
  166. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.d.ts.map +1 -0
  167. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.js +267 -0
  168. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  169. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +2 -2
  170. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts +3 -0
  171. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts.map +1 -1
  172. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.js +51 -14
  173. package/dist/src/presentation/web/components/common/review-drawer-shell/index.d.ts +3 -0
  174. package/dist/src/presentation/web/components/common/review-drawer-shell/index.d.ts.map +1 -0
  175. package/dist/src/presentation/web/components/common/review-drawer-shell/index.js +1 -0
  176. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell-config.d.ts +24 -0
  177. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell-config.d.ts.map +1 -0
  178. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell-config.js +1 -0
  179. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.d.ts +3 -0
  180. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.d.ts.map +1 -0
  181. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.js +17 -0
  182. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.stories.d.ts +14 -0
  183. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.stories.d.ts.map +1 -0
  184. package/dist/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.stories.js +33 -0
  185. package/dist/src/presentation/web/components/common/tech-decisions-review/index.d.ts +4 -0
  186. package/dist/src/presentation/web/components/common/tech-decisions-review/index.d.ts.map +1 -0
  187. package/dist/src/presentation/web/components/common/tech-decisions-review/index.js +2 -0
  188. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-drawer.d.ts +3 -0
  189. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-drawer.d.ts.map +1 -0
  190. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-drawer.js +7 -0
  191. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review-config.d.ts +39 -0
  192. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review-config.d.ts.map +1 -0
  193. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review-config.js +1 -0
  194. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.d.ts +3 -0
  195. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.d.ts.map +1 -0
  196. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.js +39 -0
  197. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.d.ts +22 -0
  198. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.d.ts.map +1 -0
  199. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.js +108 -0
  200. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  201. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +133 -2
  202. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
  203. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +28 -19
  204. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
  205. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +6 -1
  206. package/dist/src/presentation/web/components/ui/drawer.d.ts.map +1 -1
  207. package/dist/src/presentation/web/components/ui/drawer.js +3 -1
  208. package/dist/src/presentation/web/components/ui/dropdown-menu.d.ts +28 -0
  209. package/dist/src/presentation/web/components/ui/dropdown-menu.d.ts.map +1 -0
  210. package/dist/src/presentation/web/components/ui/dropdown-menu.js +33 -0
  211. package/dist/src/presentation/web/hooks/agent-events-provider.d.ts +13 -0
  212. package/dist/src/presentation/web/hooks/agent-events-provider.d.ts.map +1 -0
  213. package/dist/src/presentation/web/hooks/agent-events-provider.js +20 -0
  214. package/dist/src/presentation/web/hooks/use-agent-events.d.ts.map +1 -1
  215. package/dist/src/presentation/web/hooks/use-agent-events.js +21 -1
  216. package/dist/src/presentation/web/hooks/use-notifications.d.ts +1 -5
  217. package/dist/src/presentation/web/hooks/use-notifications.d.ts.map +1 -1
  218. package/dist/src/presentation/web/hooks/use-notifications.js +5 -10
  219. package/dist/src/presentation/web/next.config.d.ts.map +1 -1
  220. package/dist/src/presentation/web/next.config.js +5 -0
  221. package/dist/tsconfig.build.tsbuildinfo +1 -1
  222. package/package.json +2 -1
  223. package/web/.next/BUILD_ID +1 -1
  224. package/web/.next/app-path-routes-manifest.json +0 -5
  225. package/web/.next/build-manifest.json +6 -6
  226. package/web/.next/cache/.previewinfo +1 -1
  227. package/web/.next/cache/.rscinfo +1 -1
  228. package/web/.next/cache/.tsbuildinfo +1 -1
  229. package/web/.next/cache/config.json +3 -3
  230. package/web/.next/fallback-build-manifest.json +2 -2
  231. package/web/.next/prerender-manifest.json +3 -3
  232. package/web/.next/required-server-files.js +4 -4
  233. package/web/.next/required-server-files.json +4 -4
  234. package/web/.next/routes-manifest.json +1 -34
  235. package/web/.next/server/app/_global-error/page/build-manifest.json +4 -4
  236. package/web/.next/server/app/_global-error/page.js +1 -1
  237. package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  238. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  239. package/web/.next/server/app/_global-error.html +2 -2
  240. package/web/.next/server/app/_global-error.rsc +7 -7
  241. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  242. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  243. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  244. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  245. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  246. package/web/.next/server/app/_not-found/page/build-manifest.json +4 -4
  247. package/web/.next/server/app/_not-found/page.js +1 -1
  248. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  249. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  250. package/web/.next/server/app/api/agent-events/route.js +1 -1
  251. package/web/.next/server/app/api/agent-events/route.js.nft.json +1 -1
  252. package/web/.next/server/app/api/dialog/pick-files/route.js +2 -2
  253. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  254. package/web/.next/server/app/page/build-manifest.json +4 -4
  255. package/web/.next/server/app/page/server-reference-manifest.json +137 -1
  256. package/web/.next/server/app/page.js +2 -2
  257. package/web/.next/server/app/page.js.nft.json +1 -1
  258. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  259. package/web/.next/server/app/version/page/build-manifest.json +4 -4
  260. package/web/.next/server/app/version/page.js +1 -1
  261. package/web/.next/server/app/version/page.js.nft.json +1 -1
  262. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  263. package/web/.next/server/app-paths-manifest.json +0 -5
  264. package/web/.next/server/chunks/{403f9_next_567de315._.js → 403f9_next_435614de._.js} +7 -6
  265. package/web/.next/server/chunks/403f9_next_435614de._.js.map +1 -0
  266. package/web/.next/server/chunks/[externals]__ba6223e5._.js +3 -0
  267. package/web/.next/server/chunks/[root-of-the-server]__7d5c8b74._.js +6 -0
  268. package/web/.next/server/chunks/[root-of-the-server]__7d5c8b74._.js.map +1 -0
  269. package/web/.next/server/chunks/ssr/[externals]_node:path_d28a9bfe._.js +3 -0
  270. package/web/.next/server/chunks/ssr/[root-of-the-server]__03a0dba7._.js +12 -0
  271. package/web/.next/server/chunks/ssr/[root-of-the-server]__03a0dba7._.js.map +1 -0
  272. package/web/.next/server/chunks/ssr/[root-of-the-server]__19354aea._.js +9 -0
  273. package/web/.next/server/chunks/ssr/[root-of-the-server]__19354aea._.js.map +1 -0
  274. package/web/.next/server/chunks/ssr/{[root-of-the-server]__685eaa45._.js → [root-of-the-server]__32472b89._.js} +2 -2
  275. package/web/.next/server/chunks/ssr/{[root-of-the-server]__a21ef212._.js → [root-of-the-server]__d21f0894._.js} +2 -2
  276. package/web/.next/server/chunks/ssr/[root-of-the-server]__d21f0894._.js.map +1 -0
  277. package/web/.next/server/chunks/ssr/[root-of-the-server]__e1c44885._.js +3 -0
  278. package/web/.next/server/chunks/ssr/[root-of-the-server]__f12b60be._.js +1 -1
  279. package/web/.next/server/chunks/ssr/[root-of-the-server]__f47a461b._.js +3 -0
  280. package/web/.next/server/chunks/ssr/_285de9aa._.js +3 -0
  281. package/web/.next/server/chunks/ssr/_285de9aa._.js.map +1 -0
  282. package/web/.next/{standalone/src/presentation/web/.next/server/chunks/ssr/_94d22d37._.js → server/chunks/ssr/_b1f2507a._.js} +4 -4
  283. package/web/.next/server/chunks/ssr/_b1f2507a._.js.map +1 -0
  284. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_version_version-page-client_tsx_fe9db753._.js +1 -1
  285. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_version_version-page-client_tsx_fe9db753._.js.map +1 -1
  286. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  287. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  288. package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_badge_tsx_964c2a3b._.js +1 -1
  289. package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_badge_tsx_964c2a3b._.js.map +1 -1
  290. package/web/.next/server/chunks/ssr/src_presentation_web_ed0934e5._.js +1 -1
  291. package/web/.next/server/chunks/ssr/src_presentation_web_ed0934e5._.js.map +1 -1
  292. package/web/.next/server/middleware-build-manifest.js +4 -4
  293. package/web/.next/server/pages/500.html +2 -2
  294. package/web/.next/server/server-reference-manifest.js +1 -1
  295. package/web/.next/server/server-reference-manifest.json +138 -2
  296. package/web/.next/standalone/src/presentation/web/.next/BUILD_ID +1 -1
  297. package/web/.next/standalone/src/presentation/web/.next/app-path-routes-manifest.json +0 -5
  298. package/web/.next/standalone/src/presentation/web/.next/build-manifest.json +6 -6
  299. package/web/.next/standalone/src/presentation/web/.next/prerender-manifest.json +3 -3
  300. package/web/.next/standalone/src/presentation/web/.next/required-server-files.json +4 -4
  301. package/web/.next/standalone/src/presentation/web/.next/routes-manifest.json +1 -34
  302. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error/page/build-manifest.json +4 -4
  303. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error/page.js +1 -1
  304. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  305. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  306. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.html +2 -2
  307. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.rsc +7 -7
  308. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  309. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  310. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  311. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  312. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  313. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page/build-manifest.json +4 -4
  314. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page.js +1 -1
  315. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  316. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  317. package/web/.next/standalone/src/presentation/web/.next/server/app/api/agent-events/route.js +1 -1
  318. package/web/.next/standalone/src/presentation/web/.next/server/app/api/agent-events/route.js.nft.json +1 -1
  319. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-files/route.js +2 -2
  320. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  321. package/web/.next/standalone/src/presentation/web/.next/server/app/page/build-manifest.json +4 -4
  322. package/web/.next/standalone/src/presentation/web/.next/server/app/page/server-reference-manifest.json +137 -1
  323. package/web/.next/standalone/src/presentation/web/.next/server/app/page.js +2 -2
  324. package/web/.next/standalone/src/presentation/web/.next/server/app/page.js.nft.json +1 -1
  325. package/web/.next/standalone/src/presentation/web/.next/server/app/page_client-reference-manifest.js +1 -1
  326. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page/build-manifest.json +4 -4
  327. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page.js +1 -1
  328. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page.js.nft.json +1 -1
  329. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  330. package/web/.next/standalone/src/presentation/web/.next/server/app-paths-manifest.json +0 -5
  331. package/web/.next/standalone/src/presentation/web/.next/server/chunks/{403f9_next_567de315._.js → 403f9_next_435614de._.js} +7 -6
  332. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[externals]__ba6223e5._.js +3 -0
  333. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__7d5c8b74._.js +6 -0
  334. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[externals]_node:path_d28a9bfe._.js +3 -0
  335. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__03a0dba7._.js +12 -0
  336. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__19354aea._.js +9 -0
  337. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/{[root-of-the-server]__685eaa45._.js → [root-of-the-server]__32472b89._.js} +2 -2
  338. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/{[root-of-the-server]__a21ef212._.js → [root-of-the-server]__d21f0894._.js} +2 -2
  339. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__e1c44885._.js +3 -0
  340. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__f12b60be._.js +1 -1
  341. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__f47a461b._.js +3 -0
  342. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_285de9aa._.js +3 -0
  343. package/web/.next/{server/chunks/ssr/_94d22d37._.js → standalone/src/presentation/web/.next/server/chunks/ssr/_b1f2507a._.js} +4 -4
  344. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_version_version-page-client_tsx_fe9db753._.js +1 -1
  345. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  346. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_components_ui_badge_tsx_964c2a3b._.js +1 -1
  347. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_ed0934e5._.js +1 -1
  348. package/web/.next/standalone/src/presentation/web/.next/server/middleware-build-manifest.js +4 -4
  349. package/web/.next/standalone/src/presentation/web/.next/server/pages/500.html +2 -2
  350. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.js +1 -1
  351. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.json +138 -2
  352. package/web/.next/standalone/src/presentation/web/app/actions/approve-feature.ts +38 -0
  353. package/web/.next/standalone/src/presentation/web/app/actions/create-feature.ts +81 -0
  354. package/web/.next/standalone/src/presentation/web/app/actions/delete-feature.ts +22 -0
  355. package/web/.next/standalone/src/presentation/web/app/actions/get-feature-artifact.ts +55 -0
  356. package/web/.next/standalone/src/presentation/web/app/actions/get-research-artifact.ts +42 -0
  357. package/web/.next/standalone/src/presentation/web/app/actions/open-folder.ts +44 -0
  358. package/web/.next/standalone/src/presentation/web/app/actions/open-ide.ts +37 -0
  359. package/web/.next/standalone/src/presentation/web/app/{api/shell/open/route.ts → actions/open-shell.ts} +19 -27
  360. package/web/.next/standalone/src/presentation/web/app/{api/dialog/pick-folder/route.ts → actions/pick-folder.ts} +5 -9
  361. package/web/.next/standalone/src/presentation/web/app/api/agent-events/route.ts +2 -14
  362. package/web/.next/standalone/src/presentation/web/app/api/dialog/pick-files/route.ts +8 -10
  363. package/web/.next/standalone/src/presentation/web/app/globals.css +10 -0
  364. package/web/.next/standalone/src/presentation/web/app/page.tsx +1 -0
  365. package/web/.next/standalone/src/presentation/web/components/common/add-repository-node/pick-folder.ts +7 -7
  366. package/web/.next/standalone/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.tsx +1 -1
  367. package/web/.next/standalone/src/presentation/web/components/common/feature-create-drawer/pick-files.ts +6 -7
  368. package/web/.next/standalone/src/presentation/web/components/common/feature-drawer/feature-drawer.tsx +15 -19
  369. package/web/.next/standalone/src/presentation/web/components/common/feature-drawer/use-feature-actions.ts +61 -17
  370. package/web/.next/standalone/src/presentation/web/components/common/feature-node/agent-type-icons.tsx +10 -2
  371. package/web/.next/standalone/src/presentation/web/components/common/feature-node/feature-node-state-config.ts +2 -0
  372. package/web/.next/standalone/src/presentation/web/components/common/feature-node/feature-node.stories.tsx +10 -0
  373. package/web/.next/standalone/src/presentation/web/components/common/feature-node/feature-node.tsx +38 -7
  374. package/web/.next/standalone/src/presentation/web/components/common/index.ts +18 -0
  375. package/web/.next/standalone/src/presentation/web/components/common/notification-permission-banner/index.ts +1 -0
  376. package/web/.next/standalone/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.stories.tsx +52 -0
  377. package/web/.next/standalone/src/presentation/web/components/common/notification-permission-banner/notification-permission-banner.tsx +55 -0
  378. package/web/.next/standalone/src/presentation/web/components/common/open-action-menu/config.ts +10 -0
  379. package/web/.next/standalone/src/presentation/web/components/common/open-action-menu/index.ts +2 -0
  380. package/web/.next/standalone/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.tsx +64 -0
  381. package/web/.next/standalone/src/presentation/web/components/common/open-action-menu/open-action-menu.tsx +111 -0
  382. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/index.ts +10 -0
  383. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.ts +48 -0
  384. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-drawer.tsx +34 -0
  385. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.tsx +384 -0
  386. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.tsx +216 -0
  387. package/web/.next/standalone/src/presentation/web/components/common/repository-node/repository-node.tsx +20 -1
  388. package/web/.next/standalone/src/presentation/web/components/common/repository-node/use-repository-actions.ts +83 -20
  389. package/web/.next/standalone/src/presentation/web/components/common/review-drawer-shell/index.ts +2 -0
  390. package/web/.next/standalone/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell-config.ts +24 -0
  391. package/web/.next/standalone/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.stories.tsx +85 -0
  392. package/web/.next/standalone/src/presentation/web/components/common/review-drawer-shell/review-drawer-shell.tsx +139 -0
  393. package/web/.next/standalone/src/presentation/web/components/common/tech-decisions-review/index.ts +8 -0
  394. package/web/.next/standalone/src/presentation/web/components/common/tech-decisions-review/tech-decisions-drawer.tsx +34 -0
  395. package/web/.next/standalone/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review-config.ts +42 -0
  396. package/web/.next/standalone/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.tsx +177 -0
  397. package/web/.next/standalone/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.tsx +188 -0
  398. package/web/.next/standalone/src/presentation/web/components/features/control-center/control-center-inner.tsx +189 -2
  399. package/web/.next/standalone/src/presentation/web/components/features/control-center/use-control-center-state.ts +28 -19
  400. package/web/.next/standalone/src/presentation/web/components/layouts/app-shell/app-shell.tsx +11 -1
  401. package/web/.next/standalone/src/presentation/web/components/ui/drawer.tsx +4 -2
  402. package/web/.next/standalone/src/presentation/web/components/ui/dropdown-menu.tsx +187 -0
  403. package/web/.next/standalone/src/presentation/web/hooks/agent-events-provider.tsx +32 -0
  404. package/web/.next/standalone/src/presentation/web/hooks/use-agent-events.ts +23 -1
  405. package/web/.next/standalone/src/presentation/web/hooks/use-notifications.ts +5 -16
  406. package/web/.next/standalone/src/presentation/web/next.config.ts +6 -0
  407. package/web/.next/standalone/src/presentation/web/package.json +2 -1
  408. package/web/.next/standalone/src/presentation/web/server.js +1 -1
  409. package/web/.next/static/chunks/{70993ebedee7eab0.js → 084314470f2144d2.js} +1 -1
  410. package/web/.next/static/chunks/36bb03a0314fb990.css +2 -0
  411. package/web/.next/static/chunks/429ee8f94032181c.js +10 -0
  412. package/web/.next/static/chunks/83ff3b6bbee54bce.js +1 -0
  413. package/web/.next/static/chunks/{fe5e04e707adb039.js → 8c0b96eb95dd31a9.js} +1 -1
  414. package/web/.next/static/chunks/{df7d29673e0ac11d.js → b13aa397579082e7.js} +1 -1
  415. package/web/.next/static/chunks/{f3b4460b1496ef52.js → cfe4dc9904fcfddb.js} +1 -1
  416. package/web/.next/static/chunks/e21d644e5a584136.js +1 -0
  417. package/web/.next/static/chunks/f9519a5c455143e6.js +1 -0
  418. package/web/.next/static/chunks/{c4b1e95eceaa36ca.js → fe6427c156bda6b0.js} +2 -2
  419. package/web/.next/static/chunks/{37bc3e283f734dca.js → fe70e73feb07bcfd.js} +1 -1
  420. package/web/.next/static/chunks/{turbopack-a5a88a85e7ac8e8d.js → turbopack-35ff53de4dab1e56.js} +2 -2
  421. package/web/.next/trace +1 -1
  422. package/web/.next/trace-build +1 -1
  423. package/web/.next/types/link.d.ts +1 -6
  424. package/web/.next/types/routes.d.ts +1 -6
  425. package/web/.next/types/validator.ts +0 -45
  426. package/web/package.json +2 -1
  427. package/dist/src/presentation/web/app/api/dialog/pick-folder/route.d.ts +0 -11
  428. package/dist/src/presentation/web/app/api/dialog/pick-folder/route.d.ts.map +0 -1
  429. package/dist/src/presentation/web/app/api/dialog/pick-folder/route.js +0 -16
  430. package/dist/src/presentation/web/app/api/features/[id]/route.d.ts +0 -11
  431. package/dist/src/presentation/web/app/api/features/[id]/route.d.ts.map +0 -1
  432. package/dist/src/presentation/web/app/api/features/[id]/route.js +0 -17
  433. package/dist/src/presentation/web/app/api/features/create/route.d.ts +0 -5
  434. package/dist/src/presentation/web/app/api/features/create/route.d.ts.map +0 -1
  435. package/dist/src/presentation/web/app/api/features/create/route.js +0 -65
  436. package/dist/src/presentation/web/app/api/ide/open/route.d.ts +0 -9
  437. package/dist/src/presentation/web/app/api/ide/open/route.d.ts.map +0 -1
  438. package/dist/src/presentation/web/app/api/ide/open/route.js +0 -36
  439. package/dist/src/presentation/web/app/api/shell/open/route.d.ts +0 -9
  440. package/dist/src/presentation/web/app/api/shell/open/route.d.ts.map +0 -1
  441. package/dist/src/presentation/web/app/api/shell/open/route.js +0 -57
  442. package/dist/src/presentation/web/app/api/validate-toolbar-input.d.ts +0 -18
  443. package/dist/src/presentation/web/app/api/validate-toolbar-input.d.ts.map +0 -1
  444. package/dist/src/presentation/web/app/api/validate-toolbar-input.js +0 -29
  445. package/web/.next/server/app/api/dialog/pick-folder/route/app-paths-manifest.json +0 -3
  446. package/web/.next/server/app/api/dialog/pick-folder/route/build-manifest.json +0 -11
  447. package/web/.next/server/app/api/dialog/pick-folder/route/server-reference-manifest.json +0 -4
  448. package/web/.next/server/app/api/dialog/pick-folder/route.js +0 -7
  449. package/web/.next/server/app/api/dialog/pick-folder/route.js.map +0 -5
  450. package/web/.next/server/app/api/dialog/pick-folder/route.js.nft.json +0 -1
  451. package/web/.next/server/app/api/dialog/pick-folder/route_client-reference-manifest.js +0 -2
  452. package/web/.next/server/app/api/features/[id]/route/app-paths-manifest.json +0 -3
  453. package/web/.next/server/app/api/features/[id]/route/build-manifest.json +0 -11
  454. package/web/.next/server/app/api/features/[id]/route/server-reference-manifest.json +0 -4
  455. package/web/.next/server/app/api/features/[id]/route.js +0 -7
  456. package/web/.next/server/app/api/features/[id]/route.js.map +0 -5
  457. package/web/.next/server/app/api/features/[id]/route.js.nft.json +0 -1
  458. package/web/.next/server/app/api/features/[id]/route_client-reference-manifest.js +0 -2
  459. package/web/.next/server/app/api/features/create/route/app-paths-manifest.json +0 -3
  460. package/web/.next/server/app/api/features/create/route/build-manifest.json +0 -11
  461. package/web/.next/server/app/api/features/create/route/server-reference-manifest.json +0 -4
  462. package/web/.next/server/app/api/features/create/route.js +0 -7
  463. package/web/.next/server/app/api/features/create/route.js.map +0 -5
  464. package/web/.next/server/app/api/features/create/route.js.nft.json +0 -1
  465. package/web/.next/server/app/api/features/create/route_client-reference-manifest.js +0 -2
  466. package/web/.next/server/app/api/ide/open/route/app-paths-manifest.json +0 -3
  467. package/web/.next/server/app/api/ide/open/route/build-manifest.json +0 -11
  468. package/web/.next/server/app/api/ide/open/route/server-reference-manifest.json +0 -4
  469. package/web/.next/server/app/api/ide/open/route.js +0 -7
  470. package/web/.next/server/app/api/ide/open/route.js.map +0 -5
  471. package/web/.next/server/app/api/ide/open/route.js.nft.json +0 -1
  472. package/web/.next/server/app/api/ide/open/route_client-reference-manifest.js +0 -2
  473. package/web/.next/server/app/api/shell/open/route/app-paths-manifest.json +0 -3
  474. package/web/.next/server/app/api/shell/open/route/build-manifest.json +0 -11
  475. package/web/.next/server/app/api/shell/open/route/server-reference-manifest.json +0 -4
  476. package/web/.next/server/app/api/shell/open/route.js +0 -7
  477. package/web/.next/server/app/api/shell/open/route.js.map +0 -5
  478. package/web/.next/server/app/api/shell/open/route.js.nft.json +0 -1
  479. package/web/.next/server/app/api/shell/open/route_client-reference-manifest.js +0 -2
  480. package/web/.next/server/chunks/403f9_next_567de315._.js.map +0 -1
  481. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_dialog_pick-folder_route_actions_375ed12f.js +0 -3
  482. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_[id]_route_actions_03b9a4b5.js +0 -3
  483. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_create_route_actions_de49a114.js +0 -3
  484. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_create_route_actions_de49a114.js.map +0 -1
  485. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_shell_open_route_actions_814dc5b6.js +0 -3
  486. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_shell_open_route_actions_814dc5b6.js.map +0 -1
  487. package/web/.next/server/chunks/[root-of-the-server]__04ae3a77._.js +0 -3
  488. package/web/.next/server/chunks/[root-of-the-server]__04ae3a77._.js.map +0 -1
  489. package/web/.next/server/chunks/[root-of-the-server]__3d63a020._.js +0 -8
  490. package/web/.next/server/chunks/[root-of-the-server]__3d63a020._.js.map +0 -1
  491. package/web/.next/server/chunks/[root-of-the-server]__a6bf88cc._.js +0 -4
  492. package/web/.next/server/chunks/[root-of-the-server]__a6bf88cc._.js.map +0 -1
  493. package/web/.next/server/chunks/[root-of-the-server]__acfd2769._.js +0 -3
  494. package/web/.next/server/chunks/[root-of-the-server]__acfd2769._.js.map +0 -1
  495. package/web/.next/server/chunks/[root-of-the-server]__ec87d735._.js +0 -3
  496. package/web/.next/server/chunks/[root-of-the-server]__ec87d735._.js.map +0 -1
  497. package/web/.next/server/chunks/[root-of-the-server]__ecaf05bc._.js +0 -3
  498. package/web/.next/server/chunks/[root-of-the-server]__ecaf05bc._.js.map +0 -1
  499. package/web/.next/server/chunks/[root-of-the-server]__f32c280c._.js +0 -3
  500. package/web/.next/server/chunks/[root-of-the-server]__f32c280c._.js.map +0 -1
  501. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_ide_open_route_actions_9fe6e1cd.js +0 -3
  502. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_ide_open_route_actions_9fe6e1cd.js.map +0 -1
  503. package/web/.next/server/chunks/ssr/[root-of-the-server]__1eade43f._.js +0 -3
  504. package/web/.next/server/chunks/ssr/[root-of-the-server]__1eade43f._.js.map +0 -1
  505. package/web/.next/server/chunks/ssr/[root-of-the-server]__97377864._.js +0 -3
  506. package/web/.next/server/chunks/ssr/[root-of-the-server]__a21ef212._.js.map +0 -1
  507. package/web/.next/server/chunks/ssr/[root-of-the-server]__f285e474._.js +0 -3
  508. package/web/.next/server/chunks/ssr/_09afa42a._.js +0 -10
  509. package/web/.next/server/chunks/ssr/_09afa42a._.js.map +0 -1
  510. package/web/.next/server/chunks/ssr/_4676cf52._.js +0 -3
  511. package/web/.next/server/chunks/ssr/_4676cf52._.js.map +0 -1
  512. package/web/.next/server/chunks/ssr/_94d22d37._.js.map +0 -1
  513. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_page_actions_a4e3cb6f.js +0 -3
  514. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_page_actions_a4e3cb6f.js.map +0 -1
  515. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route/app-paths-manifest.json +0 -3
  516. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route/build-manifest.json +0 -11
  517. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route/server-reference-manifest.json +0 -4
  518. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route.js +0 -7
  519. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route.js.map +0 -5
  520. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route.js.nft.json +0 -1
  521. package/web/.next/standalone/src/presentation/web/.next/server/app/api/dialog/pick-folder/route_client-reference-manifest.js +0 -2
  522. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route/app-paths-manifest.json +0 -3
  523. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route/build-manifest.json +0 -11
  524. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route/server-reference-manifest.json +0 -4
  525. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route.js +0 -7
  526. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route.js.map +0 -5
  527. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route.js.nft.json +0 -1
  528. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/[id]/route_client-reference-manifest.js +0 -2
  529. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route/app-paths-manifest.json +0 -3
  530. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route/build-manifest.json +0 -11
  531. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route/server-reference-manifest.json +0 -4
  532. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route.js +0 -7
  533. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route.js.map +0 -5
  534. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route.js.nft.json +0 -1
  535. package/web/.next/standalone/src/presentation/web/.next/server/app/api/features/create/route_client-reference-manifest.js +0 -2
  536. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route/app-paths-manifest.json +0 -3
  537. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route/build-manifest.json +0 -11
  538. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route/server-reference-manifest.json +0 -4
  539. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route.js +0 -7
  540. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route.js.map +0 -5
  541. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route.js.nft.json +0 -1
  542. package/web/.next/standalone/src/presentation/web/.next/server/app/api/ide/open/route_client-reference-manifest.js +0 -2
  543. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route/app-paths-manifest.json +0 -3
  544. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route/build-manifest.json +0 -11
  545. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route/server-reference-manifest.json +0 -4
  546. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route.js +0 -7
  547. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route.js.map +0 -5
  548. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route.js.nft.json +0 -1
  549. package/web/.next/standalone/src/presentation/web/.next/server/app/api/shell/open/route_client-reference-manifest.js +0 -2
  550. package/web/.next/standalone/src/presentation/web/.next/server/chunks/744ca_web__next-internal_server_app_api_dialog_pick-folder_route_actions_375ed12f.js +0 -3
  551. package/web/.next/standalone/src/presentation/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_[id]_route_actions_03b9a4b5.js +0 -3
  552. package/web/.next/standalone/src/presentation/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_create_route_actions_de49a114.js +0 -3
  553. package/web/.next/standalone/src/presentation/web/.next/server/chunks/744ca_web__next-internal_server_app_api_shell_open_route_actions_814dc5b6.js +0 -3
  554. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__04ae3a77._.js +0 -3
  555. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__3d63a020._.js +0 -8
  556. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__a6bf88cc._.js +0 -4
  557. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__acfd2769._.js +0 -3
  558. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__ec87d735._.js +0 -3
  559. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__ecaf05bc._.js +0 -3
  560. package/web/.next/standalone/src/presentation/web/.next/server/chunks/[root-of-the-server]__f32c280c._.js +0 -3
  561. package/web/.next/standalone/src/presentation/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_ide_open_route_actions_9fe6e1cd.js +0 -3
  562. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__1eade43f._.js +0 -3
  563. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__97377864._.js +0 -3
  564. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__f285e474._.js +0 -3
  565. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_09afa42a._.js +0 -10
  566. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_4676cf52._.js +0 -3
  567. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_page_actions_a4e3cb6f.js +0 -3
  568. package/web/.next/standalone/src/presentation/web/app/api/features/[id]/route.ts +0 -20
  569. package/web/.next/standalone/src/presentation/web/app/api/features/create/route.ts +0 -103
  570. package/web/.next/standalone/src/presentation/web/app/api/ide/open/route.ts +0 -44
  571. package/web/.next/standalone/src/presentation/web/app/api/validate-toolbar-input.ts +0 -46
  572. package/web/.next/static/chunks/54743561bbaa307a.js +0 -8
  573. package/web/.next/static/chunks/74f27128e5fbfe52.css +0 -2
  574. package/web/.next/static/chunks/9993505b2a26c454.js +0 -1
  575. package/web/.next/static/chunks/c95b4cf170b7f301.js +0 -1
  576. package/web/.next/static/chunks/e78d1b265b8110c3.js +0 -1
  577. /package/web/.next/server/chunks/{744ca_web__next-internal_server_app_api_dialog_pick-folder_route_actions_375ed12f.js.map → [externals]__ba6223e5._.js.map} +0 -0
  578. /package/web/.next/server/chunks/{744ca_web__next-internal_server_app_api_features_[id]_route_actions_03b9a4b5.js.map → ssr/[externals]_node:path_d28a9bfe._.js.map} +0 -0
  579. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__685eaa45._.js.map → [root-of-the-server]__32472b89._.js.map} +0 -0
  580. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__f285e474._.js.map → [root-of-the-server]__e1c44885._.js.map} +0 -0
  581. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__97377864._.js.map → [root-of-the-server]__f47a461b._.js.map} +0 -0
  582. /package/web/.next/static/{O1yesm5Dga4m8eBi7EwM0 → t8z43Apwz2m0TFf1MnAKq}/_buildManifest.js +0 -0
  583. /package/web/.next/static/{O1yesm5Dga4m8eBi7EwM0 → t8z43Apwz2m0TFf1MnAKq}/_clientMiddlewareManifest.json +0 -0
  584. /package/web/.next/static/{O1yesm5Dga4m8eBi7EwM0 → t8z43Apwz2m0TFf1MnAKq}/_ssgManifest.js +0 -0
@@ -53,6 +53,10 @@ export function parseWorkerArgs(args) {
53
53
  const openPr = args.includes('--open-pr');
54
54
  const threadIdx = args.indexOf('--thread-id');
55
55
  const threadId = threadIdx !== -1 && threadIdx + 1 < args.length ? args[threadIdx + 1] : undefined;
56
+ const resumePayloadIdx = args.indexOf('--resume-payload');
57
+ const resumePayload = resumePayloadIdx !== -1 && resumePayloadIdx + 1 < args.length
58
+ ? args[resumePayloadIdx + 1]
59
+ : undefined;
56
60
  return {
57
61
  featureId: getArg('feature-id'),
58
62
  runId: getArg('run-id'),
@@ -65,6 +69,7 @@ export function parseWorkerArgs(args) {
65
69
  resumeFromInterrupt,
66
70
  push,
67
71
  openPr,
72
+ resumePayload,
68
73
  };
69
74
  }
70
75
  /** Simple worker logger — writes to stdout which is redirected to log file by the parent. */
@@ -163,8 +168,33 @@ export async function runWorker(args) {
163
168
  let result;
164
169
  if (args.resume && args.resumeFromInterrupt) {
165
170
  // Resume from an interrupt (human-in-the-loop approval)
171
+ let resumeValue = { approved: true }; // default backward-compatible
172
+ if (args.resumePayload) {
173
+ try {
174
+ resumeValue = JSON.parse(args.resumePayload);
175
+ log(`Resuming with typed payload: ${args.resumePayload.slice(0, 200)}`);
176
+ }
177
+ catch (e) {
178
+ log(`Warning: Failed to parse --resume-payload, using default approval: ${e}`);
179
+ }
180
+ }
181
+ // Derive state updates from the resume payload so executeNode() can
182
+ // read _approvalAction from state instead of from interrupt() return
183
+ // value (fixes the dual-interrupt stale replay bug).
184
+ const stateUpdate = {};
185
+ if (typeof resumeValue === 'object' &&
186
+ resumeValue !== null &&
187
+ 'rejected' in resumeValue &&
188
+ resumeValue.rejected === true) {
189
+ stateUpdate._approvalAction = 'rejected';
190
+ stateUpdate._rejectionFeedback = resumeValue.feedback ?? null;
191
+ }
192
+ else {
193
+ stateUpdate._approvalAction = 'approved';
194
+ stateUpdate._rejectionFeedback = null;
195
+ }
166
196
  log('Resuming graph from interrupt checkpoint...');
167
- result = await graph.invoke(new Command({ resume: { approved: true } }), graphConfig);
197
+ result = await graph.invoke(new Command({ resume: resumeValue, update: stateUpdate }), graphConfig);
168
198
  }
169
199
  else if (args.resume) {
170
200
  // Resume from error — re-invoke with initial state; LangGraph continues
@@ -39,9 +39,8 @@ export declare function safeYamlLoad(content: string): unknown;
39
39
  * - allowPlan: when true, skip interrupt after plan phase
40
40
  * - allowMerge: when true, skip interrupt after merge phase
41
41
  *
42
- * Nodes not covered by a gate (analyze, research) never interrupt.
43
- * The implement node always interrupts when gates are present
44
- * (unless all three gates are true, meaning fully autonomous).
42
+ * Nodes not covered by a gate (analyze, research, implement) never interrupt.
43
+ * Implementation always proceeds to merge; the merge node handles its own gate.
45
44
  *
46
45
  */
47
46
  export declare function shouldInterrupt(nodeName: string, gates: ApprovalGates | undefined): boolean;
@@ -75,10 +74,27 @@ export declare function retryExecute(executor: IAgentExecutor, prompt: string, o
75
74
  * Read completed phases from feature.yaml.
76
75
  */
77
76
  export declare function getCompletedPhases(specDir: string): string[];
77
+ /**
78
+ * Remove a phase from completedPhases in feature.yaml.
79
+ * Used when a phase is rejected and needs to re-execute.
80
+ */
81
+ export declare function clearCompletedPhase(specDir: string, phaseId: string, log?: NodeLogger): void;
82
+ /**
83
+ * Type guard to detect rejection payloads from interrupt() return value.
84
+ */
85
+ export declare function isRejectionPayload(value: unknown): value is {
86
+ rejected: true;
87
+ feedback: string;
88
+ };
78
89
  /**
79
90
  * Mark a phase as complete in feature.yaml by adding its ID to completedPhases.
80
91
  */
81
92
  export declare function markPhaseComplete(specDir: string, phaseId: string, log?: NodeLogger): void;
93
+ /**
94
+ * Write a spec file atomically using temp-file-then-rename pattern.
95
+ * Prevents corruption on crash mid-write.
96
+ */
97
+ export declare function writeSpecFileAtomic(specDir: string, filename: string, content: string): void;
82
98
  /**
83
99
  * Execute a node with consistent logging and error handling.
84
100
  *
@@ -1 +1 @@
1
- {"version":3,"file":"node-helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,+DAA+D,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM;kBAE/B,MAAM,GAAG,IAAI;mBAIZ,MAAM,GAAG,IAAI;EAK/B;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,qBAAqB,CAMpF;AAeD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAS3F;AAMD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,mBAAmB,GAAG,eAAe,GAAG,SAAS,CAAC;AAMhG;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAKjE;AAED,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,SAAS,CAAC,EAAE,YAAY,GACvB,OAAO,CAAC,oBAAoB,CAAC,CA6B/B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAW5D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAwB1F;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,UAAU,KAAK,MAAM,GACjE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAiFnE"}
1
+ {"version":3,"file":"node-helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,+DAA+D,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM;kBAE/B,MAAM,GAAG,IAAI;mBAIZ,MAAM,GAAG,IAAI;EAK/B;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,qBAAqB,CAMpF;AAeD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAQ3F;AAMD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,mBAAmB,GAAG,eAAe,GAAG,SAAS,CAAC;AAMhG;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAKjE;AAED,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,SAAS,CAAC,EAAE,YAAY,GACvB,OAAO,CAAC,oBAAoB,CAAC,CA6B/B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAW5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAqB5F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAOhG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAwB1F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAa5F;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,UAAU,KAAK,MAAM,GACjE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAmHnE"}
@@ -5,7 +5,7 @@
5
5
  * and error handling so every node follows the same patterns.
6
6
  */
7
7
  import yaml from 'js-yaml';
8
- import { readFileSync, writeFileSync } from 'node:fs';
8
+ import { readFileSync, writeFileSync, renameSync, unlinkSync } from 'node:fs';
9
9
  import { join } from 'node:path';
10
10
  import { interrupt, isGraphBubbleUp } from '@langchain/langgraph';
11
11
  import { reportNodeStart } from '../heartbeat.js';
@@ -81,9 +81,8 @@ export function safeYamlLoad(content) {
81
81
  * - allowPlan: when true, skip interrupt after plan phase
82
82
  * - allowMerge: when true, skip interrupt after merge phase
83
83
  *
84
- * Nodes not covered by a gate (analyze, research) never interrupt.
85
- * The implement node always interrupts when gates are present
86
- * (unless all three gates are true, meaning fully autonomous).
84
+ * Nodes not covered by a gate (analyze, research, implement) never interrupt.
85
+ * Implementation always proceeds to merge; the merge node handles its own gate.
87
86
  *
88
87
  */
89
88
  export function shouldInterrupt(nodeName, gates) {
@@ -97,8 +96,6 @@ export function shouldInterrupt(nodeName, gates) {
97
96
  return !gates.allowPlan;
98
97
  if (nodeName === 'merge')
99
98
  return !gates.allowMerge;
100
- if (nodeName === 'implement')
101
- return true;
102
99
  return false;
103
100
  }
104
101
  const API_ERROR_RE = /API Error: (400|429|5\d{2})/;
@@ -169,6 +166,38 @@ export function getCompletedPhases(specDir) {
169
166
  return [];
170
167
  }
171
168
  }
169
+ /**
170
+ * Remove a phase from completedPhases in feature.yaml.
171
+ * Used when a phase is rejected and needs to re-execute.
172
+ */
173
+ export function clearCompletedPhase(specDir, phaseId, log) {
174
+ try {
175
+ const content = readSpecFile(specDir, 'feature.yaml');
176
+ if (!content)
177
+ return;
178
+ const data = yaml.load(content);
179
+ if (!data || typeof data !== 'object')
180
+ return;
181
+ const status = (data.status ?? {});
182
+ const completedPhases = Array.isArray(status.completedPhases)
183
+ ? status.completedPhases.filter((p) => p !== phaseId)
184
+ : [];
185
+ data.status = { ...status, completedPhases };
186
+ writeFileSync(join(specDir, 'feature.yaml'), yaml.dump(data, { indent: 2, lineWidth: -1 }), 'utf-8');
187
+ }
188
+ catch (err) {
189
+ log?.error(`Failed to clear completed phase: ${err instanceof Error ? err.message : String(err)}`);
190
+ }
191
+ }
192
+ /**
193
+ * Type guard to detect rejection payloads from interrupt() return value.
194
+ */
195
+ export function isRejectionPayload(value) {
196
+ return (typeof value === 'object' &&
197
+ value !== null &&
198
+ 'rejected' in value &&
199
+ value.rejected === true);
200
+ }
172
201
  /**
173
202
  * Mark a phase as complete in feature.yaml by adding its ID to completedPhases.
174
203
  */
@@ -194,6 +223,26 @@ export function markPhaseComplete(specDir, phaseId, log) {
194
223
  log?.error(`Failed to mark phase complete: ${err instanceof Error ? err.message : String(err)}`);
195
224
  }
196
225
  }
226
+ /**
227
+ * Write a spec file atomically using temp-file-then-rename pattern.
228
+ * Prevents corruption on crash mid-write.
229
+ */
230
+ export function writeSpecFileAtomic(specDir, filename, content) {
231
+ const targetPath = join(specDir, filename);
232
+ const tempPath = join(specDir, `.${filename}.tmp`);
233
+ try {
234
+ writeFileSync(tempPath, content, 'utf-8');
235
+ renameSync(tempPath, targetPath);
236
+ }
237
+ finally {
238
+ try {
239
+ unlinkSync(tempPath);
240
+ }
241
+ catch {
242
+ // Temp file already renamed or doesn't exist
243
+ }
244
+ }
245
+ }
197
246
  /**
198
247
  * Execute a node with consistent logging and error handling.
199
248
  *
@@ -210,16 +259,46 @@ export function executeNode(nodeName, executor, buildPrompt) {
210
259
  // Update feature lifecycle to reflect the current phase
211
260
  await updateNodeLifecycle(nodeName);
212
261
  // On resume from interrupt, LangGraph re-executes the node function from
213
- // the top. Skip the expensive executor call if this phase already completed
214
- // (markPhaseComplete is called before interrupt, so completed = done but
215
- // awaiting approval; the approval has now been granted).
262
+ // the top. Instead of re-executing within this invocation (which would
263
+ // require a second interrupt() call and trigger the stale-replay bug),
264
+ // we return early. Rejection sets _needsReexecution=true so a conditional
265
+ // edge in the graph routes back to this node for a fresh invocation.
216
266
  const completedPhases = getCompletedPhases(state.specDir);
217
267
  if (completedPhases.includes(nodeName)) {
218
- log.info('Phase already completed (resuming from approval), skipping execution');
219
- return {
220
- currentNode: nodeName,
221
- messages: [`[${nodeName}] Approved continuing`],
222
- };
268
+ if (shouldInterrupt(nodeName, state.approvalGates)) {
269
+ if (state._approvalAction === 'rejected') {
270
+ const feedback = state._rejectionFeedback ?? '(no feedback)';
271
+ log.info(`Phase rejected with feedback: "${feedback}"scheduling re-execution`);
272
+ clearCompletedPhase(state.specDir, nodeName, log);
273
+ // Return early — the conditional edge will route back to this node
274
+ // for a fresh invocation with a clean interrupt index.
275
+ return {
276
+ currentNode: nodeName,
277
+ messages: [`[${nodeName}] Rejected — will re-execute`],
278
+ _approvalAction: null,
279
+ _rejectionFeedback: null,
280
+ _needsReexecution: true,
281
+ };
282
+ }
283
+ else {
284
+ log.info('Phase approved, skipping re-execution');
285
+ return {
286
+ currentNode: nodeName,
287
+ messages: [`[${nodeName}] Approved — continuing`],
288
+ _approvalAction: null,
289
+ _rejectionFeedback: null,
290
+ _needsReexecution: false,
291
+ };
292
+ }
293
+ }
294
+ else {
295
+ log.info('Phase already completed (no gate), skipping execution');
296
+ return {
297
+ currentNode: nodeName,
298
+ messages: [`[${nodeName}] Approved — continuing`],
299
+ _needsReexecution: false,
300
+ };
301
+ }
223
302
  }
224
303
  const startTime = Date.now();
225
304
  // Record phase start (no-op if timing context not set)
@@ -236,13 +315,19 @@ export function executeNode(nodeName, executor, buildPrompt) {
236
315
  // Record phase completion
237
316
  await recordPhaseEnd(timingId, durationMs);
238
317
  // Mark phase complete BEFORE interrupting so that on resume the
239
- // node detects the work is already done and skips re-execution.
318
+ // node detects the work is already done and returns early.
240
319
  markPhaseComplete(state.specDir, nodeName, log);
241
320
  const nodeResult = {
242
321
  currentNode: nodeName,
243
322
  messages: [`[${nodeName}] Complete (${result.result.length} chars, ${elapsed}s)`],
323
+ _approvalAction: null,
324
+ _rejectionFeedback: null,
325
+ _needsReexecution: false,
244
326
  };
245
- // Human-in-the-loop: interrupt after node execution for review
327
+ // Human-in-the-loop: interrupt after node execution for review.
328
+ // This is the ONLY interrupt() call in the entire execution path.
329
+ // On resume, the node returns early (above) without calling interrupt(),
330
+ // so there is no stale interrupt replay.
246
331
  if (shouldInterrupt(nodeName, state.approvalGates)) {
247
332
  log.info('Interrupting for human approval');
248
333
  await recordApprovalWaitStart(timingId);
@@ -2,7 +2,8 @@
2
2
  * Requirements Phase Prompt
3
3
  *
4
4
  * Instructs the agent to build comprehensive requirements from the analysis,
5
- * including product questions with AI-recommended default answers.
5
+ * including product questions with structured QuestionOption[] arrays
6
+ * and AI-recommended default answers.
6
7
  * Writes back to spec.yaml with full requirements.
7
8
  */
8
9
  import type { FeatureAgentState } from '../../state.js';
@@ -1 +1 @@
1
- {"version":3,"file":"requirements.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CA4GxE"}
1
+ {"version":3,"file":"requirements.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAkKxE"}
@@ -2,14 +2,40 @@
2
2
  * Requirements Phase Prompt
3
3
  *
4
4
  * Instructs the agent to build comprehensive requirements from the analysis,
5
- * including product questions with AI-recommended default answers.
5
+ * including product questions with structured QuestionOption[] arrays
6
+ * and AI-recommended default answers.
6
7
  * Writes back to spec.yaml with full requirements.
7
8
  */
9
+ import yaml from 'js-yaml';
8
10
  import { readSpecFile } from '../node-helpers.js';
9
11
  export function buildRequirementsPrompt(state) {
10
12
  const specContent = readSpecFile(state.specDir, 'spec.yaml');
13
+ // Extract rejection feedback if present
14
+ let rejectionFeedbackSection = '';
15
+ try {
16
+ const specData = yaml.load(specContent);
17
+ const rejectionFeedback = specData?.rejectionFeedback;
18
+ if (rejectionFeedback && rejectionFeedback.length > 0) {
19
+ const entries = rejectionFeedback
20
+ .map((entry) => `- **Iteration ${entry.iteration}** (${entry.timestamp}): ${entry.message}`)
21
+ .join('\n');
22
+ rejectionFeedbackSection = `
23
+ ## Previous Rejection Feedback
24
+
25
+ The user has previously rejected this PRD with the following feedback. You MUST address these concerns in your revised output:
26
+
27
+ ${entries}
28
+
29
+ Focus on the most recent feedback (highest iteration number) while ensuring earlier feedback is still addressed.
30
+
31
+ `;
32
+ }
33
+ }
34
+ catch {
35
+ // If YAML parsing fails, continue without rejection feedback
36
+ }
11
37
  return `You are a product analyst performing the REQUIREMENTS phase of feature development.
12
-
38
+ ${rejectionFeedbackSection}
13
39
  ## Your Task
14
40
 
15
41
  1. Read the current spec with codebase analysis below
@@ -29,13 +55,20 @@ ${specContent}
29
55
  - **Non-functional requirements (NFR-N)**: performance, security, UX, maintainability constraints
30
56
  - **Success criteria**: measurable checkboxes that define "done"
31
57
 
32
- ### Product Questions with AI Defaults
58
+ ### Product Questions with Structured Options
33
59
  For every ambiguous product decision, create an openQuestion entry with:
34
60
  - A clear question
35
61
  - resolved: true (your recommendation is the default)
36
- - Your recommended answer with reasoning
62
+ - Structured options array with EXACTLY ONE option marked selected: true
63
+ - A selectionRationale explaining the recommendation
64
+ - An answer field containing the text of the selected option (for backward compatibility)
65
+
66
+ Each option MUST have:
67
+ - \`option\`: Short label for the approach (2-5 words)
68
+ - \`description\`: Explanation of this option's trade-offs and benefits
69
+ - \`selected\`: boolean — exactly ONE option per question must be true
37
70
 
38
- The user can later review and override these defaults. This is the AI-recommended path — not the only option.
71
+ The user can later review and override these defaults via interactive TUI.
39
72
 
40
73
  ## Output Instructions
41
74
 
@@ -60,12 +93,28 @@ Write the COMPLETE file. Preserve name/number/branch/technologies from analysis
60
93
  relatedLinks: (keep)
61
94
 
62
95
  openQuestions:
63
- - question: 'Should X use approach A or B?'
96
+ - question: 'Should X use approach A, B, or C?'
64
97
  resolved: true
65
- answer: 'Recommend A because [rationale]. Alternative: B if [condition].'
98
+ options:
99
+ - option: 'Approach A'
100
+ description: 'Benefits of A, when to use it, trade-offs'
101
+ selected: true
102
+ - option: 'Approach B'
103
+ description: 'Benefits of B, when to use it, trade-offs'
104
+ selected: false
105
+ selectionRationale: 'Approach A is recommended because [detailed reasoning]'
106
+ answer: 'Approach A'
66
107
  - question: 'What level of Y is needed?'
67
108
  resolved: true
68
- answer: 'Recommend Z level because [rationale].'
109
+ options:
110
+ - option: 'Basic'
111
+ description: 'Minimal implementation, fast to build'
112
+ selected: false
113
+ - option: 'Advanced'
114
+ description: 'Full-featured, handles edge cases'
115
+ selected: true
116
+ selectionRationale: 'Advanced is recommended because [reasoning]'
117
+ answer: 'Advanced'
69
118
 
70
119
  content: |
71
120
  ## Problem Statement
@@ -109,7 +158,8 @@ Write the COMPLETE file. Preserve name/number/branch/technologies from analysis
109
158
  ## Constraints
110
159
 
111
160
  - Write ONLY to ${state.specDir}/spec.yaml
112
- - Every open question MUST have an AI-recommended default answer (resolved: true)
161
+ - Every open question MUST have structured options with exactly ONE option marked selected: true
162
+ - Every open question MUST also have an \`answer\` field matching the selected option text
113
163
  - Requirements must be specific and testable, not vague
114
164
  - Do NOT create any other files
115
165
  - Do NOT modify any source code`;
@@ -1 +1 @@
1
- {"version":3,"file":"research.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAiHpE"}
1
+ {"version":3,"file":"research.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CA8HpE"}
@@ -74,7 +74,19 @@ Use this YAML structure:
74
74
  openQuestions:
75
75
  - question: '(Any technical question that arose)'
76
76
  resolved: true
77
- answer: '(Resolution with technical reasoning)'
77
+ options:
78
+ - option: (Option A)
79
+ description: (What option A means and its trade-offs)
80
+ selected: true
81
+ - option: (Option B)
82
+ description: (What option B means and its trade-offs)
83
+ selected: false
84
+ - option: (Option C)
85
+ description: (What option C means and its trade-offs)
86
+ selected: false
87
+ selectionRationale: >
88
+ (Detailed reasoning for why this option was selected.
89
+ Reference codebase patterns and technical constraints.)
78
90
 
79
91
  content: |
80
92
  ## Technology Decisions
@@ -115,6 +127,7 @@ Use this YAML structure:
115
127
  - Write ONLY to ${state.specDir}/research.yaml
116
128
  - Every decision MUST have at least one rejected alternative with reasoning
117
129
  - Every decision MUST have clear rationale referencing the codebase where applicable
130
+ - Every open question MUST have exactly 3 options to choose from
118
131
  - Prefer solutions that follow existing codebase patterns and conventions
119
132
  - Do NOT create any other files
120
133
  - Do NOT modify any source code`;
@@ -24,6 +24,9 @@ export declare function clearPhaseTimingContext(): void;
24
24
  /**
25
25
  * Record the start of a phase. Returns the timing record ID (for later update)
26
26
  * or null if context is not set or save fails.
27
+ *
28
+ * Automatically appends an iteration suffix (`:2`, `:3`, …) when the same
29
+ * phase has already been recorded for this run (e.g. after a rejection loop).
27
30
  */
28
31
  export declare function recordPhaseStart(phase: string): Promise<string | null>;
29
32
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"phase-timing-context.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AAMrH;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAG7F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqB5E;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/F;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,MAAM,EACtB,YAAY,CAAC,EAAE,sBAAsB,GACpC,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpF"}
1
+ {"version":3,"file":"phase-timing-context.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AAMrH;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAG7F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C;AA+BD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsB5E;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/F;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,MAAM,EACtB,YAAY,CAAC,EAAE,sBAAsB,GACpC,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpF"}
@@ -33,9 +33,35 @@ export function clearPhaseTimingContext() {
33
33
  contextRepository = undefined;
34
34
  lastTimingId = null;
35
35
  }
36
+ /**
37
+ * Compute the iteration-aware phase name.
38
+ *
39
+ * Queries existing PhaseTiming rows for the current run, counts how many
40
+ * share the same base phase name, and appends `:N` for iterations > 1.
41
+ *
42
+ * Examples:
43
+ * - First "requirements" execution → "requirements"
44
+ * - Second "requirements" execution → "requirements:2"
45
+ * - Third "requirements" execution → "requirements:3"
46
+ */
47
+ async function resolveIterationPhase(phase, runId, repository) {
48
+ try {
49
+ const existing = await repository.findByRunId(runId);
50
+ // Count rows whose phase is the base name or matches the base:N pattern
51
+ const count = existing.filter((t) => t.phase === phase || t.phase.startsWith(`${phase}:`)).length;
52
+ return count === 0 ? phase : `${phase}:${count + 1}`;
53
+ }
54
+ catch {
55
+ // On error, fall back to bare phase name
56
+ return phase;
57
+ }
58
+ }
36
59
  /**
37
60
  * Record the start of a phase. Returns the timing record ID (for later update)
38
61
  * or null if context is not set or save fails.
62
+ *
63
+ * Automatically appends an iteration suffix (`:2`, `:3`, …) when the same
64
+ * phase has already been recorded for this run (e.g. after a rejection loop).
39
65
  */
40
66
  export async function recordPhaseStart(phase) {
41
67
  if (!contextRunId || !contextRepository)
@@ -43,10 +69,11 @@ export async function recordPhaseStart(phase) {
43
69
  const id = randomUUID();
44
70
  const now = new Date();
45
71
  try {
72
+ const iterationPhase = await resolveIterationPhase(phase, contextRunId, contextRepository);
46
73
  await contextRepository.save({
47
74
  id,
48
75
  agentRunId: contextRunId,
49
- phase,
76
+ phase: iterationPhase,
50
77
  startedAt: now,
51
78
  createdAt: now,
52
79
  updatedAt: now,
@@ -38,6 +38,9 @@ export declare const FeatureAgentAnnotation: import("@langchain/langgraph").Anno
38
38
  validationRetries: import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
39
39
  lastValidationTarget: import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
40
40
  lastValidationErrors: import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
41
+ _approvalAction: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
42
+ _rejectionFeedback: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
43
+ _needsReexecution: import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
41
44
  prUrl: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
42
45
  prNumber: import("@langchain/langgraph").BinaryOperatorAggregate<number | null, number | null>;
43
46
  commitHash: import("@langchain/langgraph").BinaryOperatorAggregate<string | null, string | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDjC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,OAAO,sBAAsB,CAAC,KAAK,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEjC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,OAAO,sBAAsB,CAAC,KAAK,CAAC"}
@@ -37,6 +37,19 @@ export const FeatureAgentAnnotation = Annotation.Root({
37
37
  reducer: (_prev, next) => next,
38
38
  default: () => [],
39
39
  }),
40
+ // --- Approval action channels (set by Command({update}) on resume) ---
41
+ _approvalAction: Annotation({
42
+ reducer: (_prev, next) => (next !== undefined ? next : _prev),
43
+ default: () => null,
44
+ }),
45
+ _rejectionFeedback: Annotation({
46
+ reducer: (_prev, next) => (next !== undefined ? next : _prev),
47
+ default: () => null,
48
+ }),
49
+ _needsReexecution: Annotation({
50
+ reducer: (_prev, next) => next,
51
+ default: () => false,
52
+ }),
40
53
  // --- Merge and workflow state channels ---
41
54
  prUrl: Annotation({
42
55
  reducer: (_prev, next) => (next !== undefined ? next : _prev),
@@ -2,7 +2,7 @@
2
2
  * Notification Event Bus
3
3
  *
4
4
  * Typed EventEmitter singleton for in-process pub/sub of notification events.
5
- * Follows the getSettings() singleton pattern from settings.service.ts.
5
+ * Lazily initialized on first access — works in any context (CLI, web dev server, tests).
6
6
  *
7
7
  * Multiple listeners can subscribe to the 'notification' event for fan-out
8
8
  * delivery (SSE clients, desktop notifier, etc.).
@@ -22,26 +22,11 @@ export interface NotificationEventMap {
22
22
  notification: [event: NotificationEvent];
23
23
  }
24
24
  export type NotificationBus = EventEmitter<NotificationEventMap>;
25
- /**
26
- * Initialize the notification event bus singleton.
27
- * Must be called once during CLI bootstrap.
28
- *
29
- * @throws Error if the bus is already initialized
30
- */
31
- export declare function initializeNotificationBus(): void;
32
25
  /**
33
26
  * Get the notification event bus singleton.
34
- *
35
- * @returns The notification event bus
36
- * @throws Error if the bus hasn't been initialized yet
27
+ * Lazily creates the bus on first access.
37
28
  */
38
29
  export declare function getNotificationBus(): NotificationBus;
39
- /**
40
- * Check if the notification bus has been initialized.
41
- *
42
- * @returns True if the bus is initialized, false otherwise
43
- */
44
- export declare function hasNotificationBus(): boolean;
45
30
  /**
46
31
  * Reset the notification bus singleton (for testing purposes only).
47
32
  * DO NOT use in production code.
@@ -1 +1 @@
1
- {"version":3,"file":"notification-bus.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/notifications/notification-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;CAC1C;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;AAIjE;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAMhD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAQpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
1
+ {"version":3,"file":"notification-bus.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/notifications/notification-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;CAC1C;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;AAIjE;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAGpD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
@@ -2,7 +2,7 @@
2
2
  * Notification Event Bus
3
3
  *
4
4
  * Typed EventEmitter singleton for in-process pub/sub of notification events.
5
- * Follows the getSettings() singleton pattern from settings.service.ts.
5
+ * Lazily initialized on first access — works in any context (CLI, web dev server, tests).
6
6
  *
7
7
  * Multiple listeners can subscribe to the 'notification' event for fan-out
8
8
  * delivery (SSE clients, desktop notifier, etc.).
@@ -18,38 +18,14 @@
18
18
  */
19
19
  import { EventEmitter } from 'node:events';
20
20
  let busInstance = null;
21
- /**
22
- * Initialize the notification event bus singleton.
23
- * Must be called once during CLI bootstrap.
24
- *
25
- * @throws Error if the bus is already initialized
26
- */
27
- export function initializeNotificationBus() {
28
- if (busInstance !== null) {
29
- throw new Error('Notification bus already initialized. Cannot re-initialize.');
30
- }
31
- busInstance = new EventEmitter();
32
- }
33
21
  /**
34
22
  * Get the notification event bus singleton.
35
- *
36
- * @returns The notification event bus
37
- * @throws Error if the bus hasn't been initialized yet
23
+ * Lazily creates the bus on first access.
38
24
  */
39
25
  export function getNotificationBus() {
40
- if (busInstance === null) {
41
- throw new Error('Notification bus not initialized. Call initializeNotificationBus() during CLI bootstrap.');
42
- }
26
+ busInstance ??= new EventEmitter();
43
27
  return busInstance;
44
28
  }
45
- /**
46
- * Check if the notification bus has been initialized.
47
- *
48
- * @returns True if the bus is initialized, false otherwise
49
- */
50
- export function hasNotificationBus() {
51
- return busInstance !== null;
52
- }
53
29
  /**
54
30
  * Reset the notification bus singleton (for testing purposes only).
55
31
  * DO NOT use in production code.
@@ -25,7 +25,7 @@ export function createRejectCommand() {
25
25
  return;
26
26
  }
27
27
  const useCase = container.resolve(RejectAgentRunUseCase);
28
- const result = await useCase.execute(resolved.run.id, opts.reason);
28
+ const result = await useCase.execute(resolved.run.id, opts.reason ?? 'Rejected by user');
29
29
  if (result.rejected) {
30
30
  messages.success(`Rejected ${colors.accent(resolved.run.id.substring(0, 8))}: ${result.reason}`);
31
31
  }