@shepai/cli 1.14.2 → 1.15.1

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 (346) hide show
  1. package/README.md +191 -101
  2. package/dist/src/application/ports/output/{agent-executor-factory.interface.d.ts → agents/agent-executor-factory.interface.d.ts} +1 -1
  3. package/dist/src/application/ports/output/agents/agent-executor-factory.interface.d.ts.map +1 -0
  4. package/dist/src/application/ports/output/{agent-executor.interface.d.ts → agents/agent-executor.interface.d.ts} +1 -1
  5. package/dist/src/application/ports/output/agents/agent-executor.interface.d.ts.map +1 -0
  6. package/dist/src/application/ports/output/{agent-registry.interface.d.ts → agents/agent-registry.interface.d.ts} +1 -1
  7. package/dist/src/application/ports/output/agents/agent-registry.interface.d.ts.map +1 -0
  8. package/dist/src/application/ports/output/{agent-run-repository.interface.d.ts → agents/agent-run-repository.interface.d.ts} +1 -1
  9. package/dist/src/application/ports/output/agents/agent-run-repository.interface.d.ts.map +1 -0
  10. package/dist/src/application/ports/output/{agent-runner.interface.d.ts → agents/agent-runner.interface.d.ts} +1 -1
  11. package/dist/src/application/ports/output/agents/agent-runner.interface.d.ts.map +1 -0
  12. package/dist/src/application/ports/output/{agent-validator.interface.d.ts → agents/agent-validator.interface.d.ts} +1 -1
  13. package/dist/src/application/ports/output/agents/agent-validator.interface.d.ts.map +1 -0
  14. package/dist/src/application/ports/output/agents/feature-agent-process.interface.d.ts +44 -0
  15. package/dist/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -0
  16. package/dist/src/application/ports/output/agents/feature-agent-process.interface.js +12 -0
  17. package/dist/src/application/ports/output/agents/index.d.ts +13 -0
  18. package/dist/src/application/ports/output/agents/index.d.ts.map +1 -0
  19. package/dist/src/application/ports/output/agents/index.js +6 -0
  20. package/dist/src/application/ports/output/index.d.ts +8 -11
  21. package/dist/src/application/ports/output/index.d.ts.map +1 -1
  22. package/dist/src/application/ports/output/index.js +5 -3
  23. package/dist/src/application/ports/output/repositories/feature-repository.interface.d.ts +76 -0
  24. package/dist/src/application/ports/output/repositories/feature-repository.interface.d.ts.map +1 -0
  25. package/dist/src/application/ports/output/repositories/feature-repository.interface.js +11 -0
  26. package/dist/src/application/ports/output/repositories/index.d.ts +8 -0
  27. package/dist/src/application/ports/output/repositories/index.d.ts.map +1 -0
  28. package/dist/src/application/ports/output/repositories/index.js +6 -0
  29. package/dist/src/application/ports/output/{settings.repository.interface.d.ts → repositories/settings.repository.interface.d.ts} +1 -1
  30. package/dist/src/application/ports/output/repositories/settings.repository.interface.d.ts.map +1 -0
  31. package/dist/src/application/ports/output/services/external-issue-fetcher.interface.d.ts +69 -0
  32. package/dist/src/application/ports/output/services/external-issue-fetcher.interface.d.ts.map +1 -0
  33. package/dist/src/application/ports/output/services/external-issue-fetcher.interface.js +46 -0
  34. package/dist/src/application/ports/output/services/index.d.ts +13 -0
  35. package/dist/src/application/ports/output/services/index.d.ts.map +1 -0
  36. package/dist/src/application/ports/output/services/index.js +7 -0
  37. package/dist/src/application/ports/output/services/spec-initializer.interface.d.ts +33 -0
  38. package/dist/src/application/ports/output/services/spec-initializer.interface.d.ts.map +1 -0
  39. package/dist/src/application/ports/output/services/spec-initializer.interface.js +8 -0
  40. package/dist/src/application/ports/output/{version-service.interface.d.ts → services/version-service.interface.d.ts} +1 -1
  41. package/dist/src/application/ports/output/services/version-service.interface.d.ts.map +1 -0
  42. package/dist/src/application/ports/output/services/web-server-service.interface.d.ts.map +1 -0
  43. package/dist/src/application/ports/output/services/worktree-service.interface.d.ts +83 -0
  44. package/dist/src/application/ports/output/services/worktree-service.interface.d.ts.map +1 -0
  45. package/dist/src/application/ports/output/services/worktree-service.interface.js +30 -0
  46. package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts +22 -0
  47. package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -0
  48. package/dist/src/application/use-cases/agents/approve-agent-run.use-case.js +67 -0
  49. package/dist/src/application/use-cases/agents/configure-agent.use-case.d.ts +2 -2
  50. package/dist/src/application/use-cases/agents/configure-agent.use-case.d.ts.map +1 -1
  51. package/dist/src/application/use-cases/agents/delete-agent-run.use-case.d.ts +16 -0
  52. package/dist/src/application/use-cases/agents/delete-agent-run.use-case.d.ts.map +1 -0
  53. package/dist/src/application/use-cases/agents/delete-agent-run.use-case.js +46 -0
  54. package/dist/src/application/use-cases/agents/get-agent-run.use-case.d.ts +22 -0
  55. package/dist/src/application/use-cases/agents/get-agent-run.use-case.d.ts.map +1 -0
  56. package/dist/src/application/use-cases/agents/get-agent-run.use-case.js +42 -0
  57. package/dist/src/application/use-cases/agents/list-agent-runs.use-case.d.ts +21 -0
  58. package/dist/src/application/use-cases/agents/list-agent-runs.use-case.d.ts.map +1 -0
  59. package/dist/src/application/use-cases/agents/list-agent-runs.use-case.js +54 -0
  60. package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts +16 -0
  61. package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -0
  62. package/dist/src/application/use-cases/agents/reject-agent-run.use-case.js +52 -0
  63. package/dist/src/application/use-cases/agents/run-agent.use-case.d.ts +2 -2
  64. package/dist/src/application/use-cases/agents/run-agent.use-case.d.ts.map +1 -1
  65. package/dist/src/application/use-cases/agents/show-agent-run.use-case.d.ts +24 -0
  66. package/dist/src/application/use-cases/agents/show-agent-run.use-case.d.ts.map +1 -0
  67. package/dist/src/application/use-cases/agents/show-agent-run.use-case.js +52 -0
  68. package/dist/src/application/use-cases/agents/stop-agent-run.use-case.d.ts +15 -0
  69. package/dist/src/application/use-cases/agents/stop-agent-run.use-case.d.ts.map +1 -0
  70. package/dist/src/application/use-cases/agents/stop-agent-run.use-case.js +86 -0
  71. package/dist/src/application/use-cases/agents/validate-agent-auth.use-case.d.ts +1 -1
  72. package/dist/src/application/use-cases/agents/validate-agent-auth.use-case.d.ts.map +1 -1
  73. package/dist/src/application/use-cases/features/create-feature.use-case.d.ts +43 -0
  74. package/dist/src/application/use-cases/features/create-feature.use-case.d.ts.map +1 -0
  75. package/dist/src/application/use-cases/features/create-feature.use-case.js +166 -0
  76. package/dist/src/application/use-cases/features/delete-feature.use-case.d.ts +27 -0
  77. package/dist/src/application/use-cases/features/delete-feature.use-case.d.ts.map +1 -0
  78. package/dist/src/application/use-cases/features/delete-feature.use-case.js +83 -0
  79. package/dist/src/application/use-cases/features/list-features.use-case.d.ts +17 -0
  80. package/dist/src/application/use-cases/features/list-features.use-case.d.ts.map +1 -0
  81. package/dist/src/application/use-cases/features/list-features.use-case.js +37 -0
  82. package/dist/src/application/use-cases/features/resume-feature.use-case.d.ts +24 -0
  83. package/dist/src/application/use-cases/features/resume-feature.use-case.d.ts.map +1 -0
  84. package/dist/src/application/use-cases/features/resume-feature.use-case.js +100 -0
  85. package/dist/src/application/use-cases/features/show-feature.use-case.d.ts +17 -0
  86. package/dist/src/application/use-cases/features/show-feature.use-case.d.ts.map +1 -0
  87. package/dist/src/application/use-cases/features/show-feature.use-case.js +43 -0
  88. package/dist/src/application/use-cases/settings/initialize-settings.use-case.d.ts +1 -1
  89. package/dist/src/application/use-cases/settings/initialize-settings.use-case.d.ts.map +1 -1
  90. package/dist/src/application/use-cases/settings/load-settings.use-case.d.ts +1 -1
  91. package/dist/src/application/use-cases/settings/load-settings.use-case.d.ts.map +1 -1
  92. package/dist/src/application/use-cases/settings/update-settings.use-case.d.ts +1 -1
  93. package/dist/src/application/use-cases/settings/update-settings.use-case.d.ts.map +1 -1
  94. package/dist/src/domain/generated/output.d.ts +26 -1
  95. package/dist/src/domain/generated/output.d.ts.map +1 -1
  96. package/dist/src/domain/generated/output.js +1 -0
  97. package/dist/src/infrastructure/di/container.d.ts.map +1 -1
  98. package/dist/src/infrastructure/di/container.js +64 -14
  99. package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts +4 -0
  100. package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts.map +1 -1
  101. package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.js +8 -0
  102. package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +50 -0
  103. package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts.map +1 -0
  104. package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.js +62 -0
  105. package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
  106. package/dist/src/infrastructure/persistence/sqlite/migrations.js +49 -0
  107. package/dist/src/infrastructure/repositories/agent-run.repository.d.ts +1 -1
  108. package/dist/src/infrastructure/repositories/agent-run.repository.d.ts.map +1 -1
  109. package/dist/src/infrastructure/repositories/agent-run.repository.js +30 -8
  110. package/dist/src/infrastructure/repositories/sqlite-feature.repository.d.ts +25 -0
  111. package/dist/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -0
  112. package/dist/src/infrastructure/repositories/sqlite-feature.repository.js +113 -0
  113. package/dist/src/infrastructure/repositories/sqlite-settings.repository.d.ts +1 -1
  114. package/dist/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  115. package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.d.ts +1 -23
  116. package/dist/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts.map +1 -0
  117. package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.js +4 -11
  118. package/dist/src/infrastructure/services/agents/analyze-repo/prompts/analyze-repository.prompt.d.ts.map +1 -0
  119. package/dist/src/infrastructure/services/agents/{agent-executor-factory.service.d.ts → common/agent-executor-factory.service.d.ts} +3 -3
  120. package/dist/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -0
  121. package/dist/src/infrastructure/services/agents/{agent-registry.service.d.ts → common/agent-registry.service.d.ts} +1 -1
  122. package/dist/src/infrastructure/services/agents/common/agent-registry.service.d.ts.map +1 -0
  123. package/dist/src/infrastructure/services/agents/{agent-registry.service.js → common/agent-registry.service.js} +7 -1
  124. package/dist/src/infrastructure/services/agents/{agent-runner.service.d.ts → common/agent-runner.service.d.ts} +5 -5
  125. package/dist/src/infrastructure/services/agents/common/agent-runner.service.d.ts.map +1 -0
  126. package/dist/src/infrastructure/services/agents/{agent-runner.service.js → common/agent-runner.service.js} +4 -4
  127. package/dist/src/infrastructure/services/agents/{agent-validator.service.d.ts → common/agent-validator.service.d.ts} +2 -2
  128. package/dist/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -0
  129. package/dist/src/infrastructure/services/agents/{langgraph → common}/checkpointer.d.ts +1 -0
  130. package/dist/src/infrastructure/services/agents/common/checkpointer.d.ts.map +1 -0
  131. package/dist/src/infrastructure/services/agents/{langgraph → common}/checkpointer.js +6 -0
  132. package/dist/src/infrastructure/services/agents/{executors → common/executors}/claude-code-executor.service.d.ts +9 -2
  133. package/dist/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -0
  134. package/dist/src/infrastructure/services/agents/{executors → common/executors}/claude-code-executor.service.js +103 -6
  135. package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts +15 -0
  136. package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts.map +1 -0
  137. package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.js +16 -0
  138. package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.d.ts +17 -0
  139. package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.d.ts.map +1 -0
  140. package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.js +49 -0
  141. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +244 -0
  142. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -0
  143. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.js +36 -0
  144. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +20 -0
  145. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -0
  146. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +90 -0
  147. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +31 -0
  148. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -0
  149. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +236 -0
  150. package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.d.ts +19 -0
  151. package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.d.ts.map +1 -0
  152. package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.js +38 -0
  153. package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.d.ts +7 -0
  154. package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.d.ts.map +1 -0
  155. package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.js +9 -0
  156. package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts +11 -0
  157. package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts.map +1 -0
  158. package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.js +23 -0
  159. package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +40 -0
  160. package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -0
  161. package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +114 -0
  162. package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.d.ts +7 -0
  163. package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.d.ts.map +1 -0
  164. package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.js +9 -0
  165. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts +9 -0
  166. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts.map +1 -0
  167. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.js +94 -0
  168. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.d.ts +8 -0
  169. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.d.ts.map +1 -0
  170. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.js +18 -0
  171. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts +11 -0
  172. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts.map +1 -0
  173. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.js +170 -0
  174. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts +10 -0
  175. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts.map +1 -0
  176. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.js +116 -0
  177. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts +10 -0
  178. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts.map +1 -0
  179. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.js +121 -0
  180. package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.d.ts +7 -0
  181. package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.d.ts.map +1 -0
  182. package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.js +9 -0
  183. package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.d.ts +7 -0
  184. package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.d.ts.map +1 -0
  185. package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.js +9 -0
  186. package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts +39 -0
  187. package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -0
  188. package/dist/src/infrastructure/services/agents/feature-agent/state.js +27 -0
  189. package/dist/src/infrastructure/services/agents/streaming/streaming-executor-proxy.d.ts +1 -1
  190. package/dist/src/infrastructure/services/agents/streaming/streaming-executor-proxy.d.ts.map +1 -1
  191. package/dist/src/infrastructure/services/external/github-issue.service.d.ts +19 -0
  192. package/dist/src/infrastructure/services/external/github-issue.service.d.ts.map +1 -0
  193. package/dist/src/infrastructure/services/external/github-issue.service.js +59 -0
  194. package/dist/src/infrastructure/services/external/jira-ticket.service.d.ts +23 -0
  195. package/dist/src/infrastructure/services/external/jira-ticket.service.d.ts.map +1 -0
  196. package/dist/src/infrastructure/services/external/jira-ticket.service.js +57 -0
  197. package/dist/src/infrastructure/services/git/worktree.service.d.ts +28 -0
  198. package/dist/src/infrastructure/services/git/worktree.service.d.ts.map +1 -0
  199. package/dist/src/infrastructure/services/git/worktree.service.js +112 -0
  200. package/dist/src/infrastructure/services/spec/spec-initializer.service.d.ts +17 -0
  201. package/dist/src/infrastructure/services/spec/spec-initializer.service.d.ts.map +1 -0
  202. package/dist/src/infrastructure/services/spec/spec-initializer.service.js +281 -0
  203. package/dist/src/infrastructure/services/web-server.service.d.ts +1 -1
  204. package/dist/src/infrastructure/services/web-server.service.d.ts.map +1 -1
  205. package/dist/src/presentation/cli/commands/agent/approve.command.d.ts +11 -0
  206. package/dist/src/presentation/cli/commands/agent/approve.command.d.ts.map +1 -0
  207. package/dist/src/presentation/cli/commands/agent/approve.command.js +42 -0
  208. package/dist/src/presentation/cli/commands/agent/delete.command.d.ts +11 -0
  209. package/dist/src/presentation/cli/commands/agent/delete.command.d.ts.map +1 -0
  210. package/dist/src/presentation/cli/commands/agent/delete.command.js +49 -0
  211. package/dist/src/presentation/cli/commands/agent/index.d.ts +21 -0
  212. package/dist/src/presentation/cli/commands/agent/index.d.ts.map +1 -0
  213. package/dist/src/presentation/cli/commands/agent/index.js +38 -0
  214. package/dist/src/presentation/cli/commands/agent/logs.command.d.ts +13 -0
  215. package/dist/src/presentation/cli/commands/agent/logs.command.d.ts.map +1 -0
  216. package/dist/src/presentation/cli/commands/agent/logs.command.js +163 -0
  217. package/dist/src/presentation/cli/commands/agent/ls.command.d.ts +12 -0
  218. package/dist/src/presentation/cli/commands/agent/ls.command.d.ts.map +1 -0
  219. package/dist/src/presentation/cli/commands/agent/ls.command.js +111 -0
  220. package/dist/src/presentation/cli/commands/agent/reject.command.d.ts +11 -0
  221. package/dist/src/presentation/cli/commands/agent/reject.command.d.ts.map +1 -0
  222. package/dist/src/presentation/cli/commands/agent/reject.command.js +43 -0
  223. package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts +10 -0
  224. package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts.map +1 -0
  225. package/dist/src/presentation/cli/commands/agent/resolve-run.js +27 -0
  226. package/dist/src/presentation/cli/commands/agent/show.command.d.ts +12 -0
  227. package/dist/src/presentation/cli/commands/agent/show.command.d.ts.map +1 -0
  228. package/dist/src/presentation/cli/commands/agent/show.command.js +202 -0
  229. package/dist/src/presentation/cli/commands/agent/stop.command.d.ts +11 -0
  230. package/dist/src/presentation/cli/commands/agent/stop.command.d.ts.map +1 -0
  231. package/dist/src/presentation/cli/commands/agent/stop.command.js +42 -0
  232. package/dist/src/presentation/cli/commands/feat/del.command.d.ts +17 -0
  233. package/dist/src/presentation/cli/commands/feat/del.command.d.ts.map +1 -0
  234. package/dist/src/presentation/cli/commands/feat/del.command.js +55 -0
  235. package/dist/src/presentation/cli/commands/feat/index.d.ts +17 -0
  236. package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -0
  237. package/dist/src/presentation/cli/commands/feat/index.js +29 -0
  238. package/dist/src/presentation/cli/commands/feat/ls.command.d.ts +15 -0
  239. package/dist/src/presentation/cli/commands/feat/ls.command.d.ts.map +1 -0
  240. package/dist/src/presentation/cli/commands/feat/ls.command.js +112 -0
  241. package/dist/src/presentation/cli/commands/feat/new.command.d.ts +17 -0
  242. package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -0
  243. package/dist/src/presentation/cli/commands/feat/new.command.js +64 -0
  244. package/dist/src/presentation/cli/commands/feat/resume.command.d.ts +11 -0
  245. package/dist/src/presentation/cli/commands/feat/resume.command.d.ts.map +1 -0
  246. package/dist/src/presentation/cli/commands/feat/resume.command.js +33 -0
  247. package/dist/src/presentation/cli/commands/feat/show.command.d.ts +11 -0
  248. package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -0
  249. package/dist/src/presentation/cli/commands/feat/show.command.js +128 -0
  250. package/dist/src/presentation/cli/index.d.ts +8 -4
  251. package/dist/src/presentation/cli/index.d.ts.map +1 -1
  252. package/dist/src/presentation/cli/index.js +12 -4
  253. package/dist/src/presentation/cli/ui/detail-view.d.ts +43 -0
  254. package/dist/src/presentation/cli/ui/detail-view.d.ts.map +1 -0
  255. package/dist/src/presentation/cli/ui/detail-view.js +57 -0
  256. package/dist/src/presentation/cli/ui/index.d.ts +2 -0
  257. package/dist/src/presentation/cli/ui/index.d.ts.map +1 -1
  258. package/dist/src/presentation/cli/ui/index.js +2 -0
  259. package/dist/src/presentation/cli/ui/list-view.d.ts +34 -0
  260. package/dist/src/presentation/cli/ui/list-view.d.ts.map +1 -0
  261. package/dist/src/presentation/cli/ui/list-view.js +65 -0
  262. package/dist/src/presentation/cli/ui/symbols.d.ts +5 -1
  263. package/dist/src/presentation/cli/ui/symbols.d.ts.map +1 -1
  264. package/dist/src/presentation/cli/ui/symbols.js +4 -0
  265. package/dist/tsconfig.build.tsbuildinfo +1 -1
  266. package/package.json +2 -1
  267. package/web/.next/BUILD_ID +1 -1
  268. package/web/.next/build-manifest.json +2 -2
  269. package/web/.next/cache/.previewinfo +1 -1
  270. package/web/.next/cache/.rscinfo +1 -1
  271. package/web/.next/cache/config.json +3 -3
  272. package/web/.next/fallback-build-manifest.json +2 -2
  273. package/web/.next/prerender-manifest.json +3 -3
  274. package/web/.next/required-server-files.js +1 -1
  275. package/web/.next/required-server-files.json +1 -1
  276. package/web/.next/server/app/_global-error.html +2 -2
  277. package/web/.next/server/app/_global-error.rsc +1 -1
  278. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  279. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  280. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  281. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  282. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  283. package/web/.next/server/app/_not-found.html +2 -2
  284. package/web/.next/server/app/_not-found.rsc +1 -1
  285. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  286. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  287. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  288. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  289. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  290. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  291. package/web/.next/server/app/index.html +2 -2
  292. package/web/.next/server/app/index.rsc +1 -1
  293. package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  294. package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  295. package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  296. package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  297. package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  298. package/web/.next/server/app/version.html +2 -2
  299. package/web/.next/server/app/version.rsc +1 -1
  300. package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
  301. package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
  302. package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
  303. package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
  304. package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
  305. package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
  306. package/web/.next/server/chunks/ssr/_19be0743._.js +1 -1
  307. package/web/.next/server/pages/404.html +2 -2
  308. package/web/.next/server/pages/500.html +2 -2
  309. package/web/.next/server/server-reference-manifest.js +1 -1
  310. package/web/.next/server/server-reference-manifest.json +1 -1
  311. package/web/.next/trace +1 -1
  312. package/web/.next/trace-build +1 -1
  313. package/dist/src/application/ports/output/agent-executor-factory.interface.d.ts.map +0 -1
  314. package/dist/src/application/ports/output/agent-executor.interface.d.ts.map +0 -1
  315. package/dist/src/application/ports/output/agent-registry.interface.d.ts.map +0 -1
  316. package/dist/src/application/ports/output/agent-run-repository.interface.d.ts.map +0 -1
  317. package/dist/src/application/ports/output/agent-runner.interface.d.ts.map +0 -1
  318. package/dist/src/application/ports/output/agent-validator.interface.d.ts.map +0 -1
  319. package/dist/src/application/ports/output/settings.repository.interface.d.ts.map +0 -1
  320. package/dist/src/application/ports/output/version-service.interface.d.ts.map +0 -1
  321. package/dist/src/application/ports/output/web-server-service.interface.d.ts.map +0 -1
  322. package/dist/src/infrastructure/services/agents/agent-executor-factory.service.d.ts.map +0 -1
  323. package/dist/src/infrastructure/services/agents/agent-registry.service.d.ts.map +0 -1
  324. package/dist/src/infrastructure/services/agents/agent-runner.service.d.ts.map +0 -1
  325. package/dist/src/infrastructure/services/agents/agent-validator.service.d.ts.map +0 -1
  326. package/dist/src/infrastructure/services/agents/executors/claude-code-executor.service.d.ts.map +0 -1
  327. package/dist/src/infrastructure/services/agents/langgraph/analyze-repository-graph.d.ts.map +0 -1
  328. package/dist/src/infrastructure/services/agents/langgraph/checkpointer.d.ts.map +0 -1
  329. package/dist/src/infrastructure/services/agents/langgraph/prompts/analyze-repository.prompt.d.ts.map +0 -1
  330. /package/dist/src/application/ports/output/{agent-executor-factory.interface.js → agents/agent-executor-factory.interface.js} +0 -0
  331. /package/dist/src/application/ports/output/{agent-executor.interface.js → agents/agent-executor.interface.js} +0 -0
  332. /package/dist/src/application/ports/output/{agent-registry.interface.js → agents/agent-registry.interface.js} +0 -0
  333. /package/dist/src/application/ports/output/{agent-run-repository.interface.js → agents/agent-run-repository.interface.js} +0 -0
  334. /package/dist/src/application/ports/output/{agent-runner.interface.js → agents/agent-runner.interface.js} +0 -0
  335. /package/dist/src/application/ports/output/{agent-validator.interface.js → agents/agent-validator.interface.js} +0 -0
  336. /package/dist/src/application/ports/output/{settings.repository.interface.js → repositories/settings.repository.interface.js} +0 -0
  337. /package/dist/src/application/ports/output/{version-service.interface.js → services/version-service.interface.js} +0 -0
  338. /package/dist/src/application/ports/output/{web-server-service.interface.d.ts → services/web-server-service.interface.d.ts} +0 -0
  339. /package/dist/src/application/ports/output/{web-server-service.interface.js → services/web-server-service.interface.js} +0 -0
  340. /package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/prompts/analyze-repository.prompt.d.ts +0 -0
  341. /package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/prompts/analyze-repository.prompt.js +0 -0
  342. /package/dist/src/infrastructure/services/agents/{agent-executor-factory.service.js → common/agent-executor-factory.service.js} +0 -0
  343. /package/dist/src/infrastructure/services/agents/{agent-validator.service.js → common/agent-validator.service.js} +0 -0
  344. /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → iYaq62xFNOChDTbH3WMrr}/_buildManifest.js +0 -0
  345. /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → iYaq62xFNOChDTbH3WMrr}/_clientMiddlewareManifest.json +0 -0
  346. /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → iYaq62xFNOChDTbH3WMrr}/_ssgManifest.js +0 -0
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Create Feature Use Case
3
+ *
4
+ * Creates a new feature entity with a git worktree for isolated development,
5
+ * initializes the spec directory with YAML templates, then spawns the
6
+ * feature agent to begin autonomous SDLC processing.
7
+ *
8
+ * Business Rules:
9
+ * - AI generates slug/name/description from user's free-text input
10
+ * - Falls back to regex-based slug if AI fails
11
+ * - Full user input is preserved as-is in spec.yaml
12
+ * - Slug must be unique within the repository
13
+ * - A git worktree is created at ~/.shep/repos/HASH/wt/SLUG/
14
+ * - Spec YAML files are scaffolded at WORKTREE/specs/NNN-SLUG/
15
+ * - Feature agent is spawned with the spec dir path
16
+ * - specPath is persisted on the Feature record
17
+ * - Initial lifecycle is Requirements
18
+ */
19
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
20
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
21
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
22
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
24
+ };
25
+ var __metadata = (this && this.__metadata) || function (k, v) {
26
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
27
+ };
28
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
29
+ return function (target, key) { decorator(target, key, paramIndex); }
30
+ };
31
+ import { injectable, inject } from 'tsyringe';
32
+ import { randomUUID } from 'node:crypto';
33
+ import { SdlcLifecycle } from '../../../domain/generated/output.js';
34
+ import { AgentRunStatus } from '../../../domain/generated/output.js';
35
+ import { getSettings } from '../../../infrastructure/services/settings.service.js';
36
+ /** Maximum characters of user input sent to the AI for metadata generation. */
37
+ const MAX_INPUT_FOR_AI = 500;
38
+ let CreateFeatureUseCase = class CreateFeatureUseCase {
39
+ featureRepo;
40
+ worktreeService;
41
+ agentProcess;
42
+ runRepository;
43
+ specInitializer;
44
+ executorFactory;
45
+ constructor(featureRepo, worktreeService, agentProcess, runRepository, specInitializer, executorFactory) {
46
+ this.featureRepo = featureRepo;
47
+ this.worktreeService = worktreeService;
48
+ this.agentProcess = agentProcess;
49
+ this.runRepository = runRepository;
50
+ this.specInitializer = specInitializer;
51
+ this.executorFactory = executorFactory;
52
+ }
53
+ async execute(input) {
54
+ const metadata = await this.generateMetadata(input.userInput);
55
+ const slug = metadata.slug;
56
+ const branch = `feat/${slug}`;
57
+ const existing = await this.featureRepo.findBySlug(slug, input.repositoryPath);
58
+ if (existing) {
59
+ throw new Error(`Feature with slug "${slug}" already exists in this repository`);
60
+ }
61
+ // Determine next feature number for this repo
62
+ const existingFeatures = await this.featureRepo.list({
63
+ repositoryPath: input.repositoryPath,
64
+ });
65
+ const featureNumber = existingFeatures.length + 1;
66
+ const now = new Date();
67
+ const runId = randomUUID();
68
+ // Create git worktree for isolated development
69
+ const worktreePath = this.worktreeService.getWorktreePath(input.repositoryPath, branch);
70
+ await this.worktreeService.create(input.repositoryPath, branch, worktreePath);
71
+ // Initialize spec directory — full user input goes into spec.yaml as-is
72
+ const { specDir } = await this.specInitializer.initialize(worktreePath, slug, featureNumber, input.userInput);
73
+ const feature = {
74
+ id: randomUUID(),
75
+ name: metadata.name,
76
+ slug,
77
+ description: metadata.description,
78
+ repositoryPath: input.repositoryPath,
79
+ branch,
80
+ lifecycle: SdlcLifecycle.Requirements,
81
+ messages: [],
82
+ relatedArtifacts: [],
83
+ agentRunId: runId,
84
+ specPath: specDir,
85
+ createdAt: now,
86
+ updatedAt: now,
87
+ };
88
+ await this.featureRepo.create(feature);
89
+ // Create agent run record and spawn background worker
90
+ const settings = getSettings();
91
+ const agentRun = {
92
+ id: runId,
93
+ agentType: settings.agent.type,
94
+ agentName: 'feature-agent',
95
+ status: AgentRunStatus.pending,
96
+ prompt: input.userInput,
97
+ threadId: randomUUID(),
98
+ featureId: feature.id,
99
+ repositoryPath: input.repositoryPath,
100
+ ...(input.approvalMode ? { approvalMode: input.approvalMode } : {}),
101
+ createdAt: now.toISOString(),
102
+ updatedAt: now.toISOString(),
103
+ };
104
+ await this.runRepository.create(agentRun);
105
+ this.agentProcess.spawn(feature.id, runId, input.repositoryPath, specDir, worktreePath, input.approvalMode ? { approvalMode: input.approvalMode } : undefined);
106
+ return feature;
107
+ }
108
+ async generateMetadata(userInput) {
109
+ try {
110
+ const settings = getSettings();
111
+ const executor = this.executorFactory.createExecutor(settings.agent.type, settings.agent);
112
+ const truncated = userInput.length > MAX_INPUT_FOR_AI
113
+ ? `${userInput.slice(0, MAX_INPUT_FOR_AI)}...`
114
+ : userInput;
115
+ const prompt = `Generate feature metadata from this user request:
116
+ "${truncated}"
117
+
118
+ Return ONLY a JSON object with these fields:
119
+ - slug: kebab-case identifier, 2-4 words max (e.g., "github-oauth-login")
120
+ - name: short human-readable title (e.g., "GitHub OAuth Login")
121
+ - description: refined 1-2 sentence description
122
+
123
+ JSON only, no markdown fences.`;
124
+ const result = await executor.execute(prompt, {
125
+ maxTurns: 1,
126
+ allowedTools: [],
127
+ });
128
+ const parsed = JSON.parse(result.result);
129
+ if (!parsed.slug || !parsed.name || !parsed.description) {
130
+ throw new Error('Missing required fields in AI response');
131
+ }
132
+ return {
133
+ slug: this.toSlug(parsed.slug),
134
+ name: parsed.name,
135
+ description: parsed.description,
136
+ };
137
+ }
138
+ catch {
139
+ // Fallback to regex-based slug generation
140
+ return {
141
+ slug: this.toSlug(userInput),
142
+ name: userInput,
143
+ description: userInput,
144
+ };
145
+ }
146
+ }
147
+ toSlug(text) {
148
+ return text
149
+ .toLowerCase()
150
+ .replace(/[^a-z0-9\s-]/g, '')
151
+ .replace(/\s+/g, '-')
152
+ .replace(/-+/g, '-')
153
+ .replace(/^-|-$/g, '');
154
+ }
155
+ };
156
+ CreateFeatureUseCase = __decorate([
157
+ injectable(),
158
+ __param(0, inject('IFeatureRepository')),
159
+ __param(1, inject('IWorktreeService')),
160
+ __param(2, inject('IFeatureAgentProcessService')),
161
+ __param(3, inject('IAgentRunRepository')),
162
+ __param(4, inject('ISpecInitializerService')),
163
+ __param(5, inject('IAgentExecutorFactory')),
164
+ __metadata("design:paramtypes", [Object, Object, Object, Object, Object, Object])
165
+ ], CreateFeatureUseCase);
166
+ export { CreateFeatureUseCase };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Delete Feature Use Case
3
+ *
4
+ * Orchestrates feature deletion including:
5
+ * - Cancelling any running/pending agent runs
6
+ * - Removing the git worktree
7
+ * - Deleting the feature record
8
+ *
9
+ * Business Rules:
10
+ * - Throws if the feature does not exist
11
+ * - Cancels running/pending agent runs before deletion
12
+ * - Gracefully handles worktree removal failures
13
+ */
14
+ import type { Feature } from '../../../domain/generated/output.js';
15
+ import type { IFeatureRepository } from '../../ports/output/repositories/feature-repository.interface.js';
16
+ import type { IWorktreeService } from '../../ports/output/services/worktree-service.interface.js';
17
+ import type { IFeatureAgentProcessService } from '../../ports/output/agents/feature-agent-process.interface.js';
18
+ import type { IAgentRunRepository } from '../../ports/output/agents/agent-run-repository.interface.js';
19
+ export declare class DeleteFeatureUseCase {
20
+ private readonly featureRepo;
21
+ private readonly worktreeService;
22
+ private readonly processService;
23
+ private readonly runRepo;
24
+ constructor(featureRepo: IFeatureRepository, worktreeService: IWorktreeService, processService: IFeatureAgentProcessService, runRepo: IAgentRunRepository);
25
+ execute(featureId: string): Promise<Feature>;
26
+ }
27
+ //# sourceMappingURL=delete-feature.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-feature.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/features/delete-feature.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8DAA8D,CAAC;AAChH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAEvG,qBACa,oBAAoB;IAEC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAE5D,OAAO,CAAC,QAAQ,CAAC,cAAc;IACA,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAJR,WAAW,EAAE,kBAAkB,EACjC,eAAe,EAAE,gBAAgB,EAE7D,cAAc,EAAE,2BAA2B,EACZ,OAAO,EAAE,mBAAmB;IAGxE,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAyCnD"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Delete Feature Use Case
3
+ *
4
+ * Orchestrates feature deletion including:
5
+ * - Cancelling any running/pending agent runs
6
+ * - Removing the git worktree
7
+ * - Deleting the feature record
8
+ *
9
+ * Business Rules:
10
+ * - Throws if the feature does not exist
11
+ * - Cancels running/pending agent runs before deletion
12
+ * - Gracefully handles worktree removal failures
13
+ */
14
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19
+ };
20
+ var __metadata = (this && this.__metadata) || function (k, v) {
21
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
+ };
23
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
24
+ return function (target, key) { decorator(target, key, paramIndex); }
25
+ };
26
+ import { injectable, inject } from 'tsyringe';
27
+ import { AgentRunStatus } from '../../../domain/generated/output.js';
28
+ let DeleteFeatureUseCase = class DeleteFeatureUseCase {
29
+ featureRepo;
30
+ worktreeService;
31
+ processService;
32
+ runRepo;
33
+ constructor(featureRepo, worktreeService, processService, runRepo) {
34
+ this.featureRepo = featureRepo;
35
+ this.worktreeService = worktreeService;
36
+ this.processService = processService;
37
+ this.runRepo = runRepo;
38
+ }
39
+ async execute(featureId) {
40
+ // 1. Find feature (exact or prefix match)
41
+ const feature = (await this.featureRepo.findById(featureId)) ??
42
+ (await this.featureRepo.findByIdPrefix(featureId));
43
+ if (!feature) {
44
+ throw new Error(`Feature not found: "${featureId}"`);
45
+ }
46
+ // 2. Cancel running/pending agent run if present
47
+ if (feature.agentRunId) {
48
+ const run = await this.runRepo.findById(feature.agentRunId);
49
+ if (run && (run.status === AgentRunStatus.running || run.status === AgentRunStatus.pending)) {
50
+ // Kill the OS process if still alive
51
+ if (run.pid && this.processService.isAlive(run.pid)) {
52
+ try {
53
+ process.kill(run.pid);
54
+ }
55
+ catch {
56
+ // Process may have already exited
57
+ }
58
+ }
59
+ await this.runRepo.updateStatus(run.id, AgentRunStatus.cancelled);
60
+ }
61
+ }
62
+ // 3. Remove worktree (ignore errors if already removed)
63
+ const worktreePath = this.worktreeService.getWorktreePath(feature.repositoryPath, feature.branch);
64
+ try {
65
+ await this.worktreeService.remove(worktreePath);
66
+ }
67
+ catch {
68
+ // Worktree might already be removed - that's fine
69
+ }
70
+ // 4. Delete feature record
71
+ await this.featureRepo.delete(feature.id);
72
+ return feature;
73
+ }
74
+ };
75
+ DeleteFeatureUseCase = __decorate([
76
+ injectable(),
77
+ __param(0, inject('IFeatureRepository')),
78
+ __param(1, inject('IWorktreeService')),
79
+ __param(2, inject('IFeatureAgentProcessService')),
80
+ __param(3, inject('IAgentRunRepository')),
81
+ __metadata("design:paramtypes", [Object, Object, Object, Object])
82
+ ], DeleteFeatureUseCase);
83
+ export { DeleteFeatureUseCase };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * List Features Use Case
3
+ *
4
+ * Retrieves features with optional filtering by repository path or lifecycle.
5
+ *
6
+ * Business Rules:
7
+ * - Returns all features when no filters are provided
8
+ * - Filters are passed through to the repository
9
+ */
10
+ import type { Feature } from '../../../domain/generated/output.js';
11
+ import type { IFeatureRepository, FeatureListFilters } from '../../ports/output/repositories/feature-repository.interface.js';
12
+ export declare class ListFeaturesUseCase {
13
+ private readonly featureRepo;
14
+ constructor(featureRepo: IFeatureRepository);
15
+ execute(filters?: FeatureListFilters): Promise<Feature[]>;
16
+ }
17
+ //# sourceMappingURL=list-features.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-features.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/features/list-features.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AAEzE,qBACa,mBAAmB;IAG5B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAG5C,OAAO,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAGhE"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * List Features Use Case
3
+ *
4
+ * Retrieves features with optional filtering by repository path or lifecycle.
5
+ *
6
+ * Business Rules:
7
+ * - Returns all features when no filters are provided
8
+ * - Filters are passed through to the repository
9
+ */
10
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
16
+ var __metadata = (this && this.__metadata) || function (k, v) {
17
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
+ };
19
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
20
+ return function (target, key) { decorator(target, key, paramIndex); }
21
+ };
22
+ import { injectable, inject } from 'tsyringe';
23
+ let ListFeaturesUseCase = class ListFeaturesUseCase {
24
+ featureRepo;
25
+ constructor(featureRepo) {
26
+ this.featureRepo = featureRepo;
27
+ }
28
+ async execute(filters) {
29
+ return this.featureRepo.list(filters);
30
+ }
31
+ };
32
+ ListFeaturesUseCase = __decorate([
33
+ injectable(),
34
+ __param(0, inject('IFeatureRepository')),
35
+ __metadata("design:paramtypes", [Object])
36
+ ], ListFeaturesUseCase);
37
+ export { ListFeaturesUseCase };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Resume Feature Use Case
3
+ *
4
+ * Resumes an interrupted, failed, or waiting_approval feature agent run.
5
+ * Creates a new AgentRun record and spawns a worker with --resume flag.
6
+ */
7
+ import type { Feature, AgentRun } from '../../../domain/generated/output.js';
8
+ import type { IFeatureRepository } from '../../ports/output/repositories/feature-repository.interface.js';
9
+ import type { IAgentRunRepository } from '../../ports/output/agents/agent-run-repository.interface.js';
10
+ import type { IFeatureAgentProcessService } from '../../ports/output/agents/feature-agent-process.interface.js';
11
+ import type { IWorktreeService } from '../../ports/output/services/worktree-service.interface.js';
12
+ export interface ResumeFeatureResult {
13
+ feature: Feature;
14
+ newRun: AgentRun;
15
+ }
16
+ export declare class ResumeFeatureUseCase {
17
+ private readonly featureRepo;
18
+ private readonly runRepo;
19
+ private readonly processService;
20
+ private readonly worktreeService;
21
+ constructor(featureRepo: IFeatureRepository, runRepo: IAgentRunRepository, processService: IFeatureAgentProcessService, worktreeService: IWorktreeService);
22
+ execute(featureId: string): Promise<ResumeFeatureResult>;
23
+ }
24
+ //# sourceMappingURL=resume-feature.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume-feature.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/features/resume-feature.use-case.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8DAA8D,CAAC;AAChH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAQlG,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED,qBACa,oBAAoB;IAG7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAExB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBANf,WAAW,EAAE,kBAAkB,EAE/B,OAAO,EAAE,mBAAmB,EAE5B,cAAc,EAAE,2BAA2B,EAE3C,eAAe,EAAE,gBAAgB;IAG9C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAwE/D"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Resume Feature Use Case
3
+ *
4
+ * Resumes an interrupted, failed, or waiting_approval feature agent run.
5
+ * Creates a new AgentRun record and spawns a worker with --resume flag.
6
+ */
7
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
13
+ var __metadata = (this && this.__metadata) || function (k, v) {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ };
16
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
17
+ return function (target, key) { decorator(target, key, paramIndex); }
18
+ };
19
+ import { injectable, inject } from 'tsyringe';
20
+ import { randomUUID } from 'node:crypto';
21
+ import { AgentRunStatus } from '../../../domain/generated/output.js';
22
+ const RESUMABLE_STATUSES = new Set([
23
+ AgentRunStatus.interrupted,
24
+ AgentRunStatus.failed,
25
+ AgentRunStatus.waitingApproval,
26
+ ]);
27
+ let ResumeFeatureUseCase = class ResumeFeatureUseCase {
28
+ featureRepo;
29
+ runRepo;
30
+ processService;
31
+ worktreeService;
32
+ constructor(featureRepo, runRepo, processService, worktreeService) {
33
+ this.featureRepo = featureRepo;
34
+ this.runRepo = runRepo;
35
+ this.processService = processService;
36
+ this.worktreeService = worktreeService;
37
+ }
38
+ async execute(featureId) {
39
+ // Resolve feature by exact ID or prefix
40
+ const feature = (await this.featureRepo.findById(featureId)) ??
41
+ (await this.featureRepo.findByIdPrefix(featureId));
42
+ if (!feature) {
43
+ throw new Error(`Feature not found: ${featureId}`);
44
+ }
45
+ // Load the most recent agent run
46
+ if (!feature.agentRunId) {
47
+ throw new Error(`No agent run found for feature "${feature.name}"`);
48
+ }
49
+ const lastRun = await this.runRepo.findById(feature.agentRunId);
50
+ if (!lastRun) {
51
+ throw new Error(`No agent run found for feature "${feature.name}"`);
52
+ }
53
+ // Validate the run is in a resumable state
54
+ if (lastRun.status === AgentRunStatus.running) {
55
+ throw new Error('Agent is still running — stop it first before resuming');
56
+ }
57
+ if (lastRun.status === AgentRunStatus.completed) {
58
+ throw new Error('Agent already completed successfully');
59
+ }
60
+ if (!RESUMABLE_STATUSES.has(lastRun.status)) {
61
+ throw new Error(`Agent run is not in a resumable state (status: ${lastRun.status})`);
62
+ }
63
+ // Create a new agent run record that continues the same thread
64
+ const now = new Date();
65
+ const newRunId = randomUUID();
66
+ const newRun = {
67
+ id: newRunId,
68
+ agentType: lastRun.agentType,
69
+ agentName: lastRun.agentName,
70
+ status: AgentRunStatus.pending,
71
+ prompt: lastRun.prompt,
72
+ threadId: lastRun.threadId, // Same thread for checkpoint continuity
73
+ featureId: feature.id,
74
+ repositoryPath: feature.repositoryPath,
75
+ approvalMode: lastRun.approvalMode,
76
+ createdAt: now,
77
+ updatedAt: now,
78
+ };
79
+ await this.runRepo.create(newRun);
80
+ // Update feature to reference the new run
81
+ await this.featureRepo.update({
82
+ ...feature,
83
+ agentRunId: newRunId,
84
+ updatedAt: now,
85
+ });
86
+ // Derive worktree path and spawn resume worker
87
+ const worktreePath = this.worktreeService.getWorktreePath(feature.repositoryPath, feature.branch);
88
+ this.processService.spawn(feature.id, newRunId, feature.repositoryPath, worktreePath, worktreePath, { resume: true, approvalMode: lastRun.approvalMode });
89
+ return { feature, newRun };
90
+ }
91
+ };
92
+ ResumeFeatureUseCase = __decorate([
93
+ injectable(),
94
+ __param(0, inject('IFeatureRepository')),
95
+ __param(1, inject('IAgentRunRepository')),
96
+ __param(2, inject('IFeatureAgentProcessService')),
97
+ __param(3, inject('IWorktreeService')),
98
+ __metadata("design:paramtypes", [Object, Object, Object, Object])
99
+ ], ResumeFeatureUseCase);
100
+ export { ResumeFeatureUseCase };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Show Feature Use Case
3
+ *
4
+ * Retrieves a single feature by its ID.
5
+ *
6
+ * Business Rules:
7
+ * - Throws if the feature does not exist
8
+ * - Error message includes the requested ID for debugging
9
+ */
10
+ import type { Feature } from '../../../domain/generated/output.js';
11
+ import type { IFeatureRepository } from '../../ports/output/repositories/feature-repository.interface.js';
12
+ export declare class ShowFeatureUseCase {
13
+ private readonly featureRepo;
14
+ constructor(featureRepo: IFeatureRepository);
15
+ execute(featureId: string): Promise<Feature>;
16
+ }
17
+ //# sourceMappingURL=show-feature.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-feature.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/features/show-feature.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAE1G,qBACa,kBAAkB;IAG3B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAG5C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAUnD"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Show Feature Use Case
3
+ *
4
+ * Retrieves a single feature by its ID.
5
+ *
6
+ * Business Rules:
7
+ * - Throws if the feature does not exist
8
+ * - Error message includes the requested ID for debugging
9
+ */
10
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
16
+ var __metadata = (this && this.__metadata) || function (k, v) {
17
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
+ };
19
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
20
+ return function (target, key) { decorator(target, key, paramIndex); }
21
+ };
22
+ import { injectable, inject } from 'tsyringe';
23
+ let ShowFeatureUseCase = class ShowFeatureUseCase {
24
+ featureRepo;
25
+ constructor(featureRepo) {
26
+ this.featureRepo = featureRepo;
27
+ }
28
+ async execute(featureId) {
29
+ // Try exact match first, then prefix match for short IDs (e.g. from `feat ls`)
30
+ const feature = (await this.featureRepo.findById(featureId)) ??
31
+ (await this.featureRepo.findByIdPrefix(featureId));
32
+ if (!feature) {
33
+ throw new Error(`Feature not found: "${featureId}"`);
34
+ }
35
+ return feature;
36
+ }
37
+ };
38
+ ShowFeatureUseCase = __decorate([
39
+ injectable(),
40
+ __param(0, inject('IFeatureRepository')),
41
+ __metadata("design:paramtypes", [Object])
42
+ ], ShowFeatureUseCase);
43
+ export { ShowFeatureUseCase };
@@ -10,7 +10,7 @@
10
10
  * - Idempotent: safe to call multiple times
11
11
  */
12
12
  import type { Settings } from '../../../domain/generated/output.js';
13
- import type { ISettingsRepository } from '../../ports/output/settings.repository.interface.js';
13
+ import type { ISettingsRepository } from '../../ports/output/repositories/settings.repository.interface.js';
14
14
  /**
15
15
  * Use case for initializing global settings.
16
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"initialize-settings.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/settings/initialize-settings.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAG/F;;;;;;;;GAQG;AACH,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;CAgBnC"}
1
+ {"version":3,"file":"initialize-settings.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/settings/initialize-settings.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAG5G;;;;;;;;GAQG;AACH,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;CAgBnC"}
@@ -10,7 +10,7 @@
10
10
  * - Read-only operation (no mutations)
11
11
  */
12
12
  import type { Settings } from '../../../domain/generated/output.js';
13
- import type { ISettingsRepository } from '../../ports/output/settings.repository.interface.js';
13
+ import type { ISettingsRepository } from '../../ports/output/repositories/settings.repository.interface.js';
14
14
  /**
15
15
  * Use case for loading existing settings.
16
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"load-settings.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/settings/load-settings.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAE/F;;;;;;;GAOG;AACH,qBACa,mBAAmB;IAG5B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;CASnC"}
1
+ {"version":3,"file":"load-settings.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/settings/load-settings.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAE5G;;;;;;;GAOG;AACH,qBACa,mBAAmB;IAG5B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;CASnC"}
@@ -10,7 +10,7 @@
10
10
  * - Returns updated settings after persistence
11
11
  */
12
12
  import type { Settings } from '../../../domain/generated/output.js';
13
- import type { ISettingsRepository } from '../../ports/output/settings.repository.interface.js';
13
+ import type { ISettingsRepository } from '../../ports/output/repositories/settings.repository.interface.js';
14
14
  /**
15
15
  * Use case for updating existing settings.
16
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"update-settings.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/settings/update-settings.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAE/F;;;;;;;GAOG;AACH,qBACa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;;OAKG;IACG,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CAOrD"}
1
+ {"version":3,"file":"update-settings.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/settings/update-settings.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAE5G;;;;;;;GAOG;AACH,qBACa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;;OAKG;IACG,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CAOrD"}
@@ -525,6 +525,14 @@ export type Feature = BaseEntity & {
525
525
  * Generated documents and artifacts attached to this feature
526
526
  */
527
527
  relatedArtifacts: Artifact[];
528
+ /**
529
+ * Associated agent run ID for process tracking (optional)
530
+ */
531
+ agentRunId?: string;
532
+ /**
533
+ * Absolute path to the feature spec directory inside the worktree
534
+ */
535
+ specPath?: string;
528
536
  };
529
537
  /**
530
538
  * Open question that may need resolution before implementation
@@ -945,7 +953,8 @@ export declare enum AgentRunStatus {
945
953
  completed = "completed",
946
954
  failed = "failed",
947
955
  interrupted = "interrupted",
948
- cancelled = "cancelled"
956
+ cancelled = "cancelled",
957
+ waitingApproval = "waiting_approval"
949
958
  }
950
959
  /**
951
960
  * Agent execution run record
@@ -999,6 +1008,22 @@ export type AgentRun = BaseEntity & {
999
1008
  * Error message if execution failed (optional)
1000
1009
  */
1001
1010
  error?: string;
1011
+ /**
1012
+ * Associated feature ID for feature agent runs (optional)
1013
+ */
1014
+ featureId?: string;
1015
+ /**
1016
+ * Repository path for context scoping (optional)
1017
+ */
1018
+ repositoryPath?: string;
1019
+ /**
1020
+ * Approval mode for human-in-the-loop: interactive, allow-prd, allow-plan, allow-all (optional)
1021
+ */
1022
+ approvalMode?: string;
1023
+ /**
1024
+ * Current approval status: pending, waiting, approved, rejected (optional)
1025
+ */
1026
+ approvalStatus?: string;
1002
1027
  };
1003
1028
  /**
1004
1029
  * Streaming event emitted during agent execution