@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,11 @@
1
+ /**
2
+ * Agent Delete Command
3
+ *
4
+ * Remove an agent run record from the database.
5
+ *
6
+ * Usage:
7
+ * shep agent delete <id>
8
+ */
9
+ import { Command } from 'commander';
10
+ export declare function createDeleteCommand(): Command;
11
+ //# sourceMappingURL=delete.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/delete.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,mBAAmB,IAAI,OAAO,CAsC7C"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Agent Delete Command
3
+ *
4
+ * Remove an agent run record from the database.
5
+ *
6
+ * Usage:
7
+ * shep agent delete <id>
8
+ */
9
+ import { Command } from 'commander';
10
+ import { container } from '../../../../infrastructure/di/container.js';
11
+ import { DeleteAgentRunUseCase } from '../../../../application/use-cases/agents/delete-agent-run.use-case.js';
12
+ import { colors, messages } from '../../ui/index.js';
13
+ import { resolveAgentRun } from './resolve-run.js';
14
+ export function createDeleteCommand() {
15
+ return new Command('delete')
16
+ .description('Delete an agent run record')
17
+ .argument('<id>', 'Agent run ID (or prefix)')
18
+ .option('--force', 'Force delete even if running')
19
+ .action(async (id, opts) => {
20
+ try {
21
+ const resolved = await resolveAgentRun(id);
22
+ if ('error' in resolved) {
23
+ messages.error(resolved.error);
24
+ process.exitCode = 1;
25
+ return;
26
+ }
27
+ if (opts.force && resolved.run.status === 'running') {
28
+ // Force delete: stop first, then delete
29
+ const { StopAgentRunUseCase } = await import('../../../../application/use-cases/agents/stop-agent-run.use-case.js');
30
+ const stopUseCase = container.resolve(StopAgentRunUseCase);
31
+ await stopUseCase.execute(resolved.run.id);
32
+ }
33
+ const useCase = container.resolve(DeleteAgentRunUseCase);
34
+ const result = await useCase.execute(resolved.run.id);
35
+ if (result.deleted) {
36
+ messages.success(`Deleted ${colors.accent(resolved.run.id.substring(0, 8))}`);
37
+ }
38
+ else {
39
+ messages.error(result.reason);
40
+ process.exitCode = 1;
41
+ }
42
+ }
43
+ catch (error) {
44
+ const err = error instanceof Error ? error : new Error(String(error));
45
+ messages.error('Failed to delete agent run', err);
46
+ process.exitCode = 1;
47
+ }
48
+ });
49
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Agent Command
3
+ *
4
+ * Top-level agent command with subcommands for managing and viewing agent runs.
5
+ *
6
+ * Usage:
7
+ * shep agent [subcommand]
8
+ *
9
+ * Subcommands:
10
+ * shep agent show <id> Display details of an agent run
11
+ * shep agent ls List all agent runs
12
+ * shep agent stop <id> Stop a running agent
13
+ * shep agent logs <id> View agent run logs
14
+ * shep agent delete <id> Delete an agent run record
15
+ */
16
+ import { Command } from 'commander';
17
+ /**
18
+ * Create the agent command with all subcommands
19
+ */
20
+ export declare function createAgentCommand(): Command;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAY5C"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Agent Command
3
+ *
4
+ * Top-level agent command with subcommands for managing and viewing agent runs.
5
+ *
6
+ * Usage:
7
+ * shep agent [subcommand]
8
+ *
9
+ * Subcommands:
10
+ * shep agent show <id> Display details of an agent run
11
+ * shep agent ls List all agent runs
12
+ * shep agent stop <id> Stop a running agent
13
+ * shep agent logs <id> View agent run logs
14
+ * shep agent delete <id> Delete an agent run record
15
+ */
16
+ import { Command } from 'commander';
17
+ import { createShowCommand } from './show.command.js';
18
+ import { createLsCommand } from './ls.command.js';
19
+ import { createStopCommand } from './stop.command.js';
20
+ import { createLogsCommand } from './logs.command.js';
21
+ import { createDeleteCommand } from './delete.command.js';
22
+ import { createApproveCommand } from './approve.command.js';
23
+ import { createRejectCommand } from './reject.command.js';
24
+ /**
25
+ * Create the agent command with all subcommands
26
+ */
27
+ export function createAgentCommand() {
28
+ const agent = new Command('agent')
29
+ .description('Manage and view agent runs')
30
+ .addCommand(createShowCommand())
31
+ .addCommand(createLsCommand())
32
+ .addCommand(createStopCommand())
33
+ .addCommand(createLogsCommand())
34
+ .addCommand(createDeleteCommand())
35
+ .addCommand(createApproveCommand())
36
+ .addCommand(createRejectCommand());
37
+ return agent;
38
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Agent Logs Command
3
+ *
4
+ * View log output for an agent run with efficient streaming.
5
+ *
6
+ * Usage:
7
+ * shep agent logs <id> # Print full log
8
+ * shep agent logs -f <id> # Follow (tail -f) using fs.watch
9
+ * shep agent logs -n 50 <id> # Last 50 lines
10
+ */
11
+ import { Command } from 'commander';
12
+ export declare function createLogsCommand(): Command;
13
+ //# sourceMappingURL=logs.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/logs.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgDpC,wBAAgB,iBAAiB,IAAI,OAAO,CAwH3C"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Agent Logs Command
3
+ *
4
+ * View log output for an agent run with efficient streaming.
5
+ *
6
+ * Usage:
7
+ * shep agent logs <id> # Print full log
8
+ * shep agent logs -f <id> # Follow (tail -f) using fs.watch
9
+ * shep agent logs -n 50 <id> # Last 50 lines
10
+ */
11
+ import { Command } from 'commander';
12
+ import { join } from 'node:path';
13
+ import { homedir } from 'node:os';
14
+ import { closeSync, createReadStream, existsSync, openSync, readFileSync, readSync, statSync, watch, } from 'node:fs';
15
+ import { open } from 'node:fs/promises';
16
+ import { colors, messages } from '../../ui/index.js';
17
+ import { resolveAgentRun } from './resolve-run.js';
18
+ /** Read the last N lines from a file without loading it all into memory */
19
+ function readTailLines(filePath, n) {
20
+ const stat = statSync(filePath);
21
+ // For small files (< 64KB), just read the whole thing
22
+ if (stat.size < 65536) {
23
+ const content = readFileSync(filePath, 'utf-8');
24
+ const lines = content.split('\n');
25
+ return lines.slice(Math.max(0, lines.length - n)).join('\n');
26
+ }
27
+ // For large files, read from the end in chunks
28
+ const fd = openSync(filePath, 'r');
29
+ const chunkSize = Math.min(stat.size, 8192);
30
+ let found = 0;
31
+ let pos = stat.size;
32
+ let tail = '';
33
+ const buf = Buffer.alloc(chunkSize);
34
+ while (pos > 0 && found <= n) {
35
+ const readSize = Math.min(chunkSize, pos);
36
+ pos -= readSize;
37
+ readSync(fd, buf, 0, readSize, pos);
38
+ const chunk = buf.toString('utf-8', 0, readSize);
39
+ tail = chunk + tail;
40
+ for (const ch of chunk) {
41
+ if (ch === '\n')
42
+ found++;
43
+ }
44
+ }
45
+ closeSync(fd);
46
+ const lines = tail.split('\n');
47
+ return lines.slice(Math.max(0, lines.length - n)).join('\n');
48
+ }
49
+ export function createLogsCommand() {
50
+ return new Command('logs')
51
+ .description('View agent run logs')
52
+ .argument('<id>', 'Agent run ID (or prefix)')
53
+ .option('-f, --follow', 'Follow log output (like tail -f)')
54
+ .option('-n, --lines <count>', 'Number of lines to show from the end', '0')
55
+ .action(async (id, opts) => {
56
+ try {
57
+ const resolved = await resolveAgentRun(id);
58
+ if ('error' in resolved) {
59
+ messages.error(resolved.error);
60
+ process.exitCode = 1;
61
+ return;
62
+ }
63
+ const logPath = join(homedir(), '.shep', 'logs', `worker-${resolved.run.id}.log`);
64
+ if (!existsSync(logPath)) {
65
+ messages.error(`No log file found for run ${resolved.run.id.substring(0, 8)}`);
66
+ messages.info(`Expected: ${logPath}`);
67
+ process.exitCode = 1;
68
+ return;
69
+ }
70
+ const stat = statSync(logPath);
71
+ if (stat.size === 0) {
72
+ messages.info(`Log file is empty for run ${colors.accent(resolved.run.id.substring(0, 8))}`);
73
+ if (!opts.follow)
74
+ return;
75
+ // In follow mode, continue — the file will grow
76
+ }
77
+ const requestedLines = parseInt(opts.lines, 10);
78
+ if (opts.follow) {
79
+ // Print existing content first
80
+ if (stat.size > 0) {
81
+ if (requestedLines > 0) {
82
+ process.stdout.write(readTailLines(logPath, requestedLines));
83
+ if (!process.stdout.destroyed)
84
+ process.stdout.write('\n');
85
+ }
86
+ else {
87
+ // Stream existing content without loading entire file into memory
88
+ await new Promise((resolve, reject) => {
89
+ const stream = createReadStream(logPath, { encoding: 'utf-8' });
90
+ stream.pipe(process.stdout, { end: false });
91
+ stream.on('end', resolve);
92
+ stream.on('error', reject);
93
+ });
94
+ }
95
+ }
96
+ // Follow new content using fs.watch (event-driven, no polling)
97
+ let position = stat.size;
98
+ const handle = await open(logPath, 'r');
99
+ // Reusable 4KB buffer for incremental reads
100
+ const readBuf = Buffer.alloc(4096);
101
+ const readNewContent = async () => {
102
+ try {
103
+ const currentStat = statSync(logPath);
104
+ while (position < currentStat.size) {
105
+ const bytesToRead = Math.min(readBuf.length, currentStat.size - position);
106
+ const { bytesRead } = await handle.read(readBuf, 0, bytesToRead, position);
107
+ if (bytesRead === 0)
108
+ break;
109
+ process.stdout.write(readBuf.toString('utf-8', 0, bytesRead));
110
+ position += bytesRead;
111
+ }
112
+ }
113
+ catch {
114
+ // File may have been deleted/rotated
115
+ }
116
+ };
117
+ // Use fs.watch for efficient OS-level file change notifications
118
+ const watcher = watch(logPath, { persistent: true }, () => {
119
+ readNewContent();
120
+ });
121
+ // Fallback poll every 2s in case fs.watch misses events (NFS, etc.)
122
+ const fallbackInterval = setInterval(readNewContent, 2000);
123
+ const cleanup = async () => {
124
+ watcher.close();
125
+ clearInterval(fallbackInterval);
126
+ await handle.close();
127
+ };
128
+ process.on('SIGINT', async () => {
129
+ await cleanup();
130
+ process.exit(0);
131
+ });
132
+ process.on('SIGTERM', async () => {
133
+ await cleanup();
134
+ process.exit(0);
135
+ });
136
+ }
137
+ else {
138
+ // Print mode
139
+ if (requestedLines > 0) {
140
+ process.stdout.write(readTailLines(logPath, requestedLines));
141
+ process.stdout.write('\n');
142
+ }
143
+ else {
144
+ // Stream the file — don't load it all into memory
145
+ await new Promise((resolve, reject) => {
146
+ const stream = createReadStream(logPath, { encoding: 'utf-8' });
147
+ stream.pipe(process.stdout, { end: false });
148
+ stream.on('end', () => {
149
+ process.stdout.write('\n');
150
+ resolve();
151
+ });
152
+ stream.on('error', reject);
153
+ });
154
+ }
155
+ }
156
+ }
157
+ catch (error) {
158
+ const err = error instanceof Error ? error : new Error(String(error));
159
+ messages.error('Failed to read agent logs', err);
160
+ process.exitCode = 1;
161
+ }
162
+ });
163
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Agent List Command
3
+ *
4
+ * List all agent runs with their status, PID, and other relevant details.
5
+ * Auto-detects dead PIDs and shows them as "crashed" instead of "running".
6
+ *
7
+ * Usage:
8
+ * shep agent ls
9
+ */
10
+ import { Command } from 'commander';
11
+ export declare function createLsCommand(): Command;
12
+ //# sourceMappingURL=ls.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/ls.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,wBAAgB,eAAe,IAAI,OAAO,CAqCzC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Agent List Command
3
+ *
4
+ * List all agent runs with their status, PID, and other relevant details.
5
+ * Auto-detects dead PIDs and shows them as "crashed" instead of "running".
6
+ *
7
+ * Usage:
8
+ * shep agent ls
9
+ */
10
+ import { Command } from 'commander';
11
+ import { container } from '../../../../infrastructure/di/container.js';
12
+ import { ListAgentRunsUseCase } from '../../../../application/use-cases/agents/list-agent-runs.use-case.js';
13
+ import { colors, symbols, messages, renderListView } from '../../ui/index.js';
14
+ function isProcessAlive(pid) {
15
+ try {
16
+ process.kill(pid, 0);
17
+ return true;
18
+ }
19
+ catch {
20
+ return false;
21
+ }
22
+ }
23
+ export function createLsCommand() {
24
+ return new Command('ls').description('List all agent runs').action(async () => {
25
+ try {
26
+ const useCase = container.resolve(ListAgentRunsUseCase);
27
+ const agentRuns = await useCase.execute();
28
+ const rows = agentRuns.map((run) => {
29
+ const liveness = getLiveness(run);
30
+ return [
31
+ run.id.substring(0, 8),
32
+ run.agentName,
33
+ liveness.displayStatus,
34
+ getDuration(run),
35
+ run.pid ? String(run.pid) : colors.muted('-'),
36
+ liveness.warning || '',
37
+ ];
38
+ });
39
+ renderListView({
40
+ title: 'Agent Runs',
41
+ columns: [
42
+ { label: 'ID', width: 10 },
43
+ { label: 'Agent', width: 18 },
44
+ { label: 'Status', width: 16 },
45
+ { label: 'Duration', width: 10 },
46
+ { label: 'PID', width: 8 },
47
+ { label: 'Warning', width: 20 },
48
+ ],
49
+ rows,
50
+ emptyMessage: 'No agent runs found',
51
+ });
52
+ }
53
+ catch (error) {
54
+ const err = error instanceof Error ? error : new Error(String(error));
55
+ messages.error('Failed to list agent runs', err);
56
+ process.exitCode = 1;
57
+ }
58
+ });
59
+ }
60
+ function getLiveness(run) {
61
+ const isActive = run.status === 'running' || run.status === 'pending';
62
+ if (isActive && run.pid && !isProcessAlive(run.pid)) {
63
+ return {
64
+ displayStatus: `${colors.error(symbols.error)} ${colors.error('crashed')}`,
65
+ warning: colors.error(`PID ${run.pid} dead`),
66
+ };
67
+ }
68
+ const map = {
69
+ pending: `${colors.muted(symbols.dotEmpty)} ${colors.muted('pending')}`,
70
+ running: `${colors.info(symbols.dot)} ${colors.info('running')}`,
71
+ completed: `${colors.success(symbols.success)} ${colors.success('completed')}`,
72
+ failed: `${colors.error(symbols.error)} ${colors.error('failed')}`,
73
+ interrupted: `${colors.error(symbols.error)} ${colors.error('interrupted')}`,
74
+ cancelled: `${colors.muted(symbols.dotEmpty)} ${colors.muted('cancelled')}`,
75
+ };
76
+ const displayStatus = map[run.status] || colors.muted(run.status);
77
+ let warning = '';
78
+ if (run.status === 'pending' && !run.startedAt) {
79
+ const hours = (Date.now() - new Date(run.createdAt).getTime()) / (1000 * 60 * 60);
80
+ if (hours > 24)
81
+ warning = colors.error('STUCK (>24h)');
82
+ else if (hours > 1)
83
+ warning = colors.error('SLOW (>1h)');
84
+ }
85
+ return { displayStatus, warning };
86
+ }
87
+ function getDuration(run) {
88
+ if (run.status === 'pending' && !run.startedAt) {
89
+ return fmtDuration(Date.now() - new Date(run.createdAt).getTime());
90
+ }
91
+ if (run.startedAt && run.completedAt) {
92
+ return fmtDuration(new Date(run.completedAt).getTime() - new Date(run.startedAt).getTime());
93
+ }
94
+ if (run.startedAt) {
95
+ return fmtDuration(Date.now() - new Date(run.startedAt).getTime());
96
+ }
97
+ return '-';
98
+ }
99
+ function fmtDuration(ms) {
100
+ const seconds = Math.floor(ms / 1000);
101
+ const minutes = Math.floor(seconds / 60);
102
+ const hours = Math.floor(minutes / 60);
103
+ const days = Math.floor(hours / 24);
104
+ if (days > 0)
105
+ return `${days}d ${hours % 24}h`;
106
+ if (hours > 0)
107
+ return `${hours}h ${minutes % 60}m`;
108
+ if (minutes > 0)
109
+ return `${minutes}m`;
110
+ return `${seconds}s`;
111
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Agent Reject Command
3
+ *
4
+ * Rejects a paused agent run (waiting_approval) and cancels it.
5
+ *
6
+ * Usage:
7
+ * shep agent reject <id> [--reason <text>]
8
+ */
9
+ import { Command } from 'commander';
10
+ export declare function createRejectCommand(): Command;
11
+ //# sourceMappingURL=reject.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reject.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/reject.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,mBAAmB,IAAI,OAAO,CA+B7C"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Agent Reject Command
3
+ *
4
+ * Rejects a paused agent run (waiting_approval) and cancels it.
5
+ *
6
+ * Usage:
7
+ * shep agent reject <id> [--reason <text>]
8
+ */
9
+ import { Command } from 'commander';
10
+ import { container } from '../../../../infrastructure/di/container.js';
11
+ import { RejectAgentRunUseCase } from '../../../../application/use-cases/agents/reject-agent-run.use-case.js';
12
+ import { colors, messages } from '../../ui/index.js';
13
+ import { resolveAgentRun } from './resolve-run.js';
14
+ export function createRejectCommand() {
15
+ return new Command('reject')
16
+ .description('Reject a paused agent run and cancel it')
17
+ .argument('<id>', 'Agent run ID (or prefix)')
18
+ .option('-r, --reason <text>', 'Reason for rejection')
19
+ .action(async (id, opts) => {
20
+ try {
21
+ const resolved = await resolveAgentRun(id);
22
+ if ('error' in resolved) {
23
+ messages.error(resolved.error);
24
+ process.exitCode = 1;
25
+ return;
26
+ }
27
+ const useCase = container.resolve(RejectAgentRunUseCase);
28
+ const result = await useCase.execute(resolved.run.id, opts.reason);
29
+ if (result.rejected) {
30
+ messages.success(`Rejected ${colors.accent(resolved.run.id.substring(0, 8))}: ${result.reason}`);
31
+ }
32
+ else {
33
+ messages.error(result.reason);
34
+ process.exitCode = 1;
35
+ }
36
+ }
37
+ catch (error) {
38
+ const err = error instanceof Error ? error : new Error(String(error));
39
+ messages.error('Failed to reject agent run', err);
40
+ process.exitCode = 1;
41
+ }
42
+ });
43
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shared helper: resolve an agent run by exact or prefix ID.
3
+ */
4
+ import type { AgentRun } from '../../../../domain/generated/output.js';
5
+ export declare function resolveAgentRun(id: string): Promise<{
6
+ run: AgentRun;
7
+ } | {
8
+ error: string;
9
+ }>;
10
+ //# sourceMappingURL=resolve-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-run.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/resolve-run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE,wBAAsB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAsBhG"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Shared helper: resolve an agent run by exact or prefix ID.
3
+ */
4
+ import { container } from '../../../../infrastructure/di/container.js';
5
+ import { GetAgentRunUseCase } from '../../../../application/use-cases/agents/get-agent-run.use-case.js';
6
+ import { ListAgentRunsUseCase } from '../../../../application/use-cases/agents/list-agent-runs.use-case.js';
7
+ export async function resolveAgentRun(id) {
8
+ const getUseCase = container.resolve(GetAgentRunUseCase);
9
+ // Try exact match first
10
+ const exact = await getUseCase.execute(id);
11
+ if (exact)
12
+ return { run: exact };
13
+ // Try prefix match
14
+ if (id.length < 36) {
15
+ const listUseCase = container.resolve(ListAgentRunsUseCase);
16
+ const allRuns = await listUseCase.execute();
17
+ const matches = allRuns.filter((r) => r.id.startsWith(id));
18
+ if (matches.length === 1)
19
+ return { run: matches[0] };
20
+ if (matches.length > 1) {
21
+ return {
22
+ error: `Multiple runs match prefix "${id}": ${matches.map((m) => m.id.substring(0, 8)).join(', ')}`,
23
+ };
24
+ }
25
+ }
26
+ return { error: `Agent run not found: ${id}` };
27
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Agent Show Command
3
+ *
4
+ * Display details of a specific agent run including execution status,
5
+ * PID, current node, heartbeat, and output.
6
+ *
7
+ * Usage:
8
+ * shep agent show <id>
9
+ */
10
+ import { Command } from 'commander';
11
+ export declare function createShowCommand(): Command;
12
+ //# sourceMappingURL=show.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,wBAAgB,iBAAiB,IAAI,OAAO,CAoG3C"}