@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 @@
1
+ {"version":3,"file":"tickets.types.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/tickets.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EAKxC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAK5C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,QAAQ,EAAE,cAAc,CAAC;IAC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AG,MAAM,EAAE,CAE1F"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Tickets Command Types
3
+ *
4
+ * Type definitions for the tickets list command.
5
+ */
6
+ /**
7
+ * All valid ticket statuses
8
+ */
9
+ export const VALID_STATUSES = [
10
+ 'pending',
11
+ 'in_progress',
12
+ 'done',
13
+ 'blocked',
14
+ ];
15
+ /**
16
+ * All valid ticket priorities
17
+ */
18
+ export const VALID_PRIORITIES = [
19
+ 'critical',
20
+ 'high',
21
+ 'medium',
22
+ 'low',
23
+ ];
24
+ /**
25
+ * Default table columns for tickets
26
+ */
27
+ export const TICKET_TABLE_COLUMNS = [
28
+ { header: '#', width: 6, align: 'right' },
29
+ { header: 'TITLE', width: 40 },
30
+ { header: 'PRIORITY', width: 10 },
31
+ { header: 'STATUS', width: 12 },
32
+ { header: 'BLOCKED', width: 8 },
33
+ ];
34
+ /**
35
+ * Priority display colors (chalk color names)
36
+ */
37
+ export const PRIORITY_COLORS = {
38
+ critical: 'red',
39
+ high: 'yellow',
40
+ medium: 'blue',
41
+ low: 'dim',
42
+ };
43
+ /**
44
+ * Status display colors (chalk color names)
45
+ */
46
+ export const STATUS_COLORS = {
47
+ done: 'green',
48
+ in_progress: 'blue',
49
+ pending: 'yellow',
50
+ blocked: 'red',
51
+ };
52
+ /**
53
+ * Maximum title length for table display
54
+ */
55
+ export const MAX_TITLE_LENGTH = 38;
56
+ /**
57
+ * Ticket number padding width
58
+ */
59
+ export const TICKET_NUMBER_WIDTH = 3;
60
+ /**
61
+ * Format ticket number with leading zeros
62
+ *
63
+ * @param num Ticket number
64
+ * @returns Formatted ticket number (e.g., "001", "042")
65
+ */
66
+ export function formatTicketNumber(num) {
67
+ return num.toString().padStart(TICKET_NUMBER_WIDTH, '0');
68
+ }
69
+ /**
70
+ * Truncate title if too long for display
71
+ *
72
+ * @param title Ticket title
73
+ * @param maxLength Maximum length (default: MAX_TITLE_LENGTH)
74
+ * @returns Truncated title with ellipsis if needed
75
+ */
76
+ export function truncateTitle(title, maxLength = MAX_TITLE_LENGTH) {
77
+ if (title.length <= maxLength) {
78
+ return title;
79
+ }
80
+ return title.slice(0, maxLength - 3) + '...';
81
+ }
82
+ /**
83
+ * Check if a ticket is blocked
84
+ *
85
+ * @param ticket Ticket to check
86
+ * @returns True if ticket has blockers
87
+ */
88
+ export function isTicketBlocked(ticket) {
89
+ return Array.isArray(ticket.blockedBy) && ticket.blockedBy.length > 0;
90
+ }
91
+ /**
92
+ * Validate status filter
93
+ *
94
+ * @param status Status to validate
95
+ * @returns True if valid status
96
+ */
97
+ export function isValidStatus(status) {
98
+ return VALID_STATUSES.includes(status);
99
+ }
100
+ /**
101
+ * Validate priority filter
102
+ *
103
+ * @param priority Priority to validate
104
+ * @returns True if valid priority
105
+ */
106
+ export function isValidPriority(priority) {
107
+ return VALID_PRIORITIES.includes(priority);
108
+ }
109
+ /**
110
+ * Get count of blocked tickets
111
+ *
112
+ * @param tickets Array of tickets
113
+ * @returns Number of blocked tickets
114
+ */
115
+ export function countBlockedTickets(tickets) {
116
+ return tickets.filter(isTicketBlocked).length;
117
+ }
118
+ /**
119
+ * Get tickets by status
120
+ *
121
+ * @param tickets Array of tickets
122
+ * @param status Status to filter by
123
+ * @returns Filtered tickets
124
+ */
125
+ export function getTicketsByStatus(tickets, status) {
126
+ return tickets.filter(t => t.status === status);
127
+ }
128
+ /**
129
+ * Get tickets by priority
130
+ *
131
+ * @param tickets Array of tickets
132
+ * @param priority Priority to filter by
133
+ * @returns Filtered tickets
134
+ */
135
+ export function getTicketsByPriority(tickets, priority) {
136
+ return tickets.filter(t => t.priority === priority);
137
+ }
138
+ //# sourceMappingURL=tickets.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tickets.types.js","sourceRoot":"","sources":["../../../src/cli/commands/tickets.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,SAAS;IACT,aAAa;IACb,MAAM;I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AS,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACxE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,cAAc,CAAC,QAAQ,CAAC,MAAsB,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,gBAAgB,CAAC,QAAQ,CAAC,QAA0B,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAiB;IACnD,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAiB,EAAE,MAAoB;IACxE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAiB,EAAE,QAAwB;IAC9E,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * CLI Configuration Module
3
+ *
4
+ * Provides configuration loading, writing, and path resolution
5
+ * for the SpecForge CLI.
6
+ */
7
+ export * from './types.js';
8
+ export * from './paths.js';
9
+ export * from './loader.js';
10
+ export * from './writer.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/config/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * CLI Configuration Module
3
+ *
4
+ * Provides configuration loading, writing, and path resolution
5
+ * for the SpecForge CLI.
6
+ */
7
+ export * from './types.js';
8
+ export * from './paths.js';
9
+ export * from './loader.js';
10
+ export * from './writer.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/config/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Config Loader
3
+ *
4
+ * Loads and merges configuration from multiple sources with the following priority:
5
+ * 1. Environment variables (highest)
6
+ * 2. Project config (.specforge.json)
7
+ * 3. Global config (~/.specforge/config.json)
8
+ * 4. Default values (lowest)
9
+ */
10
+ import { GlobalConfig, ProjectConfig, ResolvedConfig } from './types.js';
11
+ /**
12
+ * Load global configuration from ~/.specforge/config.json
13
+ *
14
+ * @returns GlobalConfig object (empty object if file doesn't exist or is invalid)
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const globalConfig = loadGlobalConfig();
19
+ * if (globalConfig.apiKey) {
20
+ * console.log('API key found in global config');
21
+ * }
22
+ * ```
23
+ */
24
+ export declare function loadGlobalConfig(): GlobalConfig;
25
+ /**
26
+ * Load project configuration from .specforge.json
27
+ *
28
+ * Searches current directory and parent directories for .specforge.json.
29
+ *
30
+ * @returns ProjectConfig object if found, null otherwise
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const projectConfig = loadProjectConfig();
35
+ * if (projectConfig?.projectId) {
36
+ * console.log('Project ID:', projectConfig.projectId);
37
+ * }
38
+ * ```
39
+ */
40
+ export declare function loadProjectConfig(): ProjectConfig | null;
41
+ /**
42
+ * Resolve final configuration from all sources
43
+ *
44
+ * Merges configuration with the following priority (highest to lowest):
45
+ * 1. Environment variables
46
+ * 2. Project config (.specforge.json)
47
+ * 3. Global config (~/.specforge/config.json)
48
+ * 4. Default values
49
+ *
50
+ * @returns ResolvedConfig with all values and source tracking
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * const config = resolveConfig();
55
+ * console.log('API Key from:', config.sources.apiKey); // 'env' | 'global' | null
56
+ * console.log('Format:', config.format); // 'json' | 'toon'
57
+ * ```
58
+ */
59
+ export declare function resolveConfig(): ResolvedConfig;
60
+ /**
61
+ * Check if user is authenticated (has API key configured)
62
+ *
63
+ * @returns true if API key is available from any source
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * if (!isAuthenticated()) {
68
+ * console.error('Please run: specforge-mcp login');
69
+ * process.exit(1);
70
+ * }
71
+ * ```
72
+ */
73
+ export declare function isAuthenticated(): boolean;
74
+ /**
75
+ * Get API key if available
76
+ *
77
+ * @returns API key string or null if not configured
78
+ */
79
+ export declare function getApiKey(): string | null;
80
+ /**
81
+ * Check if running in a project context
82
+ *
83
+ * @returns true if a .specforge.json was found
84
+ */
85
+ export declare function hasProjectContext(): boolean;
86
+ /**
87
+ * Get current project ID if available
88
+ *
89
+ * @returns Project ID or null
90
+ */
91
+ export declare function getProjectId(): string | null;
92
+ /**
93
+ * Get current specification ID if available
94
+ *
95
+ * @returns Specification ID or null
96
+ */
97
+ export declare function getSpecificationId(): string | null;
98
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/cli/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EAKf,MAAM,YAAY,CAAC;AAMpB;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,CA2B/C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,aAAa,GAAG,IAAI,CA0BxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,IAAI,cAAc,CA0E9C;AASD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAGzC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAGzC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAG5C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAGlD"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Config Loader
3
+ *
4
+ * Loads and merges configuration from multiple sources with the following priority:
5
+ * 1. Environment variables (highest)
6
+ * 2. Project config (.specforge.json)
7
+ * 3. Global config (~/.specforge/config.json)
8
+ * 4. Default values (lowest)
9
+ */
10
+ import fs from 'node:fs';
11
+ import { CONFIG_DEFAULTS, CONFIG_ENV_VARS, } from './types.js';
12
+ import { getGlobalConfigPath, findProjectConfigPath, } from './paths.js';
13
+ /**
14
+ * Load global configuration from ~/.specforge/config.json
15
+ *
16
+ * @returns GlobalConfig object (empty object if file doesn't exist or is invalid)
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const globalConfig = loadGlobalConfig();
21
+ * if (globalConfig.apiKey) {
22
+ * console.log('API key found in global config');
23
+ * }
24
+ * ```
25
+ */
26
+ export function loadGlobalConfig() {
27
+ const configPath = getGlobalConfigPath();
28
+ if (!fs.existsSync(configPath)) {
29
+ return {};
30
+ }
31
+ try {
32
+ const content = fs.readFileSync(configPath, 'utf-8');
33
+ const parsed = JSON.parse(content);
34
+ // Validate it's an object
35
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
36
+ console.warn(`Warning: ${configPath} is not a valid config object`);
37
+ return {};
38
+ }
39
+ return parsed;
40
+ }
41
+ catch (error) {
42
+ // Log warning but don't fail - return empty config for graceful degradation
43
+ if (error instanceof SyntaxError) {
44
+ console.warn(`Warning: Failed to parse ${configPath} - invalid JSON`);
45
+ }
46
+ else {
47
+ console.warn(`Warning: Failed to read ${configPath}`);
48
+ }
49
+ return {};
50
+ }
51
+ }
52
+ /**
53
+ * Load project configuration from .specforge.json
54
+ *
55
+ * Searches current directory and parent directories for .specforge.json.
56
+ *
57
+ * @returns ProjectConfig object if found, null otherwise
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const projectConfig = loadProjectConfig();
62
+ * if (projectConfig?.projectId) {
63
+ * console.log('Project ID:', projectConfig.projectId);
64
+ * }
65
+ * ```
66
+ */
67
+ export function loadProjectConfig() {
68
+ const configPath = findProjectConfigPath();
69
+ if (!configPath) {
70
+ return null;
71
+ }
72
+ try {
73
+ const content = fs.readFileSync(configPath, 'utf-8');
74
+ const parsed = JSON.parse(content);
75
+ // Validate it's an object
76
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
77
+ console.warn(`Warning: ${configPath} is not a valid config object`);
78
+ return null;
79
+ }
80
+ return parsed;
81
+ }
82
+ catch (error) {
83
+ if (error instanceof SyntaxError) {
84
+ console.warn(`Warning: Failed to parse ${configPath} - invalid JSON`);
85
+ }
86
+ else {
87
+ console.warn(`Warning: Failed to read ${configPath}`);
88
+ }
89
+ return null;
90
+ }
91
+ }
92
+ /**
93
+ * Resolve final configuration from all sources
94
+ *
95
+ * Merges configuration with the following priority (highest to lowest):
96
+ * 1. Environment variables
97
+ * 2. Project config (.specforge.json)
98
+ * 3. Global config (~/.specforge/config.json)
99
+ * 4. Default values
100
+ *
101
+ * @returns ResolvedConfig with all values and source tracking
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * const config = resolveConfig();
106
+ * console.log('API Key from:', config.sources.apiKey); // 'env' | 'global' | null
107
+ * console.log('Format:', config.format); // 'json' | 'toon'
108
+ * ```
109
+ */
110
+ export function resolveConfig() {
111
+ const globalConfig = loadGlobalConfig();
112
+ const projectConfig = loadProjectConfig();
113
+ // Initialize with defaults
114
+ const sources = {
115
+ apiKey: null,
116
+ projectId: null,
117
+ specificationId: null,
118
+ format: 'default',
119
+ };
120
+ const resolved = {
121
+ apiKey: null,
122
+ apiUrl: CONFIG_DEFAULTS.apiUrl,
123
+ format: CONFIG_DEFAULTS.format,
124
+ projectId: null,
125
+ specificationId: null,
126
+ autoSetContext: CONFIG_DEFAULTS.autoSetContext,
127
+ debug: CONFIG_DEFAULTS.debug,
128
+ sources,
129
+ };
130
+ // --- API Key: ENV > Global ---
131
+ if (process.env[CONFIG_ENV_VARS.API_KEY]) {
132
+ resolved.apiKey = process.env[CONFIG_ENV_VARS.API_KEY];
133
+ sources.apiKey = 'env';
134
+ }
135
+ else if (globalConfig.apiKey) {
136
+ resolved.apiKey = globalConfig.apiKey;
137
+ sources.apiKey = 'global';
138
+ }
139
+ // --- API URL: ENV > Default ---
140
+ if (process.env[CONFIG_ENV_VARS.API_URL]) {
141
+ resolved.apiUrl = process.env[CONFIG_ENV_VARS.API_URL];
142
+ }
143
+ // --- Debug: ENV only ---
144
+ resolved.debug = process.env[CONFIG_ENV_VARS.DEBUG] === 'true';
145
+ // --- Format: ENV > Project > Global > Default ---
146
+ const envFormat = process.env[CONFIG_ENV_VARS.FORMAT];
147
+ if (envFormat && isValidFormat(envFormat)) {
148
+ resolved.format = envFormat;
149
+ sources.format = 'env';
150
+ }
151
+ else if (projectConfig?.format && isValidFormat(projectConfig.format)) {
152
+ resolved.format = projectConfig.format;
153
+ sources.format = 'project';
154
+ }
155
+ else if (globalConfig.format && isValidFormat(globalConfig.format)) {
156
+ resolved.format = globalConfig.format;
157
+ sources.format = 'global';
158
+ }
159
+ // --- Project ID: Project > Global ---
160
+ if (projectConfig?.projectId) {
161
+ resolved.projectId = projectConfig.projectId;
162
+ sources.projectId = 'project';
163
+ }
164
+ else if (globalConfig.defaultProjectId) {
165
+ resolved.projectId = globalConfig.defaultProjectId;
166
+ sources.projectId = 'global';
167
+ }
168
+ // --- Specification ID: Project only ---
169
+ if (projectConfig?.specificationId) {
170
+ resolved.specificationId = projectConfig.specificationId;
171
+ sources.specificationId = 'project';
172
+ }
173
+ // --- Auto Set Context: Project > Default ---
174
+ if (projectConfig?.autoSetContext !== undefined) {
175
+ resolved.autoSetContext = projectConfig.autoSetContext;
176
+ }
177
+ return resolved;
178
+ }
179
+ /**
180
+ * Validate that a string is a valid output format
181
+ */
182
+ function isValidFormat(format) {
183
+ return format === 'json' || format === 'toon';
184
+ }
185
+ /**
186
+ * Check if user is authenticated (has API key configured)
187
+ *
188
+ * @returns true if API key is available from any source
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * if (!isAuthenticated()) {
193
+ * console.error('Please run: specforge-mcp login');
194
+ * process.exit(1);
195
+ * }
196
+ * ```
197
+ */
198
+ export function isAuthenticated() {
199
+ const config = resolveConfig();
200
+ return config.apiKey !== null;
201
+ }
202
+ /**
203
+ * Get API key if available
204
+ *
205
+ * @returns API key string or null if not configured
206
+ */
207
+ export function getApiKey() {
208
+ const config = resolveConfig();
209
+ return config.apiKey;
210
+ }
211
+ /**
212
+ * Check if running in a project context
213
+ *
214
+ * @returns true if a .specforge.json was found
215
+ */
216
+ export function hasProjectContext() {
217
+ return loadProjectConfig() !== null;
218
+ }
219
+ /**
220
+ * Get current project ID if available
221
+ *
222
+ * @returns Project ID or null
223
+ */
224
+ export function getProjectId() {
225
+ const config = resolveConfig();
226
+ return config.projectId;
227
+ }
228
+ /**
229
+ * Get current specification ID if available
230
+ *
231
+ * @returns Specification ID or null
232
+ */
233
+ export function getSpecificationId() {
234
+ const config = resolveConfig();
235
+ return config.specificationId;
236
+ }
237
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/cli/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAML,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;IAEzC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEnC,0BAA0B;QAC1B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3E,OAAO,CAAC,IAAI,CAAC,YAAY,UAAU,+BAA+B,CAAC,CAAC;YACpE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,MAAsB,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4EAA4E;QAC5E,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,4BAA4B,UAAU,iBAAiB,CAAC,CAAC;QACxE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,2BAA2B,UAAU,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;AAC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C;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,iBAAiB,EAAE,KAAK,IAAI,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,OAAO,MAAM,CAAC,SAAS,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,OAAO,MAAM,CAAC,eAAe,CAAC;AAChC,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Config Paths Resolution
3
+ *
4
+ * Provides functions for resolving configuration file paths.
5
+ * Handles both global (~/.specforge/) and project-level (.specforge.json) paths.
6
+ */
7
+ import { ConfigPaths } from './types.js';
8
+ /**
9
+ * Get all configuration file paths
10
+ *
11
+ * @returns ConfigPaths object with all resolved paths
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const paths = getConfigPaths();
16
+ * console.log(paths.globalDir); // /home/user/.specforge
17
+ * console.log(paths.globalConfig); // /home/user/.specforge/config.json
18
+ * console.log(paths.projectConfig); // /current/dir/.specforge.json
19
+ * ```
20
+ */
21
+ export declare function getConfigPaths(): ConfigPaths;
22
+ /**
23
+ * Get the global configuration directory path
24
+ *
25
+ * Uses $HOME/.specforge on all platforms.
26
+ * Does not create the directory - that's handled by the writer.
27
+ *
28
+ * @returns Absolute path to global config directory
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * const dir = getGlobalConfigDir();
33
+ * // Linux/macOS: /home/user/.specforge
34
+ * // Windows: C:\Users\user\.specforge
35
+ * ```
36
+ */
37
+ export declare function getGlobalConfigDir(): string;
38
+ /**
39
+ * Get the global configuration file path
40
+ *
41
+ * @returns Absolute path to ~/.specforge/config.json
42
+ */
43
+ export declare function getGlobalConfigPath(): string;
44
+ /**
45
+ * Get the project configuration file path
46
+ *
47
+ * Resolves to .specforge.json in the current working directory.
48
+ * Note: This returns the path in CWD only - for searching up the
49
+ * directory tree, use findProjectConfigPath().
50
+ *
51
+ * @returns Absolute path to .specforge.json in current directory
52
+ */
53
+ export declare function getProjectConfigPath(): string;
54
+ /**
55
+ * Get the MCP configuration file path
56
+ *
57
+ * @returns Absolute path to .mcp.json in current directory
58
+ */
59
+ export declare function getMcpConfigPath(): string;
60
+ /**
61
+ * Find project config by searching up the directory tree
62
+ *
63
+ * Starts from the current directory and walks up to the filesystem root,
64
+ * looking for .specforge.json at each level.
65
+ *
66
+ * @param startDir - Directory to start searching from (defaults to cwd)
67
+ * @returns Absolute path to .specforge.json if found, null otherwise
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * // Given: /home/user/projects/myapp/src/components
72
+ * // With .specforge.json at /home/user/projects/myapp/.specforge.json
73
+ *
74
+ * const configPath = findProjectConfigPath();
75
+ * // Returns: /home/user/projects/myapp/.specforge.json
76
+ * ```
77
+ */
78
+ export declare function findProjectConfigPath(startDir?: string): string | null;
79
+ /**
80
+ * Get the directory containing the project config
81
+ *
82
+ * Useful for resolving relative paths from the project root.
83
+ *
84
+ * @returns Directory path if project config found, null otherwise
85
+ */
86
+ export declare function findProjectRoot(): string | null;
87
+ /**
88
+ * Check if a path is within the global config directory
89
+ *
90
+ * Security check to prevent path traversal attacks.
91
+ *
92
+ * @param targetPath - Path to check
93
+ * @returns true if path is within ~/.specforge/
94
+ */
95
+ export declare function isWithinGlobalDir(targetPath: string): boolean;
96
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/cli/config/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAS5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBtE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAG/C;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAO7D"}