@specforge/mcp 2.0.9 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/README.md +324 -0
  2. package/bin/specforge-mcp +19 -1
  3. package/dist/cli/commands/blocked.d.ts +16 -0
  4. package/dist/cli/commands/blocked.d.ts.map +1 -0
  5. package/dist/cli/commands/blocked.js +214 -0
  6. package/dist/cli/commands/blocked.js.map +1 -0
  7. package/dist/cli/commands/configure.d.ts +16 -0
  8. package/dist/cli/commands/configure.d.ts.map +1 -0
  9. package/dist/cli/commands/configure.js +218 -0
  10. package/dist/cli/commands/configure.js.map +1 -0
  11. package/dist/cli/commands/configure.types.d.ts +110 -0
  12. package/dist/cli/commands/configure.types.d.ts.map +1 -0
  13. package/dist/cli/commands/configure.types.js +105 -0
  14. package/dist/cli/commands/configure.types.js.map +1 -0
  15. package/dist/cli/commands/debug/call.d.ts +14 -0
  16. package/dist/cli/commands/debug/call.d.ts.map +1 -0
  17. package/dist/cli/commands/debug/call.js +117 -0
  18. package/dist/cli/commands/debug/call.js.map +1 -0
  19. package/dist/cli/commands/debug/index.d.ts +12 -0
  20. package/dist/cli/commands/debug/index.d.ts.map +1 -0
  21. package/dist/cli/commands/debug/index.js +12 -0
  22. package/dist/cli/commands/debug/index.js.map +1 -0
  23. package/dist/cli/commands/debug/register.d.ts +11 -0
  24. package/dist/cli/commands/debug/register.d.ts.map +1 -0
  25. package/dist/cli/commands/debug/register.js +90 -0
  26. package/dist/cli/commands/debug/register.js.map +1 -0
  27. package/dist/cli/commands/debug/test.d.ts +13 -0
  28. package/dist/cli/commands/debug/test.d.ts.map +1 -0
  29. package/dist/cli/commands/debug/test.js +117 -0
  30. package/dist/cli/commands/debug/test.js.map +1 -0
  31. package/dist/cli/commands/debug/tools.d.ts +13 -0
  32. package/dist/cli/commands/debug/tools.d.ts.map +1 -0
  33. package/dist/cli/commands/debug/tools.js +117 -0
  34. package/dist/cli/commands/debug/tools.js.map +1 -0
  35. package/dist/cli/commands/debug/types.d.ts +117 -0
  36. package/dist/cli/commands/debug/types.d.ts.map +1 -0
  37. package/dist/cli/commands/debug/types.js +43 -0
  38. package/dist/cli/commands/debug/types.js.map +1 -0
  39. package/dist/cli/commands/debug/whoami.d.ts +13 -0
  40. package/dist/cli/commands/debug/whoami.d.ts.map +1 -0
  41. package/dist/cli/commands/debug/whoami.js +161 -0
  42. package/dist/cli/commands/debug/whoami.js.map +1 -0
  43. package/dist/cli/commands/docs/content/api.d.ts +7 -0
  44. package/dist/cli/commands/docs/content/api.d.ts.map +1 -0
  45. package/dist/cli/commands/docs/content/api.js +64 -0
  46. package/dist/cli/commands/docs/content/api.js.map +1 -0
  47. package/dist/cli/commands/docs/content/concepts.d.ts +7 -0
  48. package/dist/cli/commands/docs/content/concepts.d.ts.map +1 -0
  49. package/dist/cli/commands/docs/content/concepts.js +68 -0
  50. package/dist/cli/commands/docs/content/concepts.js.map +1 -0
  51. package/dist/cli/commands/docs/content/examples.d.ts +7 -0
  52. package/dist/cli/commands/docs/content/examples.d.ts.map +1 -0
  53. package/dist/cli/commands/docs/content/examples.js +84 -0
  54. package/dist/cli/commands/docs/content/examples.js.map +1 -0
  55. package/dist/cli/commands/docs/content/index.d.ts +10 -0
  56. package/dist/cli/commands/docs/content/index.d.ts.map +1 -0
  57. package/dist/cli/commands/docs/content/index.js +10 -0
  58. package/dist/cli/commands/docs/content/index.js.map +1 -0
  59. package/dist/cli/commands/docs/content/workflow.d.ts +7 -0
  60. package/dist/cli/commands/docs/content/workflow.d.ts.map +1 -0
  61. package/dist/cli/commands/docs/content/workflow.js +44 -0
  62. package/dist/cli/commands/docs/content/workflow.js.map +1 -0
  63. package/dist/cli/commands/docs/content.d.ts +23 -0
  64. package/dist/cli/commands/docs/content.d.ts.map +1 -0
  65. package/dist/cli/commands/docs/content.js +38 -0
  66. package/dist/cli/commands/docs/content.js.map +1 -0
  67. package/dist/cli/commands/docs/display.d.ts +26 -0
  68. package/dist/cli/commands/docs/display.d.ts.map +1 -0
  69. package/dist/cli/commands/docs/display.js +53 -0
  70. package/dist/cli/commands/docs/display.js.map +1 -0
  71. package/dist/cli/commands/docs/docs.d.ts +19 -0
  72. package/dist/cli/commands/docs/docs.d.ts.map +1 -0
  73. package/dist/cli/commands/docs/docs.js +124 -0
  74. package/dist/cli/commands/docs/docs.js.map +1 -0
  75. package/dist/cli/commands/docs/index.d.ts +13 -0
  76. package/dist/cli/commands/docs/index.d.ts.map +1 -0
  77. package/dist/cli/commands/docs/index.js +13 -0
  78. package/dist/cli/commands/docs/index.js.map +1 -0
  79. package/dist/cli/commands/docs/register.d.ts +23 -0
  80. package/dist/cli/commands/docs/register.d.ts.map +1 -0
  81. package/dist/cli/commands/docs/register.js +64 -0
  82. package/dist/cli/commands/docs/register.js.map +1 -0
  83. package/dist/cli/commands/docs/tool-docs.d.ts +44 -0
  84. package/dist/cli/commands/docs/tool-docs.d.ts.map +1 -0
  85. package/dist/cli/commands/docs/tool-docs.js +182 -0
  86. package/dist/cli/commands/docs/tool-docs.js.map +1 -0
  87. package/dist/cli/commands/docs/tool-examples.d.ts +14 -0
  88. package/dist/cli/commands/docs/tool-examples.d.ts.map +1 -0
  89. package/dist/cli/commands/docs/tool-examples.js +127 -0
  90. package/dist/cli/commands/docs/tool-examples.js.map +1 -0
  91. package/dist/cli/commands/docs/types.d.ts +108 -0
  92. package/dist/cli/commands/docs/types.d.ts.map +1 -0
  93. package/dist/cli/commands/docs/types.js +33 -0
  94. package/dist/cli/commands/docs/types.js.map +1 -0
  95. package/dist/cli/commands/doctor.d.ts +16 -0
  96. package/dist/cli/commands/doctor.d.ts.map +1 -0
  97. package/dist/cli/commands/doctor.js +322 -0
  98. package/dist/cli/commands/doctor.js.map +1 -0
  99. package/dist/cli/commands/doctor.types.d.ts +177 -0
  100. package/dist/cli/commands/doctor.types.d.ts.map +1 -0
  101. package/dist/cli/commands/doctor.types.js +172 -0
  102. package/dist/cli/commands/doctor.types.js.map +1 -0
  103. package/dist/cli/commands/index.d.ts +18 -0
  104. package/dist/cli/commands/index.d.ts.map +1 -0
  105. package/dist/cli/commands/index.js +18 -0
  106. package/dist/cli/commands/index.js.map +1 -0
  107. package/dist/cli/commands/init.d.ts +17 -0
  108. package/dist/cli/commands/init.d.ts.map +1 -0
  109. package/dist/cli/commands/init.js +326 -0
  110. package/dist/cli/commands/init.js.map +1 -0
  111. package/dist/cli/commands/init.types.d.ts +141 -0
  112. package/dist/cli/commands/init.types.d.ts.map +1 -0
  113. package/dist/cli/commands/init.types.js +24 -0
  114. package/dist/cli/commands/init.types.js.map +1 -0
  115. package/dist/cli/commands/login.d.ts +40 -0
  116. package/dist/cli/commands/login.d.ts.map +1 -0
  117. package/dist/cli/commands/login.js +174 -0
  118. package/dist/cli/commands/login.js.map +1 -0
  119. package/dist/cli/commands/next.d.ts +16 -0
  120. package/dist/cli/commands/next.d.ts.map +1 -0
  121. package/dist/cli/commands/next.js +279 -0
  122. package/dist/cli/commands/next.js.map +1 -0
  123. package/dist/cli/commands/next.types.d.ts +191 -0
  124. package/dist/cli/commands/next.types.d.ts.map +1 -0
  125. package/dist/cli/commands/next.types.js +129 -0
  126. package/dist/cli/commands/next.types.js.map +1 -0
  127. package/dist/cli/commands/projects.d.ts +16 -0
  128. package/dist/cli/commands/projects.d.ts.map +1 -0
  129. package/dist/cli/commands/projects.js +149 -0
  130. package/dist/cli/commands/projects.js.map +1 -0
  131. package/dist/cli/commands/projects.types.d.ts +81 -0
  132. package/dist/cli/commands/projects.types.d.ts.map +1 -0
  133. package/dist/cli/commands/projects.types.js +35 -0
  134. package/dist/cli/commands/projects.types.js.map +1 -0
  135. package/dist/cli/commands/review/display.d.ts +33 -0
  136. package/dist/cli/commands/review/display.d.ts.map +1 -0
  137. package/dist/cli/commands/review/display.js +159 -0
  138. package/dist/cli/commands/review/display.js.map +1 -0
  139. package/dist/cli/commands/review/epic-review.d.ts +13 -0
  140. package/dist/cli/commands/review/epic-review.d.ts.map +1 -0
  141. package/dist/cli/commands/review/epic-review.js +69 -0
  142. package/dist/cli/commands/review/epic-review.js.map +1 -0
  143. package/dist/cli/commands/review/index.d.ts +13 -0
  144. package/dist/cli/commands/review/index.d.ts.map +1 -0
  145. package/dist/cli/commands/review/index.js +17 -0
  146. package/dist/cli/commands/review/index.js.map +1 -0
  147. package/dist/cli/commands/review/report.d.ts +31 -0
  148. package/dist/cli/commands/review/report.d.ts.map +1 -0
  149. package/dist/cli/commands/review/report.js +146 -0
  150. package/dist/cli/commands/review/report.js.map +1 -0
  151. package/dist/cli/commands/review/review.d.ts +17 -0
  152. package/dist/cli/commands/review/review.d.ts.map +1 -0
  153. package/dist/cli/commands/review/review.js +129 -0
  154. package/dist/cli/commands/review/review.js.map +1 -0
  155. package/dist/cli/commands/review/spec-review.d.ts +13 -0
  156. package/dist/cli/commands/review/spec-review.d.ts.map +1 -0
  157. package/dist/cli/commands/review/spec-review.js +65 -0
  158. package/dist/cli/commands/review/spec-review.js.map +1 -0
  159. package/dist/cli/commands/review/ticket-review.d.ts +37 -0
  160. package/dist/cli/commands/review/ticket-review.d.ts.map +1 -0
  161. package/dist/cli/commands/review/ticket-review.js +194 -0
  162. package/dist/cli/commands/review/ticket-review.js.map +1 -0
  163. package/dist/cli/commands/review/types.d.ts +232 -0
  164. package/dist/cli/commands/review/types.d.ts.map +1 -0
  165. package/dist/cli/commands/review/types.js +85 -0
  166. package/dist/cli/commands/review/types.js.map +1 -0
  167. package/dist/cli/commands/scaffold/display.d.ts +27 -0
  168. package/dist/cli/commands/scaffold/display.d.ts.map +1 -0
  169. package/dist/cli/commands/scaffold/display.js +90 -0
  170. package/dist/cli/commands/scaffold/display.js.map +1 -0
  171. package/dist/cli/commands/scaffold/index.d.ts +12 -0
  172. package/dist/cli/commands/scaffold/index.d.ts.map +1 -0
  173. package/dist/cli/commands/scaffold/index.js +12 -0
  174. package/dist/cli/commands/scaffold/index.js.map +1 -0
  175. package/dist/cli/commands/scaffold/register.d.ts +11 -0
  176. package/dist/cli/commands/scaffold/register.d.ts.map +1 -0
  177. package/dist/cli/commands/scaffold/register.js +25 -0
  178. package/dist/cli/commands/scaffold/register.js.map +1 -0
  179. package/dist/cli/commands/scaffold/scaffold.d.ts +11 -0
  180. package/dist/cli/commands/scaffold/scaffold.d.ts.map +1 -0
  181. package/dist/cli/commands/scaffold/scaffold.js +111 -0
  182. package/dist/cli/commands/scaffold/scaffold.js.map +1 -0
  183. package/dist/cli/commands/scaffold/targets.d.ts +31 -0
  184. package/dist/cli/commands/scaffold/targets.d.ts.map +1 -0
  185. package/dist/cli/commands/scaffold/targets.js +84 -0
  186. package/dist/cli/commands/scaffold/targets.js.map +1 -0
  187. package/dist/cli/commands/scaffold/types.d.ts +88 -0
  188. package/dist/cli/commands/scaffold/types.d.ts.map +1 -0
  189. package/dist/cli/commands/scaffold/types.js +21 -0
  190. package/dist/cli/commands/scaffold/types.js.map +1 -0
  191. package/dist/cli/commands/scaffold/utils.d.ts +31 -0
  192. package/dist/cli/commands/scaffold/utils.d.ts.map +1 -0
  193. package/dist/cli/commands/scaffold/utils.js +71 -0
  194. package/dist/cli/commands/scaffold/utils.js.map +1 -0
  195. package/dist/cli/commands/session/display.d.ts +40 -0
  196. package/dist/cli/commands/session/display.d.ts.map +1 -0
  197. package/dist/cli/commands/session/display.js +114 -0
  198. package/dist/cli/commands/session/display.js.map +1 -0
  199. package/dist/cli/commands/session/end.d.ts +12 -0
  200. package/dist/cli/commands/session/end.d.ts.map +1 -0
  201. package/dist/cli/commands/session/end.js +165 -0
  202. package/dist/cli/commands/session/end.js.map +1 -0
  203. package/dist/cli/commands/session/index.d.ts +13 -0
  204. package/dist/cli/commands/session/index.d.ts.map +1 -0
  205. package/dist/cli/commands/session/index.js +13 -0
  206. package/dist/cli/commands/session/index.js.map +1 -0
  207. package/dist/cli/commands/session/register.d.ts +12 -0
  208. package/dist/cli/commands/session/register.d.ts.map +1 -0
  209. package/dist/cli/commands/session/register.js +87 -0
  210. package/dist/cli/commands/session/register.js.map +1 -0
  211. package/dist/cli/commands/session/start.d.ts +12 -0
  212. package/dist/cli/commands/session/start.d.ts.map +1 -0
  213. package/dist/cli/commands/session/start.js +189 -0
  214. package/dist/cli/commands/session/start.js.map +1 -0
  215. package/dist/cli/commands/session/status.d.ts +12 -0
  216. package/dist/cli/commands/session/status.d.ts.map +1 -0
  217. package/dist/cli/commands/session/status.js +93 -0
  218. package/dist/cli/commands/session/status.js.map +1 -0
  219. package/dist/cli/commands/session/types.d.ts +179 -0
  220. package/dist/cli/commands/session/types.d.ts.map +1 -0
  221. package/dist/cli/commands/session/types.js +8 -0
  222. package/dist/cli/commands/session/types.js.map +1 -0
  223. package/dist/cli/commands/session/utils.d.ts +24 -0
  224. package/dist/cli/commands/session/utils.d.ts.map +1 -0
  225. package/dist/cli/commands/session/utils.js +72 -0
  226. package/dist/cli/commands/session/utils.js.map +1 -0
  227. package/dist/cli/commands/specs.d.ts +16 -0
  228. package/dist/cli/commands/specs.d.ts.map +1 -0
  229. package/dist/cli/commands/specs.js +212 -0
  230. package/dist/cli/commands/specs.js.map +1 -0
  231. package/dist/cli/commands/specs.types.d.ts +120 -0
  232. package/dist/cli/commands/specs.types.d.ts.map +1 -0
  233. package/dist/cli/commands/specs.types.js +75 -0
  234. package/dist/cli/commands/specs.types.js.map +1 -0
  235. package/dist/cli/commands/status.d.ts +17 -0
  236. package/dist/cli/commands/status.d.ts.map +1 -0
  237. package/dist/cli/commands/status.js +271 -0
  238. package/dist/cli/commands/status.js.map +1 -0
  239. package/dist/cli/commands/status.types.d.ts +382 -0
  240. package/dist/cli/commands/status.types.d.ts.map +1 -0
  241. package/dist/cli/commands/status.types.js +166 -0
  242. package/dist/cli/commands/status.types.js.map +1 -0
  243. package/dist/cli/commands/switch.d.ts +18 -0
  244. package/dist/cli/commands/switch.d.ts.map +1 -0
  245. package/dist/cli/commands/switch.js +181 -0
  246. package/dist/cli/commands/switch.js.map +1 -0
  247. package/dist/cli/commands/switch.types.d.ts +123 -0
  248. package/dist/cli/commands/switch.types.d.ts.map +1 -0
  249. package/dist/cli/commands/switch.types.js +65 -0
  250. package/dist/cli/commands/switch.types.js.map +1 -0
  251. package/dist/cli/commands/ticket/command.d.ts +14 -0
  252. package/dist/cli/commands/ticket/command.d.ts.map +1 -0
  253. package/dist/cli/commands/ticket/command.js +141 -0
  254. package/dist/cli/commands/ticket/command.js.map +1 -0
  255. package/dist/cli/commands/ticket/display.d.ts +56 -0
  256. package/dist/cli/commands/ticket/display.d.ts.map +1 -0
  257. package/dist/cli/commands/ticket/display.js +205 -0
  258. package/dist/cli/commands/ticket/display.js.map +1 -0
  259. package/dist/cli/commands/ticket/index.d.ts +11 -0
  260. package/dist/cli/commands/ticket/index.d.ts.map +1 -0
  261. package/dist/cli/commands/ticket/index.js +11 -0
  262. package/dist/cli/commands/ticket/index.js.map +1 -0
  263. package/dist/cli/commands/ticket/register.d.ts +11 -0
  264. package/dist/cli/commands/ticket/register.d.ts.map +1 -0
  265. package/dist/cli/commands/ticket/register.js +39 -0
  266. package/dist/cli/commands/ticket/register.js.map +1 -0
  267. package/dist/cli/commands/ticket/resolver.d.ts +16 -0
  268. package/dist/cli/commands/ticket/resolver.d.ts.map +1 -0
  269. package/dist/cli/commands/ticket/resolver.js +35 -0
  270. package/dist/cli/commands/ticket/resolver.js.map +1 -0
  271. package/dist/cli/commands/ticket/types.d.ts +157 -0
  272. package/dist/cli/commands/ticket/types.d.ts.map +1 -0
  273. package/dist/cli/commands/ticket/types.js +8 -0
  274. package/dist/cli/commands/ticket/types.js.map +1 -0
  275. package/dist/cli/commands/tickets.d.ts +16 -0
  276. package/dist/cli/commands/tickets.d.ts.map +1 -0
  277. package/dist/cli/commands/tickets.js +271 -0
  278. package/dist/cli/commands/tickets.js.map +1 -0
  279. package/dist/cli/commands/tickets.types.d.ts +202 -0
  280. package/dist/cli/commands/tickets.types.d.ts.map +1 -0
  281. package/dist/cli/commands/tickets.types.js +138 -0
  282. package/dist/cli/commands/tickets.types.js.map +1 -0
  283. package/dist/cli/config/index.d.ts +11 -0
  284. package/dist/cli/config/index.d.ts.map +1 -0
  285. package/dist/cli/config/index.js +11 -0
  286. package/dist/cli/config/index.js.map +1 -0
  287. package/dist/cli/config/loader.d.ts +98 -0
  288. package/dist/cli/config/loader.d.ts.map +1 -0
  289. package/dist/cli/config/loader.js +237 -0
  290. package/dist/cli/config/loader.js.map +1 -0
  291. package/dist/cli/config/paths.d.ts +96 -0
  292. package/dist/cli/config/paths.d.ts.map +1 -0
  293. package/dist/cli/config/paths.js +140 -0
  294. package/dist/cli/config/paths.js.map +1 -0
  295. package/dist/cli/config/types.d.ts +148 -0
  296. package/dist/cli/config/types.d.ts.map +1 -0
  297. package/dist/cli/config/types.js +34 -0
  298. package/dist/cli/config/types.js.map +1 -0
  299. package/dist/cli/config/writer.d.ts +171 -0
  300. package/dist/cli/config/writer.d.ts.map +1 -0
  301. package/dist/cli/config/writer.js +312 -0
  302. package/dist/cli/config/writer.js.map +1 -0
  303. package/dist/cli/index.d.ts +30 -0
  304. package/dist/cli/index.d.ts.map +1 -0
  305. package/dist/cli/index.js +183 -0
  306. package/dist/cli/index.js.map +1 -0
  307. package/dist/cli/middleware/auth-guard.d.ts +107 -0
  308. package/dist/cli/middleware/auth-guard.d.ts.map +1 -0
  309. package/dist/cli/middleware/auth-guard.js +190 -0
  310. package/dist/cli/middleware/auth-guard.js.map +1 -0
  311. package/dist/cli/middleware/error-handler.d.ts +133 -0
  312. package/dist/cli/middleware/error-handler.d.ts.map +1 -0
  313. package/dist/cli/middleware/error-handler.js +209 -0
  314. package/dist/cli/middleware/error-handler.js.map +1 -0
  315. package/dist/cli/middleware/index.d.ts +6 -0
  316. package/dist/cli/middleware/index.d.ts.map +1 -0
  317. package/dist/cli/middleware/index.js +6 -0
  318. package/dist/cli/middleware/index.js.map +1 -0
  319. package/dist/cli/templates/commands.d.ts +20 -0
  320. package/dist/cli/templates/commands.d.ts.map +1 -0
  321. package/dist/cli/templates/commands.js +174 -0
  322. package/dist/cli/templates/commands.js.map +1 -0
  323. package/dist/cli/templates/content/sf-autonomous.d.ts +7 -0
  324. package/dist/cli/templates/content/sf-autonomous.d.ts.map +1 -0
  325. package/dist/cli/templates/content/sf-autonomous.js +78 -0
  326. package/dist/cli/templates/content/sf-autonomous.js.map +1 -0
  327. package/dist/cli/templates/content/sf-blockers.d.ts +7 -0
  328. package/dist/cli/templates/content/sf-blockers.d.ts.map +1 -0
  329. package/dist/cli/templates/content/sf-blockers.js +68 -0
  330. package/dist/cli/templates/content/sf-blockers.js.map +1 -0
  331. package/dist/cli/templates/content/sf-commit.d.ts +7 -0
  332. package/dist/cli/templates/content/sf-commit.d.ts.map +1 -0
  333. package/dist/cli/templates/content/sf-commit.js +78 -0
  334. package/dist/cli/templates/content/sf-commit.js.map +1 -0
  335. package/dist/cli/templates/content/sf-context.d.ts +7 -0
  336. package/dist/cli/templates/content/sf-context.d.ts.map +1 -0
  337. package/dist/cli/templates/content/sf-context.js +64 -0
  338. package/dist/cli/templates/content/sf-context.js.map +1 -0
  339. package/dist/cli/templates/content/sf-create-epics.d.ts +7 -0
  340. package/dist/cli/templates/content/sf-create-epics.d.ts.map +1 -0
  341. package/dist/cli/templates/content/sf-create-epics.js +70 -0
  342. package/dist/cli/templates/content/sf-create-epics.js.map +1 -0
  343. package/dist/cli/templates/content/sf-create-spec.d.ts +7 -0
  344. package/dist/cli/templates/content/sf-create-spec.d.ts.map +1 -0
  345. package/dist/cli/templates/content/sf-create-spec.js +67 -0
  346. package/dist/cli/templates/content/sf-create-spec.js.map +1 -0
  347. package/dist/cli/templates/content/sf-create-tickets.d.ts +7 -0
  348. package/dist/cli/templates/content/sf-create-tickets.d.ts.map +1 -0
  349. package/dist/cli/templates/content/sf-create-tickets.js +76 -0
  350. package/dist/cli/templates/content/sf-create-tickets.js.map +1 -0
  351. package/dist/cli/templates/content/sf-epic.d.ts +7 -0
  352. package/dist/cli/templates/content/sf-epic.d.ts.map +1 -0
  353. package/dist/cli/templates/content/sf-epic.js +69 -0
  354. package/dist/cli/templates/content/sf-epic.js.map +1 -0
  355. package/dist/cli/templates/content/sf-help.d.ts +7 -0
  356. package/dist/cli/templates/content/sf-help.d.ts.map +1 -0
  357. package/dist/cli/templates/content/sf-help.js +61 -0
  358. package/dist/cli/templates/content/sf-help.js.map +1 -0
  359. package/dist/cli/templates/content/sf-import.d.ts +7 -0
  360. package/dist/cli/templates/content/sf-import.d.ts.map +1 -0
  361. package/dist/cli/templates/content/sf-import.js +88 -0
  362. package/dist/cli/templates/content/sf-import.js.map +1 -0
  363. package/dist/cli/templates/content/sf-init.d.ts +7 -0
  364. package/dist/cli/templates/content/sf-init.d.ts.map +1 -0
  365. package/dist/cli/templates/content/sf-init.js +61 -0
  366. package/dist/cli/templates/content/sf-init.js.map +1 -0
  367. package/dist/cli/templates/content/sf-next.d.ts +7 -0
  368. package/dist/cli/templates/content/sf-next.d.ts.map +1 -0
  369. package/dist/cli/templates/content/sf-next.js +67 -0
  370. package/dist/cli/templates/content/sf-next.js.map +1 -0
  371. package/dist/cli/templates/content/sf-reset.d.ts +7 -0
  372. package/dist/cli/templates/content/sf-reset.d.ts.map +1 -0
  373. package/dist/cli/templates/content/sf-reset.js +78 -0
  374. package/dist/cli/templates/content/sf-reset.js.map +1 -0
  375. package/dist/cli/templates/content/sf-review.d.ts +7 -0
  376. package/dist/cli/templates/content/sf-review.d.ts.map +1 -0
  377. package/dist/cli/templates/content/sf-review.js +67 -0
  378. package/dist/cli/templates/content/sf-review.js.map +1 -0
  379. package/dist/cli/templates/content/sf-search.d.ts +7 -0
  380. package/dist/cli/templates/content/sf-search.d.ts.map +1 -0
  381. package/dist/cli/templates/content/sf-search.js +64 -0
  382. package/dist/cli/templates/content/sf-search.js.map +1 -0
  383. package/dist/cli/templates/content/sf-status.d.ts +7 -0
  384. package/dist/cli/templates/content/sf-status.d.ts.map +1 -0
  385. package/dist/cli/templates/content/sf-status.js +67 -0
  386. package/dist/cli/templates/content/sf-status.js.map +1 -0
  387. package/dist/cli/templates/content/sf-ticket.d.ts +7 -0
  388. package/dist/cli/templates/content/sf-ticket.d.ts.map +1 -0
  389. package/dist/cli/templates/content/sf-ticket.js +76 -0
  390. package/dist/cli/templates/content/sf-ticket.js.map +1 -0
  391. package/dist/cli/templates/content/sf-validate.d.ts +7 -0
  392. package/dist/cli/templates/content/sf-validate.d.ts.map +1 -0
  393. package/dist/cli/templates/content/sf-validate.js +78 -0
  394. package/dist/cli/templates/content/sf-validate.js.map +1 -0
  395. package/dist/cli/templates/index.d.ts +7 -0
  396. package/dist/cli/templates/index.d.ts.map +1 -0
  397. package/dist/cli/templates/index.js +7 -0
  398. package/dist/cli/templates/index.js.map +1 -0
  399. package/dist/cli/ui/colors.d.ts +76 -0
  400. package/dist/cli/ui/colors.d.ts.map +1 -0
  401. package/dist/cli/ui/colors.js +81 -0
  402. package/dist/cli/ui/colors.js.map +1 -0
  403. package/dist/cli/ui/dashboard.d.ts +54 -0
  404. package/dist/cli/ui/dashboard.d.ts.map +1 -0
  405. package/dist/cli/ui/dashboard.js +339 -0
  406. package/dist/cli/ui/dashboard.js.map +1 -0
  407. package/dist/cli/ui/index.d.ts +7 -0
  408. package/dist/cli/ui/index.d.ts.map +1 -0
  409. package/dist/cli/ui/index.js +7 -0
  410. package/dist/cli/ui/index.js.map +1 -0
  411. package/dist/cli/ui/output.d.ts +117 -0
  412. package/dist/cli/ui/output.d.ts.map +1 -0
  413. package/dist/cli/ui/output.js +172 -0
  414. package/dist/cli/ui/output.js.map +1 -0
  415. package/dist/cli/ui/spinner.d.ts +105 -0
  416. package/dist/cli/ui/spinner.d.ts.map +1 -0
  417. package/dist/cli/ui/spinner.js +148 -0
  418. package/dist/cli/ui/spinner.js.map +1 -0
  419. package/dist/cli/ui/time.d.ts +54 -0
  420. package/dist/cli/ui/time.d.ts.map +1 -0
  421. package/dist/cli/ui/time.js +173 -0
  422. package/dist/cli/ui/time.js.map +1 -0
  423. package/dist/lib/format.d.ts +4 -4
  424. package/dist/lib/format.js +5 -5
  425. package/dist/server.js +8 -8
  426. package/dist/server.js.map +1 -1
  427. package/dist/tools/core/session.js +6 -6
  428. package/dist/tools/core/session.js.map +1 -1
  429. package/dist/tools/index.js +9 -9
  430. package/dist/tools/index.js.map +1 -1
  431. package/dist/validation/index.js +1 -1
  432. package/dist/validation/index.js.map +1 -1
  433. package/package.json +9 -2
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Login Command
3
+ *
4
+ * Authenticates users with their SpecForge API key.
5
+ * Supports both interactive (masked input) and non-interactive (--api-key flag) modes.
6
+ */
7
+ import inquirer from 'inquirer';
8
+ import chalk from 'chalk';
9
+ import ora from 'ora';
10
+ import { saveGlobalConfig } from '../config/writer.js';
11
+ import { loadGlobalConfig } from '../config/loader.js';
12
+ import { validateApiKeyFormat } from '../middleware/auth-guard.js';
13
+ import { withErrorHandler, NetworkError, ValidationError } from '../middleware/error-handler.js';
14
+ import { printSuccess, printWarning, printHint, printBlank } from '../ui/output.js';
15
+ import { ApiClient } from '../../client/api-client.js';
16
+ import { CONFIG_DEFAULTS } from '../config/types.js';
17
+ /**
18
+ * Prompt user for API key with masked input
19
+ *
20
+ * @returns Promise resolving to the entered API key
21
+ */
22
+ async function promptForApiKey() {
23
+ const answers = await inquirer.prompt([
24
+ {
25
+ type: 'password',
26
+ name: 'apiKey',
27
+ message: 'Enter your API key:',
28
+ mask: '*',
29
+ validate: (input) => {
30
+ if (!input || input.trim() === '') {
31
+ return 'API key is required';
32
+ }
33
+ const validation = validateApiKeyFormat(input);
34
+ if (!validation.valid) {
35
+ return validation.error || 'Invalid API key format';
36
+ }
37
+ return true;
38
+ },
39
+ },
40
+ ]);
41
+ return answers.apiKey;
42
+ }
43
+ /**
44
+ * Validate API key against the backend and retrieve user info
45
+ *
46
+ * @param apiKey - API key to validate
47
+ * @returns Promise resolving to user information
48
+ * @throws NetworkError if connection fails
49
+ * @throws ValidationError if API key is invalid
50
+ */
51
+ async function validateApiKeyWithBackend(apiKey) {
52
+ const client = new ApiClient({
53
+ apiKey,
54
+ apiUrl: process.env.SPECFORGE_API_URL || CONFIG_DEFAULTS.apiUrl,
55
+ debug: process.env.SPECFORGE_DEBUG === 'true',
56
+ });
57
+ try {
58
+ const result = await client.validateApiKey();
59
+ if (!result.valid) {
60
+ throw new ValidationError(result.message || 'API key validation failed', 'Make sure you copied the complete API key from SpecForge');
61
+ }
62
+ // Get user info - for now we'll use userId as identifier
63
+ // In a real implementation, the API would return user details
64
+ return {
65
+ email: result.userId || 'user',
66
+ userId: result.userId,
67
+ };
68
+ }
69
+ catch (error) {
70
+ // Handle specific error types
71
+ if (error instanceof ValidationError) {
72
+ throw error;
73
+ }
74
+ const message = error instanceof Error ? error.message : String(error);
75
+ // Network errors
76
+ if (message.includes('ENOTFOUND') || message.includes('ECONNREFUSED') || message.includes('fetch failed')) {
77
+ throw new NetworkError('Could not connect to SpecForge API', 'Check your internet connection and try again');
78
+ }
79
+ // Authentication errors
80
+ if (message.includes('401') || message.includes('Unauthorized')) {
81
+ throw new ValidationError('Invalid API key', 'Get a valid API key from https://specforge.com.br/settings/api-keys');
82
+ }
83
+ // Rate limiting
84
+ if (message.includes('429') || message.includes('rate limit')) {
85
+ throw new NetworkError('Rate limit exceeded', 'Wait a moment and try again');
86
+ }
87
+ // Unknown errors
88
+ throw new NetworkError(`API error: ${message}`, 'If the problem persists, check https://status.specforge.com');
89
+ }
90
+ }
91
+ /**
92
+ * Login command implementation
93
+ *
94
+ * @param options - Command options
95
+ */
96
+ export async function loginAction(options) {
97
+ const existingConfig = loadGlobalConfig();
98
+ // Check if already logged in
99
+ if (existingConfig.apiKey && !options.force) {
100
+ printBlank();
101
+ printWarning('You are already authenticated.');
102
+ console.log(`Use ${chalk.cyan('specforge-mcp login --force')} to re-authenticate with a different API key.`);
103
+ printBlank();
104
+ return;
105
+ }
106
+ // Header
107
+ printBlank();
108
+ console.log(chalk.bold('SpecForge Authentication'));
109
+ console.log(chalk.gray('─'.repeat(24)));
110
+ printBlank();
111
+ // Get API key
112
+ let apiKey;
113
+ if (options.apiKey) {
114
+ // Non-interactive mode
115
+ apiKey = options.apiKey;
116
+ // Validate format first
117
+ const formatValidation = validateApiKeyFormat(apiKey);
118
+ if (!formatValidation.valid) {
119
+ throw new ValidationError(formatValidation.error || 'Invalid API key format', 'API key should start with "sf_live_" and be at least 28 characters');
120
+ }
121
+ }
122
+ else {
123
+ // Interactive mode - prompt for API key
124
+ console.log(chalk.gray('Get your API key from: ') + chalk.cyan.underline('https://specforge.com.br/settings/api-keys'));
125
+ printBlank();
126
+ apiKey = await promptForApiKey();
127
+ }
128
+ // Validate against backend
129
+ const spinner = ora({
130
+ text: 'Validating API key...',
131
+ color: 'cyan',
132
+ }).start();
133
+ try {
134
+ const userInfo = await validateApiKeyWithBackend(apiKey);
135
+ spinner.succeed(`Authenticated as ${chalk.cyan(userInfo.email)}`);
136
+ // Save to global config
137
+ saveGlobalConfig({ apiKey });
138
+ printBlank();
139
+ printSuccess('API key saved to ~/.specforge/config.json');
140
+ printBlank();
141
+ // Next steps
142
+ console.log(chalk.bold('Next steps:'));
143
+ printHint('specforge-mcp init', 'initialize SpecForge in your project');
144
+ printHint('specforge-mcp status', 'check your current configuration');
145
+ printBlank();
146
+ }
147
+ catch (error) {
148
+ spinner.fail('Authentication failed');
149
+ throw error;
150
+ }
151
+ }
152
+ /**
153
+ * Register login command with Commander
154
+ *
155
+ * @param program - Commander program instance
156
+ */
157
+ export function registerLoginCommand(program) {
158
+ program
159
+ .command('login')
160
+ .description('Authenticate with SpecForge API')
161
+ .option('--api-key <key>', 'Provide API key non-interactively (for CI/scripts)')
162
+ .option('-f, --force', 'Overwrite existing authentication')
163
+ .addHelpText('after', `
164
+ Examples:
165
+ $ specforge-mcp login # Interactive login (recommended)
166
+ $ specforge-mcp login --api-key <key> # Non-interactive login
167
+ $ specforge-mcp login --force # Re-authenticate with new key
168
+
169
+ Get your API key:
170
+ https://specforge.com.br/settings/api-keys
171
+ `)
172
+ .action(withErrorHandler(loginAction));
173
+ }
174
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/cli/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD;;;;GAIG;AACH,KAAK,UAAU,eAAe;IAC5B,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACpC;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,qBAAqB;YAC9B,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC1B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;oBAClC,OAAO,qBAAqB,CAAC;gBAC/B,CAAC;gBAED,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC/C,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;oBACtB,OAAO,UAAU,CAAC,KAAK,IAAI,wBAAwB,CAAC;gBACtD,CAAC;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;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACtC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,iBAAiB,EAAE,oDAAoD,CAAC;SAC/E,MAAM,CAAC,aAAa,EAAE,mCAAmC,CAAC;SAC1D,WAAW,CAAC,OAAO,EAAE;;;;;;;;CAQzB,CAAC;SACG,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Next Command
3
+ *
4
+ * Displays the next actionable ticket with full details.
5
+ */
6
+ import { Command } from 'commander';
7
+ import { NextOptions } from './next.types.js';
8
+ /**
9
+ * Next command action handler
10
+ */
11
+ export declare function nextAction(options: NextOptions): Promise<void>;
12
+ /**
13
+ * Register next command with Commander
14
+ */
15
+ export declare function registerNextCommand(program: Command): void;
16
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/next.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,EACL,WAAW,EAQZ,MAAM,iBAAiB,CAAC;AAoLzB;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6GpE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB1D"}
@@ -0,0 +1,279 @@
1
+ /**
2
+ * Next Command
3
+ *
4
+ * Displays the next actionable ticket with full details.
5
+ */
6
+ import ora from 'ora';
7
+ import { resolveConfig } from '../config/index.js';
8
+ import { withErrorHandler, CliError, NetworkError } from '../middleware/error-handler.js';
9
+ import { printBlank } from '../ui/output.js';
10
+ import { colors } from '../ui/colors.js';
11
+ import { ApiClient } from '../../client/api-client.js';
12
+ import { formatTicketId, wrapText, areDependenciesSatisfied, formatDependenciesStatus, TICKET_CARD_WIDTH, } from './next.types.js';
13
+ /**
14
+ * Get chalk color function for priority
15
+ */
16
+ function getPriorityColorFn(priority) {
17
+ switch (priority) {
18
+ case 'critical':
19
+ return colors.error;
20
+ case 'high':
21
+ return colors.warning;
22
+ case 'medium':
23
+ return colors.primary;
24
+ case 'low':
25
+ return colors.muted;
26
+ default:
27
+ return (s) => s;
28
+ }
29
+ }
30
+ /**
31
+ * Get chalk color function for complexity
32
+ */
33
+ function getComplexityColorFn(complexity) {
34
+ switch (complexity) {
35
+ case 'trivial':
36
+ return colors.muted;
37
+ case 'low':
38
+ return colors.success;
39
+ case 'medium':
40
+ return colors.primary;
41
+ case 'high':
42
+ return colors.warning;
43
+ case 'complex':
44
+ return colors.error;
45
+ default:
46
+ return (s) => s;
47
+ }
48
+ }
49
+ /**
50
+ * Display full ticket card with box drawing
51
+ */
52
+ function displayTicketCard(ticket) {
53
+ const width = TICKET_CARD_WIDTH;
54
+ const border = '─'.repeat(width);
55
+ const innerWidth = width - 2;
56
+ printBlank();
57
+ // Top border and title
58
+ console.log(`┌${border}┐`);
59
+ const titleLine = `${formatTicketId(ticket.ticketNumber)}: ${ticket.title}`;
60
+ const truncatedTitle = titleLine.length > innerWidth
61
+ ? titleLine.slice(0, innerWidth - 3) + '...'
62
+ : titleLine;
63
+ console.log(`│ ${colors.bold(truncatedTitle).padEnd(innerWidth + 10)} │`);
64
+ console.log(`├${border}┤`);
65
+ // Priority and Complexity row
66
+ const priorityColor = getPriorityColorFn(ticket.priority);
67
+ const priorityText = `Priority: ${priorityColor(ticket.priority)}`;
68
+ let complexityText = '';
69
+ if (ticket.complexity) {
70
+ const complexityColor = getComplexityColorFn(ticket.complexity);
71
+ complexityText = `Complexity: ${complexityColor(ticket.complexity)}`;
72
+ }
73
+ const row1Left = priorityText.padEnd(28);
74
+ const row1Right = complexityText;
75
+ console.log(`│ ${row1Left} ${row1Right.padEnd(innerWidth - 29)} │`);
76
+ // Estimated hours and Dependencies row
77
+ let estimatedText = '';
78
+ if (ticket.estimatedHours) {
79
+ estimatedText = `Estimated: ${ticket.estimatedHours}h`;
80
+ }
81
+ const depsStatus = formatDependenciesStatus(ticket.dependencies);
82
+ const depsSatisfied = areDependenciesSatisfied(ticket.dependencies);
83
+ const depsColorFn = depsSatisfied ? colors.success : colors.warning;
84
+ const depsDisplay = depsStatus === 'none'
85
+ ? colors.muted(depsStatus)
86
+ : depsColorFn(depsStatus);
87
+ const depsText = `Dependencies: ${depsDisplay}`;
88
+ const row2Left = estimatedText.padEnd(28);
89
+ console.log(`│ ${row2Left} ${depsText.padEnd(innerWidth - 19)} │`);
90
+ // Epic info if available
91
+ if (ticket.epicTitle) {
92
+ console.log(`│ Epic: ${colors.muted(ticket.epicTitle).padEnd(innerWidth + 4)} │`);
93
+ }
94
+ console.log(`├${border}┤`);
95
+ // Description
96
+ if (ticket.description) {
97
+ console.log(`│ ${colors.muted('Description:').padEnd(innerWidth + 10)} │`);
98
+ const descLines = wrapText(ticket.description, innerWidth - 1);
99
+ for (const line of descLines.slice(0, 5)) { // Limit to 5 lines
100
+ console.log(`│ ${line.padEnd(innerWidth)} │`);
101
+ }
102
+ if (descLines.length > 5) {
103
+ console.log(`│ ${colors.muted('...').padEnd(innerWidth)} │`);
104
+ }
105
+ console.log(`├${border}┤`);
106
+ }
107
+ // Acceptance Criteria
108
+ if (ticket.acceptanceCriteria && ticket.acceptanceCriteria.length > 0) {
109
+ console.log(`│ ${colors.muted('Acceptance Criteria:').padEnd(innerWidth + 10)} │`);
110
+ for (const criterion of ticket.acceptanceCriteria.slice(0, 8)) { // Limit to 8 items
111
+ const lines = wrapText(`□ ${criterion}`, innerWidth - 1);
112
+ for (const line of lines) {
113
+ console.log(`│ ${line.padEnd(innerWidth)} │`);
114
+ }
115
+ }
116
+ if (ticket.acceptanceCriteria.length > 8) {
117
+ console.log(`│ ${colors.muted(` ... and ${ticket.acceptanceCriteria.length - 8} more`).padEnd(innerWidth)} │`);
118
+ }
119
+ }
120
+ // Bottom border
121
+ console.log(`└${border}┘`);
122
+ printBlank();
123
+ console.log(colors.muted('Start working? Run: specforge-mcp session start'));
124
+ printBlank();
125
+ }
126
+ /**
127
+ * Display brief format (just ID and title)
128
+ */
129
+ function displayBrief(ticket) {
130
+ printBlank();
131
+ console.log(`${formatTicketId(ticket.ticketNumber)} - ${ticket.title}`);
132
+ printBlank();
133
+ }
134
+ /**
135
+ * Format ticket as TOON
136
+ */
137
+ function formatNextAsToon(ticket) {
138
+ const lines = ['@next'];
139
+ lines.push(` ${formatTicketId(ticket.ticketNumber)}`);
140
+ lines.push(` title: ${ticket.title}`);
141
+ lines.push(` priority: ${ticket.priority}`);
142
+ if (ticket.complexity) {
143
+ lines.push(` complexity: ${ticket.complexity}`);
144
+ }
145
+ if (ticket.estimatedHours) {
146
+ lines.push(` estimated: ${ticket.estimatedHours}h`);
147
+ }
148
+ lines.push(` dependencies: ${formatDependenciesStatus(ticket.dependencies)}`);
149
+ if (ticket.description) {
150
+ lines.push(` description: ${ticket.description.slice(0, 100)}${ticket.description.length > 100 ? '...' : ''}`);
151
+ }
152
+ if (ticket.acceptanceCriteria && ticket.acceptanceCriteria.length > 0) {
153
+ lines.push(' acceptanceCriteria:');
154
+ for (const criterion of ticket.acceptanceCriteria) {
155
+ lines.push(` - ${criterion}`);
156
+ }
157
+ }
158
+ return lines.join('\n');
159
+ }
160
+ /**
161
+ * Display empty state
162
+ */
163
+ function displayEmptyState() {
164
+ printBlank();
165
+ console.log(colors.muted('No actionable tickets found.'));
166
+ console.log(colors.muted('All tickets may be completed, blocked, or in progress.'));
167
+ printBlank();
168
+ console.log(colors.muted('Check status with: specforge-mcp tickets'));
169
+ printBlank();
170
+ }
171
+ /**
172
+ * Next command action handler
173
+ */
174
+ export async function nextAction(options) {
175
+ const config = resolveConfig();
176
+ if (!config.apiKey) {
177
+ throw new CliError('Not authenticated', 1, 'Run `specforge-mcp login` to authenticate first');
178
+ }
179
+ if (!config.specificationId) {
180
+ throw new CliError('No specification configured', 1, "Run 'specforge-mcp init' or 'specforge-mcp switch <spec-id>' to set a specification");
181
+ }
182
+ const spinner = ora({
183
+ text: 'Finding next actionable ticket...',
184
+ color: 'cyan',
185
+ }).start();
186
+ try {
187
+ const client = new ApiClient({
188
+ apiKey: config.apiKey,
189
+ apiUrl: config.apiUrl,
190
+ debug: config.debug,
191
+ });
192
+ // Get next actionable ticket (pending, not blocked, highest priority)
193
+ const listResponse = await client.call('list_tickets', {
194
+ specificationId: config.specificationId,
195
+ status: 'pending',
196
+ limit: 1,
197
+ });
198
+ const tickets = listResponse.tickets || [];
199
+ if (tickets.length === 0) {
200
+ spinner.stop();
201
+ displayEmptyState();
202
+ return;
203
+ }
204
+ // Get full ticket details
205
+ spinner.text = 'Loading ticket details...';
206
+ const ticketId = tickets[0].id;
207
+ const detailResponse = await client.call('get_ticket', {
208
+ ticketId,
209
+ });
210
+ spinner.stop();
211
+ const ticket = {
212
+ id: detailResponse.id,
213
+ ticketNumber: detailResponse.ticketNumber,
214
+ title: detailResponse.title,
215
+ description: detailResponse.description,
216
+ priority: detailResponse.priority,
217
+ complexity: detailResponse.complexity,
218
+ estimatedHours: detailResponse.estimatedHours,
219
+ acceptanceCriteria: detailResponse.acceptanceCriteria,
220
+ epicId: detailResponse.epicId,
221
+ };
222
+ // Output based on format
223
+ if (options.json) {
224
+ console.log(JSON.stringify(ticket, null, 2));
225
+ return;
226
+ }
227
+ if (options.toon) {
228
+ console.log(formatNextAsToon(ticket));
229
+ return;
230
+ }
231
+ if (options.brief) {
232
+ displayBrief(ticket);
233
+ return;
234
+ }
235
+ // Default: full ticket card
236
+ displayTicketCard(ticket);
237
+ }
238
+ catch (error) {
239
+ spinner.fail('Failed to find next ticket');
240
+ const message = error instanceof Error ? error.message : 'Unknown error';
241
+ if (message.includes('404') || message.includes('not found')) {
242
+ throw new CliError('Specification not found', 1, 'The configured specification may have been deleted. Run `specforge-mcp init` to select a new one.');
243
+ }
244
+ if (message.includes('401') || message.includes('Unauthorized')) {
245
+ throw new CliError('Authentication failed', 1, 'Your API key may be invalid. Run `specforge-mcp login` to re-authenticate');
246
+ }
247
+ throw new NetworkError(`Failed to find next ticket: ${message}`);
248
+ }
249
+ }
250
+ /**
251
+ * Register next command with Commander
252
+ */
253
+ export function registerNextCommand(program) {
254
+ program
255
+ .command('next')
256
+ .description('Show the next actionable ticket')
257
+ .option('--json', 'Output as JSON')
258
+ .option('--toon', 'Output as TOON format')
259
+ .option('--brief', 'Show only title and ID')
260
+ .addHelpText('after', `
261
+ Examples:
262
+ $ specforge-mcp next # Show full ticket card
263
+ $ specforge-mcp next --brief # Show just ID and title
264
+ $ specforge-mcp next --json # Output as JSON
265
+
266
+ The next command finds the highest priority pending ticket that is not blocked.
267
+ It displays:
268
+ - Ticket number and title
269
+ - Priority and complexity
270
+ - Estimated hours
271
+ - Dependency status
272
+ - Description (truncated)
273
+ - Acceptance criteria
274
+
275
+ After reviewing, start working with: specforge-mcp session start
276
+ `)
277
+ .action(withErrorHandler(nextAction));
278
+ }
279
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sourceRoot":"","sources":["../../../src/cli/commands/next.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAA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