@shepai/cli 1.14.1 → 1.15.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 (283) hide show
  1. package/README.md +191 -101
  2. package/dist/eslint.config.mjs +2 -0
  3. package/dist/src/application/ports/output/external-issue-fetcher.interface.d.ts +69 -0
  4. package/dist/src/application/ports/output/external-issue-fetcher.interface.d.ts.map +1 -0
  5. package/dist/src/application/ports/output/external-issue-fetcher.interface.js +46 -0
  6. package/dist/src/application/ports/output/feature-agent-process.interface.d.ts +44 -0
  7. package/dist/src/application/ports/output/feature-agent-process.interface.d.ts.map +1 -0
  8. package/dist/src/application/ports/output/feature-agent-process.interface.js +12 -0
  9. package/dist/src/application/ports/output/feature-repository.interface.d.ts +76 -0
  10. package/dist/src/application/ports/output/feature-repository.interface.d.ts.map +1 -0
  11. package/dist/src/application/ports/output/feature-repository.interface.js +11 -0
  12. package/dist/src/application/ports/output/index.d.ts +3 -0
  13. package/dist/src/application/ports/output/index.d.ts.map +1 -1
  14. package/dist/src/application/ports/output/index.js +1 -1
  15. package/dist/src/application/ports/output/spec-initializer.interface.d.ts +33 -0
  16. package/dist/src/application/ports/output/spec-initializer.interface.d.ts.map +1 -0
  17. package/dist/src/application/ports/output/spec-initializer.interface.js +8 -0
  18. package/dist/src/application/ports/output/worktree-service.interface.d.ts +83 -0
  19. package/dist/src/application/ports/output/worktree-service.interface.d.ts.map +1 -0
  20. package/dist/src/application/ports/output/worktree-service.interface.js +30 -0
  21. package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts +22 -0
  22. package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -0
  23. package/dist/src/application/use-cases/agents/approve-agent-run.use-case.js +67 -0
  24. package/dist/src/application/use-cases/agents/delete-agent-run.use-case.d.ts +16 -0
  25. package/dist/src/application/use-cases/agents/delete-agent-run.use-case.d.ts.map +1 -0
  26. package/dist/src/application/use-cases/agents/delete-agent-run.use-case.js +46 -0
  27. package/dist/src/application/use-cases/agents/get-agent-run.use-case.d.ts +22 -0
  28. package/dist/src/application/use-cases/agents/get-agent-run.use-case.d.ts.map +1 -0
  29. package/dist/src/application/use-cases/agents/get-agent-run.use-case.js +42 -0
  30. package/dist/src/application/use-cases/agents/list-agent-runs.use-case.d.ts +21 -0
  31. package/dist/src/application/use-cases/agents/list-agent-runs.use-case.d.ts.map +1 -0
  32. package/dist/src/application/use-cases/agents/list-agent-runs.use-case.js +54 -0
  33. package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts +16 -0
  34. package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -0
  35. package/dist/src/application/use-cases/agents/reject-agent-run.use-case.js +52 -0
  36. package/dist/src/application/use-cases/agents/show-agent-run.use-case.d.ts +24 -0
  37. package/dist/src/application/use-cases/agents/show-agent-run.use-case.d.ts.map +1 -0
  38. package/dist/src/application/use-cases/agents/show-agent-run.use-case.js +52 -0
  39. package/dist/src/application/use-cases/agents/stop-agent-run.use-case.d.ts +15 -0
  40. package/dist/src/application/use-cases/agents/stop-agent-run.use-case.d.ts.map +1 -0
  41. package/dist/src/application/use-cases/agents/stop-agent-run.use-case.js +86 -0
  42. package/dist/src/application/use-cases/features/create-feature.use-case.d.ts +43 -0
  43. package/dist/src/application/use-cases/features/create-feature.use-case.d.ts.map +1 -0
  44. package/dist/src/application/use-cases/features/create-feature.use-case.js +166 -0
  45. package/dist/src/application/use-cases/features/delete-feature.use-case.d.ts +27 -0
  46. package/dist/src/application/use-cases/features/delete-feature.use-case.d.ts.map +1 -0
  47. package/dist/src/application/use-cases/features/delete-feature.use-case.js +83 -0
  48. package/dist/src/application/use-cases/features/list-features.use-case.d.ts +17 -0
  49. package/dist/src/application/use-cases/features/list-features.use-case.d.ts.map +1 -0
  50. package/dist/src/application/use-cases/features/list-features.use-case.js +37 -0
  51. package/dist/src/application/use-cases/features/resume-feature.use-case.d.ts +24 -0
  52. package/dist/src/application/use-cases/features/resume-feature.use-case.d.ts.map +1 -0
  53. package/dist/src/application/use-cases/features/resume-feature.use-case.js +100 -0
  54. package/dist/src/application/use-cases/features/show-feature.use-case.d.ts +17 -0
  55. package/dist/src/application/use-cases/features/show-feature.use-case.d.ts.map +1 -0
  56. package/dist/src/application/use-cases/features/show-feature.use-case.js +43 -0
  57. package/dist/src/domain/generated/output.d.ts +26 -1
  58. package/dist/src/domain/generated/output.d.ts.map +1 -1
  59. package/dist/src/domain/generated/output.js +1 -0
  60. package/dist/src/infrastructure/di/container.d.ts.map +1 -1
  61. package/dist/src/infrastructure/di/container.js +64 -14
  62. package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts +4 -0
  63. package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts.map +1 -1
  64. package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.js +8 -0
  65. package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +50 -0
  66. package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts.map +1 -0
  67. package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.js +62 -0
  68. package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
  69. package/dist/src/infrastructure/persistence/sqlite/migrations.js +49 -0
  70. package/dist/src/infrastructure/repositories/agent-run.repository.d.ts.map +1 -1
  71. package/dist/src/infrastructure/repositories/agent-run.repository.js +30 -8
  72. package/dist/src/infrastructure/repositories/sqlite-feature.repository.d.ts +25 -0
  73. package/dist/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -0
  74. package/dist/src/infrastructure/repositories/sqlite-feature.repository.js +113 -0
  75. package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.d.ts +0 -22
  76. package/dist/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts.map +1 -0
  77. package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.js +4 -11
  78. package/dist/src/infrastructure/services/agents/analyze-repo/prompts/analyze-repository.prompt.d.ts.map +1 -0
  79. package/dist/src/infrastructure/services/agents/{agent-executor-factory.service.d.ts → common/agent-executor-factory.service.d.ts} +3 -3
  80. package/dist/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -0
  81. package/dist/src/infrastructure/services/agents/{agent-registry.service.d.ts → common/agent-registry.service.d.ts} +1 -1
  82. package/dist/src/infrastructure/services/agents/common/agent-registry.service.d.ts.map +1 -0
  83. package/dist/src/infrastructure/services/agents/{agent-registry.service.js → common/agent-registry.service.js} +7 -1
  84. package/dist/src/infrastructure/services/agents/{agent-runner.service.d.ts → common/agent-runner.service.d.ts} +5 -5
  85. package/dist/src/infrastructure/services/agents/common/agent-runner.service.d.ts.map +1 -0
  86. package/dist/src/infrastructure/services/agents/{agent-runner.service.js → common/agent-runner.service.js} +4 -4
  87. package/dist/src/infrastructure/services/agents/{agent-validator.service.d.ts → common/agent-validator.service.d.ts} +2 -2
  88. package/dist/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -0
  89. package/dist/src/infrastructure/services/agents/{langgraph → common}/checkpointer.d.ts +1 -0
  90. package/dist/src/infrastructure/services/agents/common/checkpointer.d.ts.map +1 -0
  91. package/dist/src/infrastructure/services/agents/{langgraph → common}/checkpointer.js +6 -0
  92. package/dist/src/infrastructure/services/agents/{executors → common/executors}/claude-code-executor.service.d.ts +9 -2
  93. package/dist/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -0
  94. package/dist/src/infrastructure/services/agents/{executors → common/executors}/claude-code-executor.service.js +103 -6
  95. package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts +15 -0
  96. package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts.map +1 -0
  97. package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.js +16 -0
  98. package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.d.ts +17 -0
  99. package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.d.ts.map +1 -0
  100. package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.js +49 -0
  101. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +244 -0
  102. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -0
  103. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.js +36 -0
  104. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +20 -0
  105. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -0
  106. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +90 -0
  107. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +31 -0
  108. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -0
  109. package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +236 -0
  110. package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.d.ts +19 -0
  111. package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.d.ts.map +1 -0
  112. package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.js +38 -0
  113. package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.d.ts +7 -0
  114. package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.d.ts.map +1 -0
  115. package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.js +9 -0
  116. package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts +11 -0
  117. package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts.map +1 -0
  118. package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.js +23 -0
  119. package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +40 -0
  120. package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -0
  121. package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +114 -0
  122. package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.d.ts +7 -0
  123. package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.d.ts.map +1 -0
  124. package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.js +9 -0
  125. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts +9 -0
  126. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts.map +1 -0
  127. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.js +94 -0
  128. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.d.ts +8 -0
  129. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.d.ts.map +1 -0
  130. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.js +18 -0
  131. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts +11 -0
  132. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts.map +1 -0
  133. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.js +170 -0
  134. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts +10 -0
  135. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts.map +1 -0
  136. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.js +116 -0
  137. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts +10 -0
  138. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts.map +1 -0
  139. package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.js +121 -0
  140. package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.d.ts +7 -0
  141. package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.d.ts.map +1 -0
  142. package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.js +9 -0
  143. package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.d.ts +7 -0
  144. package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.d.ts.map +1 -0
  145. package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.js +9 -0
  146. package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts +39 -0
  147. package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -0
  148. package/dist/src/infrastructure/services/agents/feature-agent/state.js +27 -0
  149. package/dist/src/infrastructure/services/external/github-issue.service.d.ts +19 -0
  150. package/dist/src/infrastructure/services/external/github-issue.service.d.ts.map +1 -0
  151. package/dist/src/infrastructure/services/external/github-issue.service.js +59 -0
  152. package/dist/src/infrastructure/services/external/jira-ticket.service.d.ts +23 -0
  153. package/dist/src/infrastructure/services/external/jira-ticket.service.d.ts.map +1 -0
  154. package/dist/src/infrastructure/services/external/jira-ticket.service.js +57 -0
  155. package/dist/src/infrastructure/services/git/worktree.service.d.ts +28 -0
  156. package/dist/src/infrastructure/services/git/worktree.service.d.ts.map +1 -0
  157. package/dist/src/infrastructure/services/git/worktree.service.js +112 -0
  158. package/dist/src/infrastructure/services/spec/spec-initializer.service.d.ts +17 -0
  159. package/dist/src/infrastructure/services/spec/spec-initializer.service.d.ts.map +1 -0
  160. package/dist/src/infrastructure/services/spec/spec-initializer.service.js +281 -0
  161. package/dist/src/presentation/cli/commands/agent/approve.command.d.ts +11 -0
  162. package/dist/src/presentation/cli/commands/agent/approve.command.d.ts.map +1 -0
  163. package/dist/src/presentation/cli/commands/agent/approve.command.js +42 -0
  164. package/dist/src/presentation/cli/commands/agent/delete.command.d.ts +11 -0
  165. package/dist/src/presentation/cli/commands/agent/delete.command.d.ts.map +1 -0
  166. package/dist/src/presentation/cli/commands/agent/delete.command.js +49 -0
  167. package/dist/src/presentation/cli/commands/agent/index.d.ts +21 -0
  168. package/dist/src/presentation/cli/commands/agent/index.d.ts.map +1 -0
  169. package/dist/src/presentation/cli/commands/agent/index.js +38 -0
  170. package/dist/src/presentation/cli/commands/agent/logs.command.d.ts +13 -0
  171. package/dist/src/presentation/cli/commands/agent/logs.command.d.ts.map +1 -0
  172. package/dist/src/presentation/cli/commands/agent/logs.command.js +163 -0
  173. package/dist/src/presentation/cli/commands/agent/ls.command.d.ts +12 -0
  174. package/dist/src/presentation/cli/commands/agent/ls.command.d.ts.map +1 -0
  175. package/dist/src/presentation/cli/commands/agent/ls.command.js +111 -0
  176. package/dist/src/presentation/cli/commands/agent/reject.command.d.ts +11 -0
  177. package/dist/src/presentation/cli/commands/agent/reject.command.d.ts.map +1 -0
  178. package/dist/src/presentation/cli/commands/agent/reject.command.js +43 -0
  179. package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts +10 -0
  180. package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts.map +1 -0
  181. package/dist/src/presentation/cli/commands/agent/resolve-run.js +27 -0
  182. package/dist/src/presentation/cli/commands/agent/show.command.d.ts +12 -0
  183. package/dist/src/presentation/cli/commands/agent/show.command.d.ts.map +1 -0
  184. package/dist/src/presentation/cli/commands/agent/show.command.js +202 -0
  185. package/dist/src/presentation/cli/commands/agent/stop.command.d.ts +11 -0
  186. package/dist/src/presentation/cli/commands/agent/stop.command.d.ts.map +1 -0
  187. package/dist/src/presentation/cli/commands/agent/stop.command.js +42 -0
  188. package/dist/src/presentation/cli/commands/feat/del.command.d.ts +17 -0
  189. package/dist/src/presentation/cli/commands/feat/del.command.d.ts.map +1 -0
  190. package/dist/src/presentation/cli/commands/feat/del.command.js +55 -0
  191. package/dist/src/presentation/cli/commands/feat/index.d.ts +17 -0
  192. package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -0
  193. package/dist/src/presentation/cli/commands/feat/index.js +29 -0
  194. package/dist/src/presentation/cli/commands/feat/ls.command.d.ts +15 -0
  195. package/dist/src/presentation/cli/commands/feat/ls.command.d.ts.map +1 -0
  196. package/dist/src/presentation/cli/commands/feat/ls.command.js +112 -0
  197. package/dist/src/presentation/cli/commands/feat/new.command.d.ts +17 -0
  198. package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -0
  199. package/dist/src/presentation/cli/commands/feat/new.command.js +64 -0
  200. package/dist/src/presentation/cli/commands/feat/resume.command.d.ts +11 -0
  201. package/dist/src/presentation/cli/commands/feat/resume.command.d.ts.map +1 -0
  202. package/dist/src/presentation/cli/commands/feat/resume.command.js +33 -0
  203. package/dist/src/presentation/cli/commands/feat/show.command.d.ts +11 -0
  204. package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -0
  205. package/dist/src/presentation/cli/commands/feat/show.command.js +128 -0
  206. package/dist/src/presentation/cli/index.d.ts +8 -4
  207. package/dist/src/presentation/cli/index.d.ts.map +1 -1
  208. package/dist/src/presentation/cli/index.js +12 -4
  209. package/dist/src/presentation/cli/ui/detail-view.d.ts +43 -0
  210. package/dist/src/presentation/cli/ui/detail-view.d.ts.map +1 -0
  211. package/dist/src/presentation/cli/ui/detail-view.js +57 -0
  212. package/dist/src/presentation/cli/ui/index.d.ts +2 -0
  213. package/dist/src/presentation/cli/ui/index.d.ts.map +1 -1
  214. package/dist/src/presentation/cli/ui/index.js +2 -0
  215. package/dist/src/presentation/cli/ui/list-view.d.ts +34 -0
  216. package/dist/src/presentation/cli/ui/list-view.d.ts.map +1 -0
  217. package/dist/src/presentation/cli/ui/list-view.js +65 -0
  218. package/dist/src/presentation/cli/ui/symbols.d.ts +5 -1
  219. package/dist/src/presentation/cli/ui/symbols.d.ts.map +1 -1
  220. package/dist/src/presentation/cli/ui/symbols.js +4 -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/build-manifest.json +2 -2
  225. package/web/.next/cache/.previewinfo +1 -1
  226. package/web/.next/cache/.rscinfo +1 -1
  227. package/web/.next/cache/config.json +3 -3
  228. package/web/.next/fallback-build-manifest.json +2 -2
  229. package/web/.next/prerender-manifest.json +3 -3
  230. package/web/.next/required-server-files.js +1 -1
  231. package/web/.next/required-server-files.json +1 -1
  232. package/web/.next/server/app/_global-error.html +2 -2
  233. package/web/.next/server/app/_global-error.rsc +1 -1
  234. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  235. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  236. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  237. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  238. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  239. package/web/.next/server/app/_not-found.html +2 -2
  240. package/web/.next/server/app/_not-found.rsc +1 -1
  241. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  242. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  243. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  244. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  245. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  246. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  247. package/web/.next/server/app/index.html +2 -2
  248. package/web/.next/server/app/index.rsc +1 -1
  249. package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  250. package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  251. package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  252. package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  253. package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  254. package/web/.next/server/app/version.html +2 -2
  255. package/web/.next/server/app/version.rsc +1 -1
  256. package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
  257. package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
  258. package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
  259. package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
  260. package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
  261. package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
  262. package/web/.next/server/chunks/ssr/_19be0743._.js +1 -1
  263. package/web/.next/server/pages/404.html +2 -2
  264. package/web/.next/server/pages/500.html +2 -2
  265. package/web/.next/server/server-reference-manifest.js +1 -1
  266. package/web/.next/server/server-reference-manifest.json +1 -1
  267. package/web/.next/trace +1 -1
  268. package/web/.next/trace-build +1 -1
  269. package/dist/src/infrastructure/services/agents/agent-executor-factory.service.d.ts.map +0 -1
  270. package/dist/src/infrastructure/services/agents/agent-registry.service.d.ts.map +0 -1
  271. package/dist/src/infrastructure/services/agents/agent-runner.service.d.ts.map +0 -1
  272. package/dist/src/infrastructure/services/agents/agent-validator.service.d.ts.map +0 -1
  273. package/dist/src/infrastructure/services/agents/executors/claude-code-executor.service.d.ts.map +0 -1
  274. package/dist/src/infrastructure/services/agents/langgraph/analyze-repository-graph.d.ts.map +0 -1
  275. package/dist/src/infrastructure/services/agents/langgraph/checkpointer.d.ts.map +0 -1
  276. package/dist/src/infrastructure/services/agents/langgraph/prompts/analyze-repository.prompt.d.ts.map +0 -1
  277. /package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/prompts/analyze-repository.prompt.d.ts +0 -0
  278. /package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/prompts/analyze-repository.prompt.js +0 -0
  279. /package/dist/src/infrastructure/services/agents/{agent-executor-factory.service.js → common/agent-executor-factory.service.js} +0 -0
  280. /package/dist/src/infrastructure/services/agents/{agent-validator.service.js → common/agent-validator.service.js} +0 -0
  281. /package/web/.next/static/{ozzHAkZyxX7nXyxpqufBs → XV-wYY85Xk9ANCuQDQ6_H}/_buildManifest.js +0 -0
  282. /package/web/.next/static/{ozzHAkZyxX7nXyxpqufBs → XV-wYY85Xk9ANCuQDQ6_H}/_clientMiddlewareManifest.json +0 -0
  283. /package/web/.next/static/{ozzHAkZyxX7nXyxpqufBs → XV-wYY85Xk9ANCuQDQ6_H}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACnF,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACjF,YAAY,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChG,YAAY,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACnF,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACjF,YAAY,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChG,YAAY,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC"}
@@ -4,4 +4,4 @@
4
4
  * Exports repository interfaces (output ports) for the Application layer.
5
5
  * Infrastructure layer provides concrete implementations.
6
6
  */
7
- export {};
7
+ export { WorktreeError, WorktreeErrorCode } from './worktree-service.interface.js';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Spec Initializer Service Interface
3
+ *
4
+ * Output port for initializing feature specification directories.
5
+ * Creates the spec YAML files (spec.yaml, research.yaml, plan.yaml,
6
+ * tasks.yaml, feature.yaml) using the same templates as /shep-kit:new-feature.
7
+ */
8
+ export interface SpecInitializerResult {
9
+ /** Absolute path to the created spec directory */
10
+ specDir: string;
11
+ /** Zero-padded 3-digit feature number used */
12
+ featureNumber: string;
13
+ }
14
+ export interface ISpecInitializerService {
15
+ /**
16
+ * Initialize a spec directory with template YAML files.
17
+ *
18
+ * Creates specs/NNN-SLUG/ inside the given base directory with:
19
+ * - spec.yaml
20
+ * - research.yaml
21
+ * - plan.yaml
22
+ * - tasks.yaml
23
+ * - feature.yaml
24
+ *
25
+ * @param basePath - Directory to create specs/ in (typically the worktree path)
26
+ * @param slug - Feature slug (kebab-case, e.g., "user-authentication")
27
+ * @param featureNumber - Sequential feature number (will be zero-padded to 3 digits)
28
+ * @param description - Feature description for template substitution
29
+ * @returns The spec directory path and feature number used
30
+ */
31
+ initialize(basePath: string, slug: string, featureNumber: number, description: string): Promise<SpecInitializerResult>;
32
+ }
33
+ //# sourceMappingURL=spec-initializer.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-initializer.interface.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/spec-initializer.interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,qBAAqB;IACpC,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CACR,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Spec Initializer Service Interface
3
+ *
4
+ * Output port for initializing feature specification directories.
5
+ * Creates the spec YAML files (spec.yaml, research.yaml, plan.yaml,
6
+ * tasks.yaml, feature.yaml) using the same templates as /shep-kit:new-feature.
7
+ */
8
+ export {};
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Worktree Service Interface
3
+ *
4
+ * Output port for git worktree operations.
5
+ * Implementations manage git worktree creation, removal, and listing.
6
+ */
7
+ /**
8
+ * Information about a git worktree.
9
+ */
10
+ export interface WorktreeInfo {
11
+ /** Absolute path to the worktree directory */
12
+ path: string;
13
+ /** HEAD commit hash */
14
+ head: string;
15
+ /** Branch name (empty for detached HEAD) */
16
+ branch: string;
17
+ /** Whether this is the main worktree */
18
+ isMain: boolean;
19
+ }
20
+ /**
21
+ * Error codes for worktree operations.
22
+ */
23
+ export declare enum WorktreeErrorCode {
24
+ ALREADY_EXISTS = "ALREADY_EXISTS",
25
+ BRANCH_IN_USE = "BRANCH_IN_USE",
26
+ NOT_FOUND = "NOT_FOUND",
27
+ DIRTY_WORKTREE = "DIRTY_WORKTREE",
28
+ GIT_ERROR = "GIT_ERROR"
29
+ }
30
+ /**
31
+ * Typed error for worktree operations.
32
+ */
33
+ export declare class WorktreeError extends Error {
34
+ readonly code: WorktreeErrorCode;
35
+ readonly cause?: Error | undefined;
36
+ constructor(message: string, code: WorktreeErrorCode, cause?: Error | undefined);
37
+ }
38
+ /**
39
+ * Service interface for git worktree management.
40
+ */
41
+ export interface IWorktreeService {
42
+ /**
43
+ * Create a new worktree with a new branch.
44
+ *
45
+ * @param repoPath - Path to the git repository
46
+ * @param branch - Branch name to create
47
+ * @param worktreePath - Path for the new worktree directory
48
+ * @returns Information about the created worktree
49
+ * @throws WorktreeError with appropriate code
50
+ */
51
+ create(repoPath: string, branch: string, worktreePath: string): Promise<WorktreeInfo>;
52
+ /**
53
+ * Remove an existing worktree.
54
+ *
55
+ * @param worktreePath - Path to the worktree to remove
56
+ * @throws WorktreeError if worktree not found or has uncommitted changes
57
+ */
58
+ remove(worktreePath: string): Promise<void>;
59
+ /**
60
+ * List all worktrees in a repository.
61
+ *
62
+ * @param repoPath - Path to the git repository
63
+ * @returns Array of worktree information
64
+ */
65
+ list(repoPath: string): Promise<WorktreeInfo[]>;
66
+ /**
67
+ * Check if a worktree for a branch already exists.
68
+ *
69
+ * @param repoPath - Path to the git repository
70
+ * @param branch - Branch name to check
71
+ * @returns True if a worktree for this branch exists
72
+ */
73
+ exists(repoPath: string, branch: string): Promise<boolean>;
74
+ /**
75
+ * Get the conventional worktree path for a branch.
76
+ *
77
+ * @param repoPath - Path to the git repository
78
+ * @param branch - Branch name
79
+ * @returns Computed worktree path (e.g., /repo/.worktrees/branch-name)
80
+ */
81
+ getWorktreePath(repoPath: string, branch: string): string;
82
+ }
83
+ //# sourceMappingURL=worktree-service.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-service.interface.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/worktree-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,SAAS,cAAc;CACxB;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;aAGpB,IAAI,EAAE,iBAAiB;aACvB,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,iBAAiB,EACvB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAEtF;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAEhD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3D;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Worktree Service Interface
3
+ *
4
+ * Output port for git worktree operations.
5
+ * Implementations manage git worktree creation, removal, and listing.
6
+ */
7
+ /**
8
+ * Error codes for worktree operations.
9
+ */
10
+ export var WorktreeErrorCode;
11
+ (function (WorktreeErrorCode) {
12
+ WorktreeErrorCode["ALREADY_EXISTS"] = "ALREADY_EXISTS";
13
+ WorktreeErrorCode["BRANCH_IN_USE"] = "BRANCH_IN_USE";
14
+ WorktreeErrorCode["NOT_FOUND"] = "NOT_FOUND";
15
+ WorktreeErrorCode["DIRTY_WORKTREE"] = "DIRTY_WORKTREE";
16
+ WorktreeErrorCode["GIT_ERROR"] = "GIT_ERROR";
17
+ })(WorktreeErrorCode || (WorktreeErrorCode = {}));
18
+ /**
19
+ * Typed error for worktree operations.
20
+ */
21
+ export class WorktreeError extends Error {
22
+ code;
23
+ cause;
24
+ constructor(message, code, cause) {
25
+ super(message);
26
+ this.code = code;
27
+ this.cause = cause;
28
+ this.name = 'WorktreeError';
29
+ }
30
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Approve Agent Run Use Case
3
+ *
4
+ * Approves a paused agent run (waiting_approval status) and
5
+ * spawns a new resume worker to continue graph execution.
6
+ */
7
+ import type { IAgentRunRepository } from '../../ports/output/agent-run-repository.interface.js';
8
+ import type { IFeatureAgentProcessService } from '../../ports/output/feature-agent-process.interface.js';
9
+ import type { IFeatureRepository } from '../../ports/output/feature-repository.interface.js';
10
+ import type { IWorktreeService } from '../../ports/output/worktree-service.interface.js';
11
+ export declare class ApproveAgentRunUseCase {
12
+ private readonly agentRunRepository;
13
+ private readonly processService;
14
+ private readonly featureRepository;
15
+ private readonly worktreeService;
16
+ constructor(agentRunRepository: IAgentRunRepository, processService: IFeatureAgentProcessService, featureRepository: IFeatureRepository, worktreeService: IWorktreeService);
17
+ execute(id: string): Promise<{
18
+ approved: boolean;
19
+ reason: string;
20
+ }>;
21
+ }
22
+ //# sourceMappingURL=approve-agent-run.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve-agent-run.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/agents/approve-agent-run.use-case.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAGzF,qBACa,sBAAsB;IAG/B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAEnC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAElC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBANf,kBAAkB,EAAE,mBAAmB,EAEvC,cAAc,EAAE,2BAA2B,EAE3C,iBAAiB,EAAE,kBAAkB,EAErC,eAAe,EAAE,gBAAgB;IAG9C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAsC1E"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Approve Agent Run Use Case
3
+ *
4
+ * Approves a paused agent run (waiting_approval status) and
5
+ * spawns a new resume worker to continue graph execution.
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 { AgentRunStatus } from '../../../domain/generated/output.js';
21
+ let ApproveAgentRunUseCase = class ApproveAgentRunUseCase {
22
+ agentRunRepository;
23
+ processService;
24
+ featureRepository;
25
+ worktreeService;
26
+ constructor(agentRunRepository, processService, featureRepository, worktreeService) {
27
+ this.agentRunRepository = agentRunRepository;
28
+ this.processService = processService;
29
+ this.featureRepository = featureRepository;
30
+ this.worktreeService = worktreeService;
31
+ }
32
+ async execute(id) {
33
+ const run = await this.agentRunRepository.findById(id);
34
+ if (!run) {
35
+ return { approved: false, reason: 'Agent run not found' };
36
+ }
37
+ if (run.status !== AgentRunStatus.waitingApproval) {
38
+ return {
39
+ approved: false,
40
+ reason: `Agent run is not waiting for approval (status: ${run.status})`,
41
+ };
42
+ }
43
+ // Look up the feature to get the branch for worktree path derivation
44
+ const feature = run.featureId ? await this.featureRepository.findById(run.featureId) : null;
45
+ const repoPath = run.repositoryPath ?? '';
46
+ const worktreePath = feature
47
+ ? this.worktreeService.getWorktreePath(repoPath, feature.branch)
48
+ : repoPath;
49
+ const now = new Date();
50
+ await this.agentRunRepository.updateStatus(id, AgentRunStatus.running, {
51
+ approvalStatus: 'approved',
52
+ updatedAt: now,
53
+ });
54
+ this.processService.spawn(run.featureId ?? '', id, repoPath, worktreePath, // specDir = worktree path (same as initial spawn)
55
+ worktreePath, { resume: true, approvalMode: run.approvalMode });
56
+ return { approved: true, reason: 'Approved and resumed' };
57
+ }
58
+ };
59
+ ApproveAgentRunUseCase = __decorate([
60
+ injectable(),
61
+ __param(0, inject('IAgentRunRepository')),
62
+ __param(1, inject('IFeatureAgentProcessService')),
63
+ __param(2, inject('IFeatureRepository')),
64
+ __param(3, inject('IWorktreeService')),
65
+ __metadata("design:paramtypes", [Object, Object, Object, Object])
66
+ ], ApproveAgentRunUseCase);
67
+ export { ApproveAgentRunUseCase };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Delete Agent Run Use Case
3
+ *
4
+ * Removes an agent run record from the database.
5
+ * Refuses to delete running agents — stop them first.
6
+ */
7
+ import type { IAgentRunRepository } from '../../ports/output/agent-run-repository.interface.js';
8
+ export declare class DeleteAgentRunUseCase {
9
+ private readonly agentRunRepository;
10
+ constructor(agentRunRepository: IAgentRunRepository);
11
+ execute(id: string): Promise<{
12
+ deleted: boolean;
13
+ reason: string;
14
+ }>;
15
+ }
16
+ //# sourceMappingURL=delete-agent-run.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-agent-run.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/agents/delete-agent-run.use-case.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAGhG,qBACa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAGpD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAgBzE"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Delete Agent Run Use Case
3
+ *
4
+ * Removes an agent run record from the database.
5
+ * Refuses to delete running agents — stop them first.
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 { AgentRunStatus } from '../../../domain/generated/output.js';
21
+ let DeleteAgentRunUseCase = class DeleteAgentRunUseCase {
22
+ agentRunRepository;
23
+ constructor(agentRunRepository) {
24
+ this.agentRunRepository = agentRunRepository;
25
+ }
26
+ async execute(id) {
27
+ const run = await this.agentRunRepository.findById(id);
28
+ if (!run) {
29
+ return { deleted: false, reason: 'Agent run not found' };
30
+ }
31
+ if (run.status === AgentRunStatus.running) {
32
+ return {
33
+ deleted: false,
34
+ reason: `Cannot delete a running agent. Stop it first with: shep agent stop ${id.substring(0, 8)}`,
35
+ };
36
+ }
37
+ await this.agentRunRepository.delete(id);
38
+ return { deleted: true, reason: 'Agent run deleted' };
39
+ }
40
+ };
41
+ DeleteAgentRunUseCase = __decorate([
42
+ injectable(),
43
+ __param(0, inject('IAgentRunRepository')),
44
+ __metadata("design:paramtypes", [Object])
45
+ ], DeleteAgentRunUseCase);
46
+ export { DeleteAgentRunUseCase };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Get Agent Run Use Case
3
+ *
4
+ * Retrieves agent run details by ID for display purposes.
5
+ */
6
+ import type { AgentRun } from '../../../domain/generated/output.js';
7
+ import type { IAgentRunRepository } from '../../ports/output/agent-run-repository.interface.js';
8
+ /**
9
+ * Use case for getting a specific agent run by ID.
10
+ */
11
+ export declare class GetAgentRunUseCase {
12
+ private readonly agentRunRepository;
13
+ constructor(agentRunRepository: IAgentRunRepository);
14
+ /**
15
+ * Get an agent run by ID.
16
+ *
17
+ * @param id - The agent run ID
18
+ * @returns The agent run or null if not found
19
+ */
20
+ execute(id: string): Promise<AgentRun | null>;
21
+ }
22
+ //# sourceMappingURL=get-agent-run.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-agent-run.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/agents/get-agent-run.use-case.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAEhG;;GAEG;AACH,qBACa,kBAAkB;IAG3B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;;OAKG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAGpD"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Get Agent Run Use Case
3
+ *
4
+ * Retrieves agent run details by ID for display purposes.
5
+ */
6
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
+ 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;
10
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11
+ };
12
+ var __metadata = (this && this.__metadata) || function (k, v) {
13
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14
+ };
15
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
16
+ return function (target, key) { decorator(target, key, paramIndex); }
17
+ };
18
+ import { injectable, inject } from 'tsyringe';
19
+ /**
20
+ * Use case for getting a specific agent run by ID.
21
+ */
22
+ let GetAgentRunUseCase = class GetAgentRunUseCase {
23
+ agentRunRepository;
24
+ constructor(agentRunRepository) {
25
+ this.agentRunRepository = agentRunRepository;
26
+ }
27
+ /**
28
+ * Get an agent run by ID.
29
+ *
30
+ * @param id - The agent run ID
31
+ * @returns The agent run or null if not found
32
+ */
33
+ async execute(id) {
34
+ return this.agentRunRepository.findById(id);
35
+ }
36
+ };
37
+ GetAgentRunUseCase = __decorate([
38
+ injectable(),
39
+ __param(0, inject('IAgentRunRepository')),
40
+ __metadata("design:paramtypes", [Object])
41
+ ], GetAgentRunUseCase);
42
+ export { GetAgentRunUseCase };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * List Agent Runs Use Case
3
+ *
4
+ * Retrieves all agent runs for listing/display purposes.
5
+ */
6
+ import type { AgentRun } from '../../../domain/generated/output.js';
7
+ import type { IAgentRunRepository } from '../../ports/output/agent-run-repository.interface.js';
8
+ /**
9
+ * Use case for listing all agent runs.
10
+ */
11
+ export declare class ListAgentRunsUseCase {
12
+ private readonly agentRunRepository;
13
+ constructor(agentRunRepository: IAgentRunRepository);
14
+ /**
15
+ * List all agent runs sorted by creation time (most recent first).
16
+ *
17
+ * @returns Array of agent runs sorted by createdAt descending
18
+ */
19
+ execute(): Promise<AgentRun[]>;
20
+ }
21
+ //# sourceMappingURL=list-agent-runs.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-agent-runs.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/agents/list-agent-runs.use-case.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAEhG;;GAEG;AACH,qBACa,oBAAoB;IAG7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAG1D;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAoBrC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * List Agent Runs Use Case
3
+ *
4
+ * Retrieves all agent runs for listing/display purposes.
5
+ */
6
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
+ 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;
10
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11
+ };
12
+ var __metadata = (this && this.__metadata) || function (k, v) {
13
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14
+ };
15
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
16
+ return function (target, key) { decorator(target, key, paramIndex); }
17
+ };
18
+ import { injectable, inject } from 'tsyringe';
19
+ /**
20
+ * Use case for listing all agent runs.
21
+ */
22
+ let ListAgentRunsUseCase = class ListAgentRunsUseCase {
23
+ agentRunRepository;
24
+ constructor(agentRunRepository) {
25
+ this.agentRunRepository = agentRunRepository;
26
+ }
27
+ /**
28
+ * List all agent runs sorted by creation time (most recent first).
29
+ *
30
+ * @returns Array of agent runs sorted by createdAt descending
31
+ */
32
+ async execute() {
33
+ const runs = await this.agentRunRepository.list();
34
+ return runs.sort((a, b) => {
35
+ const dateA = typeof a.createdAt === 'string'
36
+ ? new Date(a.createdAt).getTime()
37
+ : a.createdAt instanceof Date
38
+ ? a.createdAt.getTime()
39
+ : 0;
40
+ const dateB = typeof b.createdAt === 'string'
41
+ ? new Date(b.createdAt).getTime()
42
+ : b.createdAt instanceof Date
43
+ ? b.createdAt.getTime()
44
+ : 0;
45
+ return dateB - dateA; // Descending order (most recent first)
46
+ });
47
+ }
48
+ };
49
+ ListAgentRunsUseCase = __decorate([
50
+ injectable(),
51
+ __param(0, inject('IAgentRunRepository')),
52
+ __metadata("design:paramtypes", [Object])
53
+ ], ListAgentRunsUseCase);
54
+ export { ListAgentRunsUseCase };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Reject Agent Run Use Case
3
+ *
4
+ * Rejects a paused agent run (waiting_approval status) and
5
+ * marks it as cancelled with the rejection reason.
6
+ */
7
+ import type { IAgentRunRepository } from '../../ports/output/agent-run-repository.interface.js';
8
+ export declare class RejectAgentRunUseCase {
9
+ private readonly agentRunRepository;
10
+ constructor(agentRunRepository: IAgentRunRepository);
11
+ execute(id: string, reason?: string): Promise<{
12
+ rejected: boolean;
13
+ reason: string;
14
+ }>;
15
+ }
16
+ //# sourceMappingURL=reject-agent-run.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reject-agent-run.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/agents/reject-agent-run.use-case.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAGhG,qBACa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,mBAAmB;IAGpD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAuB3F"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Reject Agent Run Use Case
3
+ *
4
+ * Rejects a paused agent run (waiting_approval status) and
5
+ * marks it as cancelled with the rejection reason.
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 { AgentRunStatus } from '../../../domain/generated/output.js';
21
+ let RejectAgentRunUseCase = class RejectAgentRunUseCase {
22
+ agentRunRepository;
23
+ constructor(agentRunRepository) {
24
+ this.agentRunRepository = agentRunRepository;
25
+ }
26
+ async execute(id, reason) {
27
+ const run = await this.agentRunRepository.findById(id);
28
+ if (!run) {
29
+ return { rejected: false, reason: 'Agent run not found' };
30
+ }
31
+ if (run.status !== AgentRunStatus.waitingApproval) {
32
+ return {
33
+ rejected: false,
34
+ reason: `Agent run is not waiting for approval (status: ${run.status})`,
35
+ };
36
+ }
37
+ const now = new Date();
38
+ await this.agentRunRepository.updateStatus(id, AgentRunStatus.cancelled, {
39
+ approvalStatus: 'rejected',
40
+ error: reason ?? 'Rejected by user',
41
+ completedAt: now,
42
+ updatedAt: now,
43
+ });
44
+ return { rejected: true, reason: 'Rejected and cancelled' };
45
+ }
46
+ };
47
+ RejectAgentRunUseCase = __decorate([
48
+ injectable(),
49
+ __param(0, inject('IAgentRunRepository')),
50
+ __metadata("design:paramtypes", [Object])
51
+ ], RejectAgentRunUseCase);
52
+ export { RejectAgentRunUseCase };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Show Agent Run Use Case
3
+ *
4
+ * Retrieves a single agent run by ID with process liveness check.
5
+ *
6
+ * Business Rules:
7
+ * - Tries exact ID match first, then prefix match via list()
8
+ * - Throws if the agent run does not exist
9
+ * - Checks process liveness for runs that have a pid
10
+ */
11
+ import type { AgentRun } from '../../../domain/generated/output.js';
12
+ import type { IAgentRunRepository } from '../../ports/output/agent-run-repository.interface.js';
13
+ import type { IFeatureAgentProcessService } from '../../ports/output/feature-agent-process.interface.js';
14
+ export interface ShowAgentRunResult {
15
+ run: AgentRun;
16
+ isAlive: boolean;
17
+ }
18
+ export declare class ShowAgentRunUseCase {
19
+ private readonly runRepo;
20
+ private readonly processService;
21
+ constructor(runRepo: IAgentRunRepository, processService: IFeatureAgentProcessService);
22
+ execute(runId: string): Promise<ShowAgentRunResult>;
23
+ }
24
+ //# sourceMappingURL=show-agent-run.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-agent-run.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/application/use-cases/agents/show-agent-run.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AAEzG,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBACa,mBAAmB;IAG5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAExB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAFd,OAAO,EAAE,mBAAmB,EAE5B,cAAc,EAAE,2BAA2B;IAGxD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAkB1D"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Show Agent Run Use Case
3
+ *
4
+ * Retrieves a single agent run by ID with process liveness check.
5
+ *
6
+ * Business Rules:
7
+ * - Tries exact ID match first, then prefix match via list()
8
+ * - Throws if the agent run does not exist
9
+ * - Checks process liveness for runs that have a pid
10
+ */
11
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ 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;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ var __metadata = (this && this.__metadata) || function (k, v) {
18
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
+ };
20
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
21
+ return function (target, key) { decorator(target, key, paramIndex); }
22
+ };
23
+ import { injectable, inject } from 'tsyringe';
24
+ let ShowAgentRunUseCase = class ShowAgentRunUseCase {
25
+ runRepo;
26
+ processService;
27
+ constructor(runRepo, processService) {
28
+ this.runRepo = runRepo;
29
+ this.processService = processService;
30
+ }
31
+ async execute(runId) {
32
+ // Try exact match first
33
+ let run = await this.runRepo.findById(runId);
34
+ // Fall back to prefix match
35
+ if (!run) {
36
+ const allRuns = await this.runRepo.list();
37
+ run = allRuns.find((r) => r.id.startsWith(runId)) ?? null;
38
+ }
39
+ if (!run) {
40
+ throw new Error(`Agent run not found: "${runId}"`);
41
+ }
42
+ const isAlive = run.pid != null ? this.processService.isAlive(run.pid) : false;
43
+ return { run, isAlive };
44
+ }
45
+ };
46
+ ShowAgentRunUseCase = __decorate([
47
+ injectable(),
48
+ __param(0, inject('IAgentRunRepository')),
49
+ __param(1, inject('IFeatureAgentProcessService')),
50
+ __metadata("design:paramtypes", [Object, Object])
51
+ ], ShowAgentRunUseCase);
52
+ export { ShowAgentRunUseCase };