@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,166 @@
1
+ /**
2
+ * Status Command Types
3
+ *
4
+ * Type definitions for the status command working context,
5
+ * implementation session display, and dashboard analytics.
6
+ */
7
+ /**
8
+ * Format a ticket number with padding
9
+ * @param ticketNumber The ticket number
10
+ * @param prefix The prefix (default: "TKT")
11
+ * @param padding The padding length (default: 3)
12
+ */
13
+ export function formatTicketNumber(ticketNumber, prefix = 'TKT', padding = 3) {
14
+ return `${prefix}-${ticketNumber.toString().padStart(padding, '0')}`;
15
+ }
16
+ /**
17
+ * Format duration from ISO timestamp to human-readable string
18
+ * @param startedAt ISO timestamp string
19
+ */
20
+ export function formatDuration(startedAt) {
21
+ const start = new Date(startedAt);
22
+ const now = new Date();
23
+ const diffMs = now.getTime() - start.getTime();
24
+ const days = Math.floor(diffMs / (1000 * 60 * 60 * 24));
25
+ const hours = Math.floor((diffMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
26
+ const minutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60));
27
+ if (days > 0) {
28
+ return `${days}d ${hours}h ago`;
29
+ }
30
+ if (hours > 0) {
31
+ return `${hours}h ${minutes}m ago`;
32
+ }
33
+ if (minutes > 0) {
34
+ return `${minutes}m ago`;
35
+ }
36
+ return 'just now';
37
+ }
38
+ /**
39
+ * Check if working context has any data
40
+ */
41
+ export function hasWorkingContext(context) {
42
+ return !!(context.project || context.specification || context.epic || context.ticket);
43
+ }
44
+ /**
45
+ * Check if session has any activity
46
+ */
47
+ export function hasSessionActivity(session) {
48
+ return session.stats.completed > 0 || session.stats.failed > 0 || session.stats.skipped > 0;
49
+ }
50
+ /**
51
+ * Calculate session progress percentage
52
+ */
53
+ export function calculateSessionProgress(session) {
54
+ if (session.stats.total === 0)
55
+ return 0;
56
+ const processed = session.stats.completed + session.stats.failed + session.stats.skipped;
57
+ return Math.round((processed / session.stats.total) * 100);
58
+ }
59
+ /**
60
+ * Transform API response to StatusResponse
61
+ */
62
+ export function transformApiResponse(contextResponse, ticketsResponse) {
63
+ const workingContext = {
64
+ project: contextResponse.project
65
+ ? { id: contextResponse.project.id, name: contextResponse.project.name }
66
+ : undefined,
67
+ specification: contextResponse.specification
68
+ ? { id: contextResponse.specification.id, title: contextResponse.specification.title }
69
+ : undefined,
70
+ epic: contextResponse.epic
71
+ ? { id: contextResponse.epic.id, title: contextResponse.epic.title }
72
+ : undefined,
73
+ ticket: contextResponse.ticket
74
+ ? {
75
+ id: contextResponse.ticket.id,
76
+ title: contextResponse.ticket.title,
77
+ ticketNumber: contextResponse.ticket.ticketNumber,
78
+ }
79
+ : undefined,
80
+ };
81
+ let implementationSession;
82
+ if (contextResponse.implementationSession) {
83
+ const sess = contextResponse.implementationSession;
84
+ implementationSession = {
85
+ id: sess.id,
86
+ status: sess.status,
87
+ startedAt: sess.startedAt,
88
+ specificationId: sess.specificationId,
89
+ stats: {
90
+ completed: sess.completedTickets?.length || 0,
91
+ failed: sess.failedTickets?.length || 0,
92
+ skipped: sess.skippedTickets?.length || 0,
93
+ total: sess.totalTickets || 0,
94
+ },
95
+ currentTicket: sess.currentTicket
96
+ ? {
97
+ id: sess.currentTicket.id,
98
+ title: sess.currentTicket.title,
99
+ ticketNumber: sess.currentTicket.ticketNumber,
100
+ }
101
+ : undefined,
102
+ };
103
+ }
104
+ let nextActionable;
105
+ if (ticketsResponse && ticketsResponse.tickets.length > 0) {
106
+ const ticket = ticketsResponse.tickets[0];
107
+ nextActionable = {
108
+ id: ticket.id,
109
+ title: ticket.title,
110
+ ticketNumber: ticket.ticketNumber,
111
+ priority: ticket.priority,
112
+ epicTitle: ticket.epicTitle,
113
+ };
114
+ }
115
+ return {
116
+ workingContext,
117
+ implementationSession,
118
+ nextActionable,
119
+ timestamp: new Date().toISOString(),
120
+ };
121
+ }
122
+ /**
123
+ * Transform API response to DashboardData
124
+ */
125
+ export function transformToDashboardData(contextResponse, dashboardResponse) {
126
+ const dash = dashboardResponse;
127
+ return {
128
+ project: {
129
+ id: contextResponse.project?.id || '',
130
+ name: contextResponse.project?.name || '',
131
+ updatedAt: formatDuration(dash.updatedAt || new Date().toISOString()),
132
+ },
133
+ specification: {
134
+ id: contextResponse.specification?.id || '',
135
+ title: contextResponse.specification?.title || '',
136
+ status: contextResponse.specification?.status || '',
137
+ },
138
+ overallProgress: dash.overallProgress || {
139
+ total: 0,
140
+ completed: 0,
141
+ inProgress: 0,
142
+ pending: 0,
143
+ failed: 0,
144
+ blocked: 0,
145
+ percentComplete: 0,
146
+ },
147
+ timeMetrics: dash.timeMetrics || {
148
+ estimatedHours: 0,
149
+ actualHours: 0,
150
+ remainingHours: 0,
151
+ velocityPerDay: 0,
152
+ avgHoursPerTicket: 0,
153
+ onTrack: true,
154
+ estimatedCompletion: 'Unknown',
155
+ },
156
+ specifications: dash.specifications || [],
157
+ epics: dash.epics || [],
158
+ priorityDistribution: dash.priorityDistribution || { critical: 0, high: 0, medium: 0, low: 0 },
159
+ complexityDistribution: dash.complexityDistribution || { xs: 0, s: 0, m: 0, l: 0, xl: 0 },
160
+ session: dash.session,
161
+ nextActionable: dash.nextActionable || [],
162
+ blockers: dash.blockers || [],
163
+ failedTickets: dash.failedTickets || [],
164
+ };
165
+ }
166
+ //# sourceMappingURL=status.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.types.js","sourceRoot":"","sources":["../../../src/cli/commands/status.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2MH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,YAAoB,EACpB,MAAM,GAAG,KAAK,EACd,OAAO,GAAG,CAAC;IAEX,OAAO,GAAG,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nB;QACD,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI;YAC/B,cAAc,EAAE,CAAC;YACjB,WAAW,EAAE,CAAC;YACd,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,CAAC;YACjB,iBAAiB,EAAE,CAAC;YACpB,OAAO,EAAE,IAAI;YACb,mBAAmB,EAAE,SAAS;SAC/B;QACD,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,EAAE;QACzC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;QACvB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QAC9F,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;QACzF,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,EAAE;QACzC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;QAC7B,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;KACxC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Switch Command
3
+ *
4
+ * Changes working context to a different project or specification.
5
+ * Auto-detects whether the ID is a project or specification.
6
+ */
7
+ import { Command } from 'commander';
8
+ /**
9
+ * Switch command action handler
10
+ *
11
+ * @param id Project or Specification ID to switch to
12
+ */
13
+ export declare function switchAction(id: string): Promise<void>;
14
+ /**
15
+ * Register switch command with Commander
16
+ */
17
+ export declare function registerSwitchCommand(program: Command): void;
18
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/switch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsFpC;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqH5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqB5D"}
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Switch Command
3
+ *
4
+ * Changes working context to a different project or specification.
5
+ * Auto-detects whether the ID is a project or specification.
6
+ */
7
+ import ora from 'ora';
8
+ import { resolveConfig, loadProjectConfig, saveProjectConfig } from '../config/index.js';
9
+ import { withErrorHandler, CliError, NetworkError, ValidationError } from '../middleware/error-handler.js';
10
+ import { printBlank } from '../ui/output.js';
11
+ import { colors } from '../ui/colors.js';
12
+ import { ApiClient } from '../../client/api-client.js';
13
+ import { isProjectResult, getDisplayName, } from './switch.types.js';
14
+ /**
15
+ * Detect if an ID refers to a project or specification
16
+ *
17
+ * Tries to fetch the ID as a project first, then as a specification.
18
+ *
19
+ * @param client API client instance
20
+ * @param id ID to detect
21
+ * @returns Detection result or null if not found
22
+ */
23
+ async function detectIdType(client, id) {
24
+ // Try as project first
25
+ try {
26
+ const project = await client.call('get_project', {
27
+ projectId: id,
28
+ });
29
+ return { type: 'project', data: project };
30
+ }
31
+ catch {
32
+ // Not a project, continue to try specification
33
+ }
34
+ // Try as specification
35
+ try {
36
+ const specification = await client.call('get_specification', {
37
+ specificationId: id,
38
+ });
39
+ return { type: 'specification', data: specification };
40
+ }
41
+ catch {
42
+ // Not a specification either
43
+ }
44
+ return null;
45
+ }
46
+ /**
47
+ * Update working context on the backend
48
+ *
49
+ * @param client API client instance
50
+ * @param request Context update request
51
+ */
52
+ async function updateWorkingContext(client, request) {
53
+ await client.call('set_working_context', request);
54
+ }
55
+ /**
56
+ * Update local project configuration
57
+ *
58
+ * @param projectId Project ID to set
59
+ * @param specificationId Specification ID to set (undefined to clear)
60
+ */
61
+ function updateLocalConfig(projectId, specificationId) {
62
+ const projectConfig = loadProjectConfig() || {};
63
+ projectConfig.projectId = projectId;
64
+ if (specificationId) {
65
+ projectConfig.specificationId = specificationId;
66
+ }
67
+ else {
68
+ // Clear specification when switching to a project
69
+ delete projectConfig.specificationId;
70
+ }
71
+ saveProjectConfig(projectConfig);
72
+ }
73
+ /**
74
+ * Switch command action handler
75
+ *
76
+ * @param id Project or Specification ID to switch to
77
+ */
78
+ export async function switchAction(id) {
79
+ // Validate ID is provided
80
+ if (!id || id.trim() === '') {
81
+ throw new ValidationError('ID is required', 'Usage: specforge-mcp switch <project-or-spec-id>');
82
+ }
83
+ const config = resolveConfig();
84
+ if (!config.apiKey) {
85
+ throw new CliError('Not authenticated', 1, 'Run `specforge-mcp login` to authenticate first');
86
+ }
87
+ const spinner = ora({
88
+ text: 'Detecting resource type...',
89
+ color: 'cyan',
90
+ }).start();
91
+ try {
92
+ const client = new ApiClient({
93
+ apiKey: config.apiKey,
94
+ apiUrl: config.apiUrl,
95
+ debug: config.debug,
96
+ });
97
+ // Detect what type of ID this is
98
+ spinner.text = 'Looking up ID...';
99
+ const detected = await detectIdType(client, id);
100
+ if (!detected) {
101
+ spinner.fail('Resource not found');
102
+ throw new CliError(`"${id}" is not a valid project or specification ID`, 1, 'Make sure you have access to this resource. Use `specforge-mcp projects` or `specforge-mcp specs` to list available resources.');
103
+ }
104
+ const { type, data } = detected;
105
+ const displayName = getDisplayName(detected);
106
+ // Update working context based on type
107
+ spinner.text = `Switching to ${type}...`;
108
+ if (isProjectResult(detected)) {
109
+ // Switching to a project
110
+ const projectData = data;
111
+ const contextRequest = {
112
+ projectId: projectData.id,
113
+ specificationId: null,
114
+ epicId: null,
115
+ ticketId: null,
116
+ };
117
+ await updateWorkingContext(client, contextRequest);
118
+ updateLocalConfig(projectData.id);
119
+ spinner.succeed(`Switched to project: ${colors.primary(displayName)}`);
120
+ }
121
+ else {
122
+ // Switching to a specification
123
+ const specData = data;
124
+ const contextRequest = {
125
+ projectId: specData.projectId,
126
+ specificationId: specData.id,
127
+ epicId: null,
128
+ ticketId: null,
129
+ };
130
+ await updateWorkingContext(client, contextRequest);
131
+ updateLocalConfig(specData.projectId, specData.id);
132
+ spinner.succeed(`Switched to specification: ${colors.primary(displayName)}`);
133
+ }
134
+ printBlank();
135
+ // Show helpful next steps
136
+ console.log(colors.muted('Run `specforge-mcp status` to see the current context.'));
137
+ printBlank();
138
+ }
139
+ catch (error) {
140
+ // Re-throw CLI errors as-is
141
+ if (error instanceof CliError || error instanceof ValidationError) {
142
+ spinner.stop();
143
+ throw error;
144
+ }
145
+ spinner.fail('Failed to switch context');
146
+ const message = error instanceof Error ? error.message : 'Unknown error';
147
+ if (message.includes('401') || message.includes('Unauthorized')) {
148
+ throw new CliError('Authentication failed', 1, 'Your API key may be invalid. Run `specforge-mcp login` to re-authenticate');
149
+ }
150
+ if (message.includes('403') || message.includes('Forbidden')) {
151
+ throw new CliError(`Access denied to "${id}"`, 1, 'You may not have permission to access this resource');
152
+ }
153
+ throw new NetworkError(`Failed to switch context: ${message}`);
154
+ }
155
+ }
156
+ /**
157
+ * Register switch command with Commander
158
+ */
159
+ export function registerSwitchCommand(program) {
160
+ program
161
+ .command('switch <id>')
162
+ .description('Switch working context to a project or specification')
163
+ .addHelpText('after', `
164
+ Arguments:
165
+ id Project ID (proj_xxx) or Specification ID (spec_xxx)
166
+
167
+ Examples:
168
+ $ specforge-mcp switch proj_abc123 # Switch to a project
169
+ $ specforge-mcp switch spec_def456 # Switch to a specification
170
+
171
+ The command auto-detects whether the ID is a project or specification.
172
+ When switching to a project, the specification context is cleared.
173
+ When switching to a specification, the project is set automatically.
174
+
175
+ Use 'specforge-mcp status' to see the current context.
176
+ Use 'specforge-mcp projects' to list available projects.
177
+ Use 'specforge-mcp specs' to list specifications in a project.
178
+ `)
179
+ .action(withErrorHandler(switchAction));
180
+ }
181
+ //# sourceMapping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CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,sDAAsD,CAAC;SACnE,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;CAezB,CAAC;SACG,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Switch Command Types
3
+ *
4
+ * Type definitions for the switch command that changes
5
+ * working context between projects and specifications.
6
+ */
7
+ /**
8
+ * Types of resources that can be switched to
9
+ */
10
+ export type SwitchTargetType = 'project' | 'specification';
11
+ /**
12
+ * Result of detecting what type an ID refers to
13
+ */
14
+ export interface DetectionResult {
15
+ /** The type of resource detected */
16
+ type: SwitchTargetType;
17
+ /** The resource data from the API */
18
+ data: ProjectData | SpecificationData;
19
+ }
20
+ /**
21
+ * Project data from get_project API
22
+ */
23
+ export interface ProjectData {
24
+ /** Project ID */
25
+ id: string;
26
+ /** Project name */
27
+ name: string;
28
+ /** Project description (optional) */
29
+ description?: string;
30
+ }
31
+ /**
32
+ * Specification data from get_specification API
33
+ */
34
+ export interface SpecificationData {
35
+ /** Specification ID */
36
+ id: string;
37
+ /** Specification title */
38
+ title: string;
39
+ /** Parent project ID */
40
+ projectId: string;
41
+ /** Specification description (optional) */
42
+ description?: string;
43
+ /** Specification status (optional) */
44
+ status?: string;
45
+ }
46
+ /**
47
+ * API request for set_working_context
48
+ */
49
+ export interface SetWorkingContextRequest extends Record<string, unknown> {
50
+ /** Project ID to set */
51
+ projectId: string;
52
+ /** Specification ID to set (null to clear) */
53
+ specificationId: string | null;
54
+ /** Epic ID to set (null to clear) */
55
+ epicId: string | null;
56
+ /** Ticket ID to set (null to clear) */
57
+ ticketId: string | null;
58
+ }
59
+ /**
60
+ * API response for set_working_context
61
+ */
62
+ export interface SetWorkingContextResponse {
63
+ /** Success indicator */
64
+ success?: boolean;
65
+ /** Updated context */
66
+ context?: {
67
+ projectId: string;
68
+ specificationId: string | null;
69
+ epicId: string | null;
70
+ ticketId: string | null;
71
+ };
72
+ }
73
+ /**
74
+ * Switch command result for display
75
+ */
76
+ export interface SwitchResult {
77
+ /** Whether switch was successful */
78
+ success: boolean;
79
+ /** Type of resource switched to */
80
+ type: SwitchTargetType;
81
+ /** Display name of the resource */
82
+ displayName: string;
83
+ /** Project ID (always set) */
84
+ projectId: string;
85
+ /** Specification ID (if switching to spec) */
86
+ specificationId?: string;
87
+ }
88
+ /**
89
+ * Error codes for switch command
90
+ */
91
+ export declare enum SwitchErrorCode {
92
+ /** ID not provided */
93
+ MISSING_ID = "MISSING_ID",
94
+ /** ID not found as project or specification */
95
+ NOT_FOUND = "NOT_FOUND",
96
+ /** User does not have access to resource */
97
+ ACCESS_DENIED = "ACCESS_DENIED",
98
+ /** Failed to update working context */
99
+ UPDATE_FAILED = "UPDATE_FAILED",
100
+ /** Failed to save local config */
101
+ CONFIG_SAVE_FAILED = "CONFIG_SAVE_FAILED"
102
+ }
103
+ /**
104
+ * Check if detection result is a project
105
+ */
106
+ export declare function isProjectResult(result: DetectionResult): result is DetectionResult & {
107
+ data: ProjectData;
108
+ };
109
+ /**
110
+ * Check if detection result is a specification
111
+ */
112
+ export declare function isSpecificationResult(result: DetectionResult): result is DetectionResult & {
113
+ data: SpecificationData;
114
+ };
115
+ /**
116
+ * Get display name from detection result
117
+ */
118
+ export declare function getDisplayName(result: DetectionResult): string;
119
+ /**
120
+ * Create switch result from detection result
121
+ */
122
+ export declare function createSwitchResult(result: DetectionResult): SwitchResult;
123
+ //# sourceMappingURL=switch.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.types.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/switch.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,eAAe,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,qCAA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AAgB,CAAC;IACvB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,sBAAsB;IACtB,UAAU,eAAe;IACzB,+CAA+C;IAC/C,SAAS,cAAc;IACvB,4CAA4C;IAC5C,aAAa,kBAAkB;IAC/B,uCAAuC;IACvC,aAAa,kBAAkB;IAC/B,kCAAkC;IAClC,kBAAkB,uBAAuB;CAC1C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,IAAI,eAAe,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAE1G;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,IAAI,eAAe,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAEtH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAK9D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAkBxE"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Switch Command Types
3
+ *
4
+ * Type definitions for the switch command that changes
5
+ * working context between projects and specifications.
6
+ */
7
+ /**
8
+ * Error codes for switch command
9
+ */
10
+ export var SwitchErrorCode;
11
+ (function (SwitchErrorCode) {
12
+ /** ID not provided */
13
+ SwitchErrorCode["MISSING_ID"] = "MISSING_ID";
14
+ /** ID not found as project or specification */
15
+ SwitchErrorCode["NOT_FOUND"] = "NOT_FOUND";
16
+ /** User does not have access to resource */
17
+ SwitchErrorCode["ACCESS_DENIED"] = "ACCESS_DENIED";
18
+ /** Failed to update working context */
19
+ SwitchErrorCode["UPDATE_FAILED"] = "UPDATE_FAILED";
20
+ /** Failed to save local config */
21
+ SwitchErrorCode["CONFIG_SAVE_FAILED"] = "CONFIG_SAVE_FAILED";
22
+ })(SwitchErrorCode || (SwitchErrorCode = {}));
23
+ /**
24
+ * Check if detection result is a project
25
+ */
26
+ export function isProjectResult(result) {
27
+ return result.type === 'project';
28
+ }
29
+ /**
30
+ * Check if detection result is a specification
31
+ */
32
+ export function isSpecificationResult(result) {
33
+ return result.type === 'specification';
34
+ }
35
+ /**
36
+ * Get display name from detection result
37
+ */
38
+ export function getDisplayName(result) {
39
+ if (isProjectResult(result)) {
40
+ return result.data.name;
41
+ }
42
+ return result.data.title;
43
+ }
44
+ /**
45
+ * Create switch result from detection result
46
+ */
47
+ export function createSwitchResult(result) {
48
+ if (isProjectResult(result)) {
49
+ return {
50
+ success: true,
51
+ type: 'project',
52
+ displayName: result.data.name,
53
+ projectId: result.data.id,
54
+ };
55
+ }
56
+ const specData = result.data;
57
+ return {
58
+ success: true,
59
+ type: 'specification',
60
+ displayName: specData.title,
61
+ projectId: specData.projectId,
62
+ specificationId: specData.id,
63
+ };
64
+ }
65
+ //# sourceMappingURL=switch.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.types.js","sourceRoot":"","sources":["../../../src/cli/commands/switch.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0FH;;GAEG;AACH,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,sBAAsB;IACtB,4CAAyB,CAAA;IACzB,+CAA+C;IAC/C,0CAAuB,CAAA;IACvB,4CAA4C;IAC5C,kDAA+B,CAAA;IAC/B,uCAAuC;IACvC,kDAA+B,CAAA;IAC/B,kCAAkC;IAClC,4DAAyC,CAAA;AAC3C,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAuB;IAC3D,OAAO,MAAM,CAAC,IAAI,KAAK,eAAe,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAuB;IACpD,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,OAAQ,MAAM,CAAC,IAA0B,CAAC,KAAK,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAuB;IACxD,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;YAC7B,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAyB,CAAC;IAClD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,QAAQ,CAAC,KAAK;QAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,eAAe,EAAE,QAAQ,CAAC,EAAE;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Ticket Command Implementation
3
+ *
4
+ * Main command for fetching and displaying detailed ticket information.
5
+ */
6
+ import type { TicketCommandOptions } from './types.js';
7
+ /**
8
+ * Ticket command implementation
9
+ */
10
+ export declare function ticketCommand(idOrNumber: string, options: TicketCommandOptions): Promise<void>;
11
+ export { resolveTicketId } from './resolver.js';
12
+ export * from './display.js';
13
+ export * from './types.js';
14
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ticket/command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,KAAK,EAAU,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAsC/D;;GAEG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAqEf;AA6CD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}