@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,59 @@
1
+ /**
2
+ * GitHub Issue Fetcher Service
3
+ *
4
+ * Fetches GitHub issues using the gh CLI subprocess.
5
+ * Supports owner/repo#number and #number (current repo) formats.
6
+ */
7
+ import { IssueNotFoundError, IssueServiceUnavailableError, } from '../../../application/ports/output/services/external-issue-fetcher.interface.js';
8
+ export class GitHubIssueFetcher {
9
+ execFile;
10
+ constructor(execFile) {
11
+ this.execFile = execFile;
12
+ }
13
+ async fetchGitHubIssue(ref) {
14
+ const { issueNumber, repo } = this.parseRef(ref);
15
+ const args = ['issue', 'view', issueNumber];
16
+ if (repo) {
17
+ args.push('--repo', repo);
18
+ }
19
+ args.push('--json', 'title,body,labels,url');
20
+ try {
21
+ const { stdout } = await this.execFile('gh', args, { timeout: 30_000 });
22
+ const data = JSON.parse(stdout);
23
+ return {
24
+ title: data.title,
25
+ description: data.body ?? '',
26
+ labels: data.labels.map((l) => l.name),
27
+ url: data.url,
28
+ source: 'github',
29
+ };
30
+ }
31
+ catch (err) {
32
+ const error = err instanceof Error ? err : new Error(String(err));
33
+ if (error.code === 'ENOENT') {
34
+ throw new IssueServiceUnavailableError('GitHub CLI (gh) is not installed. Install it from https://cli.github.com/');
35
+ }
36
+ if (error.message.includes('Could not resolve')) {
37
+ throw new IssueNotFoundError(`GitHub issue ${ref} not found`);
38
+ }
39
+ throw new IssueNotFoundError(`Failed to fetch GitHub issue ${ref}: ${error.message}`);
40
+ }
41
+ }
42
+ parseRef(ref) {
43
+ // Format: owner/repo#123
44
+ const fullMatch = ref.match(/^([^#]+)#(\d+)$/);
45
+ if (fullMatch) {
46
+ return { issueNumber: fullMatch[2], repo: fullMatch[1] };
47
+ }
48
+ // Format: #123
49
+ const hashMatch = ref.match(/^#(\d+)$/);
50
+ if (hashMatch) {
51
+ return { issueNumber: hashMatch[1] };
52
+ }
53
+ // Format: plain number
54
+ if (/^\d+$/.test(ref)) {
55
+ return { issueNumber: ref };
56
+ }
57
+ throw new IssueNotFoundError(`Invalid GitHub issue reference: ${ref}`);
58
+ }
59
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Jira Ticket Fetcher Service
3
+ *
4
+ * Fetches Jira tickets using the Jira REST API v3 via fetch.
5
+ * Requires baseUrl, email, and API token for authentication.
6
+ */
7
+ import type { IExternalIssueFetcher, ExternalIssue } from '../../../application/ports/output/services/external-issue-fetcher.interface.js';
8
+ type FetchFn = (url: string, init?: RequestInit) => Promise<Response>;
9
+ export interface JiraConfig {
10
+ baseUrl: string;
11
+ email: string;
12
+ token: string;
13
+ fetchFn?: FetchFn;
14
+ }
15
+ export declare class JiraTicketFetcher implements Pick<IExternalIssueFetcher, 'fetchJiraTicket'> {
16
+ private readonly baseUrl;
17
+ private readonly authHeader;
18
+ private readonly fetchFn;
19
+ constructor(config: JiraConfig);
20
+ fetchJiraTicket(key: string): Promise<ExternalIssue>;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=jira-ticket.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-ticket.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/external/jira-ticket.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACd,MAAM,yEAAyE,CAAC;AAOjF,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEtE,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,iBAAkB,YAAW,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,CAAC;IACtF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,MAAM,EAAE,UAAU;IAYxB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAqD3D"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Jira Ticket Fetcher Service
3
+ *
4
+ * Fetches Jira tickets using the Jira REST API v3 via fetch.
5
+ * Requires baseUrl, email, and API token for authentication.
6
+ */
7
+ import { IssueNotFoundError, IssueAuthenticationError, IssueServiceUnavailableError, } from '../../../application/ports/output/services/external-issue-fetcher.interface.js';
8
+ export class JiraTicketFetcher {
9
+ baseUrl;
10
+ authHeader;
11
+ fetchFn;
12
+ constructor(config) {
13
+ if (!config.baseUrl) {
14
+ throw new IssueServiceUnavailableError('Jira configuration is incomplete: baseUrl is required');
15
+ }
16
+ this.baseUrl = config.baseUrl.replace(/\/$/, '');
17
+ this.authHeader = `Basic ${Buffer.from(`${config.email}:${config.token}`).toString('base64')}`;
18
+ this.fetchFn = config.fetchFn ?? globalThis.fetch;
19
+ }
20
+ async fetchJiraTicket(key) {
21
+ const url = `${this.baseUrl}/rest/api/3/issue/${key}?fields=summary,description,labels`;
22
+ try {
23
+ const response = await this.fetchFn(url, {
24
+ headers: {
25
+ Authorization: this.authHeader,
26
+ Accept: 'application/json',
27
+ },
28
+ });
29
+ if (!response.ok) {
30
+ if (response.status === 404) {
31
+ throw new IssueNotFoundError(`Jira ticket ${key} not found`);
32
+ }
33
+ if (response.status === 401 || response.status === 403) {
34
+ throw new IssueAuthenticationError(`Jira authentication failed (${response.status}): check your email and API token`);
35
+ }
36
+ throw new IssueServiceUnavailableError(`Jira API returned ${response.status}`);
37
+ }
38
+ const data = (await response.json());
39
+ return {
40
+ title: data.fields.summary,
41
+ description: data.fields.description ?? '',
42
+ labels: data.fields.labels ?? [],
43
+ url: `${this.baseUrl}/browse/${key}`,
44
+ source: 'jira',
45
+ };
46
+ }
47
+ catch (err) {
48
+ // Re-throw our own errors
49
+ if (err instanceof IssueNotFoundError ||
50
+ err instanceof IssueAuthenticationError ||
51
+ err instanceof IssueServiceUnavailableError) {
52
+ throw err;
53
+ }
54
+ throw new IssueServiceUnavailableError(`Failed to connect to Jira: ${err instanceof Error ? err.message : String(err)}`);
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Git Worktree Service Implementation
3
+ *
4
+ * Manages git worktrees using native execFile for process execution.
5
+ * Uses constructor dependency injection for the command executor
6
+ * to enable testability without mocking node:child_process directly.
7
+ */
8
+ import type { IWorktreeService, WorktreeInfo } from '../../../application/ports/output/services/worktree-service.interface.js';
9
+ /**
10
+ * Type for the command executor dependency.
11
+ * Matches the promisified signature of child_process.execFile.
12
+ */
13
+ export type ExecFunction = (file: string, args: string[], options?: object) => Promise<{
14
+ stdout: string;
15
+ stderr: string;
16
+ }>;
17
+ export declare class WorktreeService implements IWorktreeService {
18
+ private readonly execFile;
19
+ constructor(execFile: ExecFunction);
20
+ create(repoPath: string, branch: string, worktreePath: string): Promise<WorktreeInfo>;
21
+ remove(worktreePath: string): Promise<void>;
22
+ list(repoPath: string): Promise<WorktreeInfo[]>;
23
+ exists(repoPath: string, branch: string): Promise<boolean>;
24
+ getWorktreePath(repoPath: string, branch: string): string;
25
+ private parseWorktreeOutput;
26
+ private parseGitError;
27
+ }
28
+ //# sourceMappingURL=worktree.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/git/worktree.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,0EAA0E,CAAC;AAOlF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjD,qBACa,eAAgB,YAAW,gBAAgB;IAClB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAqBrF,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3C,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAO/C,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKhE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAMzD,OAAO,CAAC,mBAAmB;IA2B3B,OAAO,CAAC,aAAa;CA+BtB"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Git Worktree Service Implementation
3
+ *
4
+ * Manages git worktrees using native execFile for process execution.
5
+ * Uses constructor dependency injection for the command executor
6
+ * to enable testability without mocking node:child_process directly.
7
+ */
8
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
9
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11
+ 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;
12
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
13
+ };
14
+ var __metadata = (this && this.__metadata) || function (k, v) {
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16
+ };
17
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
18
+ return function (target, key) { decorator(target, key, paramIndex); }
19
+ };
20
+ import { createHash } from 'node:crypto';
21
+ import path from 'node:path';
22
+ import { injectable, inject } from 'tsyringe';
23
+ import { WorktreeError, WorktreeErrorCode, } from '../../../application/ports/output/services/worktree-service.interface.js';
24
+ import { SHEP_HOME_DIR } from '../filesystem/shep-directory.service.js';
25
+ let WorktreeService = class WorktreeService {
26
+ execFile;
27
+ constructor(execFile) {
28
+ this.execFile = execFile;
29
+ }
30
+ async create(repoPath, branch, worktreePath) {
31
+ try {
32
+ await this.execFile('git', ['worktree', 'add', worktreePath, '-b', branch], {
33
+ cwd: repoPath,
34
+ });
35
+ }
36
+ catch (error) {
37
+ throw this.parseGitError(error);
38
+ }
39
+ // Get info about the created worktree
40
+ const worktrees = await this.list(repoPath);
41
+ const created = worktrees.find((w) => w.path === worktreePath);
42
+ if (!created) {
43
+ throw new WorktreeError('Worktree created but not found in list', WorktreeErrorCode.GIT_ERROR);
44
+ }
45
+ return created;
46
+ }
47
+ async remove(worktreePath) {
48
+ try {
49
+ await this.execFile('git', ['worktree', 'remove', worktreePath], {});
50
+ }
51
+ catch (error) {
52
+ throw this.parseGitError(error);
53
+ }
54
+ }
55
+ async list(repoPath) {
56
+ const { stdout } = await this.execFile('git', ['worktree', 'list', '--porcelain'], {
57
+ cwd: repoPath,
58
+ });
59
+ return this.parseWorktreeOutput(stdout);
60
+ }
61
+ async exists(repoPath, branch) {
62
+ const worktrees = await this.list(repoPath);
63
+ return worktrees.some((w) => w.branch === branch);
64
+ }
65
+ getWorktreePath(repoPath, branch) {
66
+ const repoHash = createHash('sha256').update(repoPath).digest('hex').slice(0, 16);
67
+ const slug = branch.replace(/\//g, '-');
68
+ return path.join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
69
+ }
70
+ parseWorktreeOutput(output) {
71
+ if (!output.trim())
72
+ return [];
73
+ const worktrees = [];
74
+ const blocks = output.split('\n\n').filter((b) => b.trim());
75
+ for (const block of blocks) {
76
+ const lines = block.split('\n');
77
+ const wtPath = lines.find((l) => l.startsWith('worktree '))?.slice('worktree '.length) ?? '';
78
+ const head = lines.find((l) => l.startsWith('HEAD '))?.slice('HEAD '.length) ?? '';
79
+ const branchLine = lines.find((l) => l.startsWith('branch '));
80
+ const fullBranch = branchLine?.slice('branch '.length) ?? '';
81
+ const branch = fullBranch.replace('refs/heads/', '');
82
+ if (wtPath) {
83
+ worktrees.push({
84
+ path: wtPath,
85
+ head,
86
+ branch,
87
+ isMain: worktrees.length === 0, // First entry is always main
88
+ });
89
+ }
90
+ }
91
+ return worktrees;
92
+ }
93
+ parseGitError(error) {
94
+ const message = error instanceof Error ? error.message : String(error);
95
+ if (message.includes('already exists')) {
96
+ return new WorktreeError(message, WorktreeErrorCode.ALREADY_EXISTS, error instanceof Error ? error : undefined);
97
+ }
98
+ if (message.includes('already checked out') || message.includes('is already checked out')) {
99
+ return new WorktreeError(message, WorktreeErrorCode.BRANCH_IN_USE, error instanceof Error ? error : undefined);
100
+ }
101
+ if (message.includes('not a valid directory') || message.includes('is not a working tree')) {
102
+ return new WorktreeError(message, WorktreeErrorCode.NOT_FOUND, error instanceof Error ? error : undefined);
103
+ }
104
+ return new WorktreeError(message, WorktreeErrorCode.GIT_ERROR, error instanceof Error ? error : undefined);
105
+ }
106
+ };
107
+ WorktreeService = __decorate([
108
+ injectable(),
109
+ __param(0, inject('ExecFunction')),
110
+ __metadata("design:paramtypes", [Function])
111
+ ], WorktreeService);
112
+ export { WorktreeService };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Spec Initializer Service
3
+ *
4
+ * Creates feature specification directories with YAML template files.
5
+ * Templates match exactly what /shep-kit:new-feature produces,
6
+ * enabling dogfooding — the CLI and the skill use the same spec format.
7
+ */
8
+ import type { ISpecInitializerService, SpecInitializerResult } from '../../../application/ports/output/services/spec-initializer.interface.js';
9
+ export declare class SpecInitializerService implements ISpecInitializerService {
10
+ initialize(basePath: string, slug: string, featureNumber: number, description: string): Promise<SpecInitializerResult>;
11
+ /**
12
+ * Scan specs/ for existing NNN-* directories and return the next available number.
13
+ * Uses the DB-derived hint as a minimum, but always respects filesystem state.
14
+ */
15
+ private resolveNextNumber;
16
+ }
17
+ //# sourceMappingURL=spec-initializer.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-initializer.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/spec/spec-initializer.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mEAAmE,CAAC;AA4P3E,qBAAa,sBAAuB,YAAW,uBAAuB;IAC9D,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC;IA4BjC;;;OAGG;YACW,iBAAiB;CAoBhC"}
@@ -0,0 +1,281 @@
1
+ /**
2
+ * Spec Initializer Service
3
+ *
4
+ * Creates feature specification directories with YAML template files.
5
+ * Templates match exactly what /shep-kit:new-feature produces,
6
+ * enabling dogfooding — the CLI and the skill use the same spec format.
7
+ */
8
+ import { mkdir, readdir, writeFile } from 'node:fs/promises';
9
+ import { join } from 'node:path';
10
+ /**
11
+ * Pad a number to 3 digits with leading zeros.
12
+ */
13
+ function padNumber(n) {
14
+ return String(n).padStart(3, '0');
15
+ }
16
+ /**
17
+ * Apply template variable substitution matching init-feature.sh behavior.
18
+ * Handles both {{VAR}} and { { VAR } } (Prettier-formatted) patterns.
19
+ */
20
+ function applyTemplate(template, vars) {
21
+ const replacements = [
22
+ [/\{\{ ?NNN ?\}\}|\{ \{ NNN \} \}/g, vars.nnn],
23
+ [/\{\{ ?FEATURE_NAME ?\}\}|\{ \{ FEATURE_NAME \} \}/g, vars.slug],
24
+ [/\{\{ ?FEATURE_ID ?\}\}|\{ \{ FEATURE_ID \} \}/g, `${vars.nnn}-${vars.slug}`],
25
+ [/\{\{ ?FEATURE_NUMBER ?\}\}|\{ \{ FEATURE_NUMBER \} \}/g, String(vars.featureNumber)],
26
+ [/\{\{ ?BRANCH_NAME ?\}\}|\{ \{ BRANCH_NAME \} \}/g, `feat/${vars.nnn}-${vars.slug}`],
27
+ [/\{\{ ?DATE ?\}\}|\{ \{ DATE \} \}/g, vars.date],
28
+ [/\{\{ ?TIMESTAMP ?\}\}|\{ \{ TIMESTAMP \} \}/g, vars.timestamp],
29
+ [/\{\{ ?DESCRIPTION ?\}\}|\{ \{ DESCRIPTION \} \}/g, vars.description],
30
+ ];
31
+ let result = template;
32
+ for (const [pattern, replacement] of replacements) {
33
+ result = result.replace(pattern, replacement);
34
+ }
35
+ return result;
36
+ }
37
+ // ─── YAML Templates ────────────────────────────────────────────────
38
+ // These match .claude/skills/shep-kit:new-feature/templates/ exactly.
39
+ const SPEC_YAML = `# Feature Specification (YAML)
40
+ # This is the source of truth. Markdown is auto-generated from this file.
41
+
42
+ name: {{FEATURE_NAME}}
43
+ number: {{NNN}}
44
+ branch: feat/{{NNN}}-{{FEATURE_NAME}}
45
+ oneLiner: {{DESCRIPTION}}
46
+ summary: >
47
+ {{DESCRIPTION}}
48
+ phase: Analysis
49
+ sizeEstimate: M
50
+
51
+ # Relationships
52
+ relatedFeatures:
53
+ []
54
+
55
+ technologies:
56
+ []
57
+
58
+ relatedLinks:
59
+ []
60
+
61
+ # Open questions (must be resolved before implementation)
62
+ openQuestions:
63
+ []
64
+
65
+ # Markdown content (the actual spec)
66
+ content: |
67
+ ## Problem Statement
68
+
69
+ {{DESCRIPTION}}
70
+
71
+ ## Success Criteria
72
+
73
+ - [ ] TBD
74
+
75
+ ## Affected Areas
76
+
77
+ | Area | Impact | Reasoning |
78
+ | ---- | ------ | --------- |
79
+ | TBD | TBD | TBD |
80
+
81
+ ## Dependencies
82
+
83
+ None identified.
84
+
85
+ ## Size Estimate
86
+
87
+ **M** - To be refined during research
88
+
89
+ ---
90
+
91
+ _Generated by feature agent — proceed with research_
92
+ `;
93
+ const RESEARCH_YAML = `# Research Artifact (YAML)
94
+ # This is the source of truth. Markdown is auto-generated from this file.
95
+
96
+ name: {{FEATURE_NAME}}
97
+ summary: Technical analysis for {{NNN}}-{{FEATURE_NAME}}
98
+
99
+ # Relationships
100
+ relatedFeatures: []
101
+ technologies: []
102
+ relatedLinks: []
103
+
104
+ # Structured technology decisions
105
+ decisions: []
106
+
107
+ # Open questions (should be resolved by end of research)
108
+ openQuestions: []
109
+
110
+ # Markdown content (the full research document)
111
+ content: |
112
+ ## Status
113
+
114
+ - **Phase:** Research
115
+ - **Updated:** {{DATE}}
116
+
117
+ ## Technology Decisions
118
+
119
+ TBD
120
+
121
+ ---
122
+
123
+ _To be updated during research phase_
124
+ `;
125
+ const PLAN_YAML = `# Implementation Plan (YAML)
126
+ # This is the source of truth. Markdown is auto-generated from this file.
127
+
128
+ name: {{FEATURE_NAME}}
129
+ summary: Implementation plan for {{NNN}}-{{FEATURE_NAME}}
130
+
131
+ # Relationships
132
+ relatedFeatures: []
133
+ technologies: []
134
+ relatedLinks: []
135
+
136
+ # Structured implementation phases
137
+ phases: []
138
+
139
+ # File change tracking
140
+ filesToCreate: []
141
+ filesToModify: []
142
+
143
+ # Open questions (should all be resolved before implementation)
144
+ openQuestions: []
145
+
146
+ # Markdown content (the full plan document)
147
+ content: |
148
+ ## Status
149
+
150
+ - **Phase:** Planning
151
+ - **Updated:** {{DATE}}
152
+
153
+ ## Implementation Strategy
154
+
155
+ TBD
156
+
157
+ ---
158
+
159
+ _To be updated during planning phase_
160
+ `;
161
+ const TASKS_YAML = `# Task Breakdown (YAML)
162
+ # This is the source of truth. Markdown is auto-generated from this file.
163
+
164
+ name: {{FEATURE_NAME}}
165
+ summary: Task breakdown for {{NNN}}-{{FEATURE_NAME}}
166
+
167
+ # Relationships
168
+ relatedFeatures: []
169
+ technologies: []
170
+ relatedLinks: []
171
+
172
+ # Structured task list
173
+ tasks: []
174
+
175
+ # Total effort estimate
176
+ totalEstimate: TBD
177
+
178
+ # Open questions
179
+ openQuestions: []
180
+
181
+ # Markdown content (the full tasks document)
182
+ content: |
183
+ ## Status
184
+
185
+ - **Phase:** Implementation
186
+ - **Updated:** {{DATE}}
187
+
188
+ ## Task List
189
+
190
+ TBD
191
+
192
+ ---
193
+
194
+ _Task breakdown for implementation tracking_
195
+ `;
196
+ const FEATURE_YAML = `feature:
197
+ id: '{{FEATURE_ID}}'
198
+ name: '{{FEATURE_NAME}}'
199
+ number: {{FEATURE_NUMBER}}
200
+ branch: '{{BRANCH_NAME}}'
201
+ lifecycle: 'research'
202
+ createdAt: '{{TIMESTAMP}}'
203
+
204
+ status:
205
+ phase: 'research'
206
+ progress:
207
+ completed: 0
208
+ total: 0
209
+ percentage: 0
210
+ currentTask: null
211
+ lastUpdated: '{{TIMESTAMP}}'
212
+ lastUpdatedBy: 'feature-agent'
213
+
214
+ validation:
215
+ lastRun: null
216
+ gatesPassed: []
217
+ autoFixesApplied: []
218
+
219
+ tasks:
220
+ current: null
221
+ blocked: []
222
+ failed: []
223
+
224
+ checkpoints:
225
+ - phase: 'feature-created'
226
+ completedAt: '{{TIMESTAMP}}'
227
+ completedBy: 'feature-agent'
228
+
229
+ errors:
230
+ current: null
231
+ history: []
232
+ `;
233
+ const TEMPLATES = [
234
+ { filename: 'spec.yaml', content: SPEC_YAML },
235
+ { filename: 'research.yaml', content: RESEARCH_YAML },
236
+ { filename: 'plan.yaml', content: PLAN_YAML },
237
+ { filename: 'tasks.yaml', content: TASKS_YAML },
238
+ { filename: 'feature.yaml', content: FEATURE_YAML },
239
+ ];
240
+ export class SpecInitializerService {
241
+ async initialize(basePath, slug, featureNumber, description) {
242
+ // Scan existing specs/ directory for highest NNN prefix to avoid collisions
243
+ // (specs may have been created outside the DB, e.g., via /shep-kit:new-feature)
244
+ const resolvedNumber = await this.resolveNextNumber(basePath, featureNumber);
245
+ const nnn = padNumber(resolvedNumber);
246
+ const specDirName = `${nnn}-${slug}`;
247
+ const specDir = join(basePath, 'specs', specDirName);
248
+ // Create the spec directory
249
+ await mkdir(specDir, { recursive: true });
250
+ const now = new Date();
251
+ const date = now.toISOString().split('T')[0];
252
+ const timestamp = now.toISOString().replace(/\.\d{3}Z$/, 'Z');
253
+ const vars = { nnn, slug, featureNumber: resolvedNumber, date, timestamp, description };
254
+ // Write all template files
255
+ await Promise.all(TEMPLATES.map(({ filename, content }) => writeFile(join(specDir, filename), applyTemplate(content, vars), 'utf-8')));
256
+ return { specDir, featureNumber: nnn };
257
+ }
258
+ /**
259
+ * Scan specs/ for existing NNN-* directories and return the next available number.
260
+ * Uses the DB-derived hint as a minimum, but always respects filesystem state.
261
+ */
262
+ async resolveNextNumber(basePath, hint) {
263
+ const specsDir = join(basePath, 'specs');
264
+ let entries;
265
+ try {
266
+ entries = await readdir(specsDir);
267
+ }
268
+ catch {
269
+ // specs/ doesn't exist yet — use hint
270
+ return hint;
271
+ }
272
+ let maxExisting = 0;
273
+ for (const entry of entries) {
274
+ const match = entry.match(/^(\d{3})-/);
275
+ if (match) {
276
+ maxExisting = Math.max(maxExisting, parseInt(match[1], 10));
277
+ }
278
+ }
279
+ return Math.max(maxExisting + 1, hint);
280
+ }
281
+ }
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import next from 'next';
12
12
  import http from 'node:http';
13
- import type { IWebServerService } from '../../application/ports/output/web-server-service.interface.js';
13
+ import type { IWebServerService } from '../../application/ports/output/services/web-server-service.interface.js';
14
14
  export interface WebServerDeps {
15
15
  createNextApp: typeof next;
16
16
  createHttpServer: typeof http.createServer;
@@ -1 +1 @@
1
- {"version":3,"file":"web-server.service.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/web-server.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAIxG,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,IAAI,CAAC;IAC3B,gBAAgB,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC;CAC5C;AAOD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAqB7D;AAED,qBACa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,GAAG,CAAwB;IACnC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;gBAEzB,IAAI,GAAE,OAAO,CAAC,aAAa,CAAM;IAI7C;;;;;OAKG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB5B"}
1
+ {"version":3,"file":"web-server.service.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/web-server.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yEAAyE,CAAC;AAIjH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,IAAI,CAAC;IAC3B,gBAAgB,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC;CAC5C;AAOD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAqB7D;AAED,qBACa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,GAAG,CAAwB;IACnC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;gBAEzB,IAAI,GAAE,OAAO,CAAC,aAAa,CAAM;IAI7C;;;;;OAKG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB5B"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Agent Approve Command
3
+ *
4
+ * Approves a paused agent run (waiting_approval) and resumes execution.
5
+ *
6
+ * Usage:
7
+ * shep agent approve <id>
8
+ */
9
+ import { Command } from 'commander';
10
+ export declare function createApproveCommand(): Command;
11
+ //# sourceMappingURL=approve.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/approve.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,oBAAoB,IAAI,OAAO,CA8B9C"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Agent Approve Command
3
+ *
4
+ * Approves a paused agent run (waiting_approval) and resumes execution.
5
+ *
6
+ * Usage:
7
+ * shep agent approve <id>
8
+ */
9
+ import { Command } from 'commander';
10
+ import { container } from '../../../../infrastructure/di/container.js';
11
+ import { ApproveAgentRunUseCase } from '../../../../application/use-cases/agents/approve-agent-run.use-case.js';
12
+ import { colors, messages } from '../../ui/index.js';
13
+ import { resolveAgentRun } from './resolve-run.js';
14
+ export function createApproveCommand() {
15
+ return new Command('approve')
16
+ .description('Approve a paused agent run and resume execution')
17
+ .argument('<id>', 'Agent run ID (or prefix)')
18
+ .action(async (id) => {
19
+ try {
20
+ const resolved = await resolveAgentRun(id);
21
+ if ('error' in resolved) {
22
+ messages.error(resolved.error);
23
+ process.exitCode = 1;
24
+ return;
25
+ }
26
+ const useCase = container.resolve(ApproveAgentRunUseCase);
27
+ const result = await useCase.execute(resolved.run.id);
28
+ if (result.approved) {
29
+ messages.success(`Approved ${colors.accent(resolved.run.id.substring(0, 8))}: ${result.reason}`);
30
+ }
31
+ else {
32
+ messages.error(result.reason);
33
+ process.exitCode = 1;
34
+ }
35
+ }
36
+ catch (error) {
37
+ const err = error instanceof Error ? error : new Error(String(error));
38
+ messages.error('Failed to approve agent run', err);
39
+ process.exitCode = 1;
40
+ }
41
+ });
42
+ }