@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,140 @@
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 fs from 'node:fs';
8
+ import path from 'node:path';
9
+ import os from 'node:os';
10
+ import { CONFIG_FILES } from './types.js';
11
+ /**
12
+ * Get all configuration file paths
13
+ *
14
+ * @returns ConfigPaths object with all resolved paths
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const paths = getConfigPaths();
19
+ * console.log(paths.globalDir); // /home/user/.specforge
20
+ * console.log(paths.globalConfig); // /home/user/.specforge/config.json
21
+ * console.log(paths.projectConfig); // /current/dir/.specforge.json
22
+ * ```
23
+ */
24
+ export function getConfigPaths() {
25
+ const globalDir = getGlobalConfigDir();
26
+ return {
27
+ globalDir,
28
+ globalConfig: path.join(globalDir, CONFIG_FILES.GLOBAL_CONFIG),
29
+ projectConfig: path.resolve(CONFIG_FILES.PROJECT_CONFIG),
30
+ mcpConfig: path.resolve(CONFIG_FILES.MCP_CONFIG),
31
+ };
32
+ }
33
+ /**
34
+ * Get the global configuration directory path
35
+ *
36
+ * Uses $HOME/.specforge on all platforms.
37
+ * Does not create the directory - that's handled by the writer.
38
+ *
39
+ * @returns Absolute path to global config directory
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * const dir = getGlobalConfigDir();
44
+ * // Linux/macOS: /home/user/.specforge
45
+ * // Windows: C:\Users\user\.specforge
46
+ * ```
47
+ */
48
+ export function getGlobalConfigDir() {
49
+ return path.join(os.homedir(), CONFIG_FILES.GLOBAL_DIR);
50
+ }
51
+ /**
52
+ * Get the global configuration file path
53
+ *
54
+ * @returns Absolute path to ~/.specforge/config.json
55
+ */
56
+ export function getGlobalConfigPath() {
57
+ return path.join(getGlobalConfigDir(), CONFIG_FILES.GLOBAL_CONFIG);
58
+ }
59
+ /**
60
+ * Get the project configuration file path
61
+ *
62
+ * Resolves to .specforge.json in the current working directory.
63
+ * Note: This returns the path in CWD only - for searching up the
64
+ * directory tree, use findProjectConfigPath().
65
+ *
66
+ * @returns Absolute path to .specforge.json in current directory
67
+ */
68
+ export function getProjectConfigPath() {
69
+ return path.resolve(CONFIG_FILES.PROJECT_CONFIG);
70
+ }
71
+ /**
72
+ * Get the MCP configuration file path
73
+ *
74
+ * @returns Absolute path to .mcp.json in current directory
75
+ */
76
+ export function getMcpConfigPath() {
77
+ return path.resolve(CONFIG_FILES.MCP_CONFIG);
78
+ }
79
+ /**
80
+ * Find project config by searching up the directory tree
81
+ *
82
+ * Starts from the current directory and walks up to the filesystem root,
83
+ * looking for .specforge.json at each level.
84
+ *
85
+ * @param startDir - Directory to start searching from (defaults to cwd)
86
+ * @returns Absolute path to .specforge.json if found, null otherwise
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * // Given: /home/user/projects/myapp/src/components
91
+ * // With .specforge.json at /home/user/projects/myapp/.specforge.json
92
+ *
93
+ * const configPath = findProjectConfigPath();
94
+ * // Returns: /home/user/projects/myapp/.specforge.json
95
+ * ```
96
+ */
97
+ export function findProjectConfigPath(startDir) {
98
+ let currentDir = startDir ? path.resolve(startDir) : process.cwd();
99
+ const root = path.parse(currentDir).root;
100
+ while (currentDir !== root) {
101
+ const configPath = path.join(currentDir, CONFIG_FILES.PROJECT_CONFIG);
102
+ if (fs.existsSync(configPath)) {
103
+ return configPath;
104
+ }
105
+ currentDir = path.dirname(currentDir);
106
+ }
107
+ // Check root directory as well
108
+ const rootConfig = path.join(root, CONFIG_FILES.PROJECT_CONFIG);
109
+ if (fs.existsSync(rootConfig)) {
110
+ return rootConfig;
111
+ }
112
+ return null;
113
+ }
114
+ /**
115
+ * Get the directory containing the project config
116
+ *
117
+ * Useful for resolving relative paths from the project root.
118
+ *
119
+ * @returns Directory path if project config found, null otherwise
120
+ */
121
+ export function findProjectRoot() {
122
+ const configPath = findProjectConfigPath();
123
+ return configPath ? path.dirname(configPath) : null;
124
+ }
125
+ /**
126
+ * Check if a path is within the global config directory
127
+ *
128
+ * Security check to prevent path traversal attacks.
129
+ *
130
+ * @param targetPath - Path to check
131
+ * @returns true if path is within ~/.specforge/
132
+ */
133
+ export function isWithinGlobalDir(targetPath) {
134
+ const globalDir = getGlobalConfigDir();
135
+ const resolved = path.resolve(targetPath);
136
+ const relative = path.relative(globalDir, resolved);
137
+ // If the relative path starts with '..' or is absolute, it's outside
138
+ return !relative.startsWith('..') && !path.isAbsolute(relative);
139
+ }
140
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/cli/config/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAe,YAAY,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IAEvC,OAAO;QACL,SAAS;QACT,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC;QAC9D,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC;QACxD,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC;KACjD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAiB;IACrD,IAAI,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IACnE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;IAEzC,OAAO,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;QAEtE,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,+BAA+B;IAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAChE,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAC;IAC3C,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEpD,qEAAqE;IACrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * CLI Configuration Types
3
+ *
4
+ * Defines interfaces for global, project, and resolved configuration
5
+ * used throughout the CLI application.
6
+ */
7
+ /**
8
+ * Output format options for CLI commands
9
+ */
10
+ export type OutputFormat = 'json' | 'toon';
11
+ /**
12
+ * Source tracking for configuration values
13
+ * Used for diagnostics and debugging (e.g., `specforge-mcp doctor`)
14
+ */
15
+ export type ConfigSource = 'env' | 'global' | 'project' | 'default' | null;
16
+ /**
17
+ * Global configuration stored in ~/.specforge/config.json
18
+ *
19
+ * This file contains user-level settings that apply across all projects.
20
+ * The API key is stored here for security (not in project files).
21
+ *
22
+ * @example
23
+ * ```json
24
+ * {
25
+ * "apiKey": "sf_live_abc123...",
26
+ * "format": "toon",
27
+ * "defaultProjectId": "proj_xyz"
28
+ * }
29
+ * ```
30
+ */
31
+ export interface GlobalConfig {
32
+ /** API key for SpecForge authentication (format: sf_live_*) */
33
+ apiKey?: string;
34
+ /** Default output format for CLI commands */
35
+ format?: OutputFormat;
36
+ /** Default project ID when not in a project directory */
37
+ defaultProjectId?: string;
38
+ }
39
+ /**
40
+ * Project configuration stored in .specforge.json
41
+ *
42
+ * This file is created in the project root when running `specforge-mcp init`.
43
+ * It links the local directory to a SpecForge project and specification.
44
+ *
45
+ * @example
46
+ * ```json
47
+ * {
48
+ * "projectId": "proj_abc123",
49
+ * "specificationId": "spec_xyz789",
50
+ * "format": "json",
51
+ * "autoSetContext": true
52
+ * }
53
+ * ```
54
+ */
55
+ export interface ProjectConfig {
56
+ /** SpecForge project ID this directory is linked to */
57
+ projectId?: string;
58
+ /** Active specification ID for this project */
59
+ specificationId?: string;
60
+ /** Output format override for this project */
61
+ format?: OutputFormat;
62
+ /** Automatically set working context when CLI runs */
63
+ autoSetContext?: boolean;
64
+ }
65
+ /**
66
+ * Resolved configuration merged from all sources
67
+ *
68
+ * This is the final configuration used by CLI commands after merging:
69
+ * - Environment variables (highest priority)
70
+ * - Project config (.specforge.json)
71
+ * - Global config (~/.specforge/config.json)
72
+ * - Default values (lowest priority)
73
+ */
74
+ export interface ResolvedConfig {
75
+ /** API key for authentication (null if not authenticated) */
76
+ apiKey: string | null;
77
+ /** API endpoint URL */
78
+ apiUrl: string;
79
+ /** Output format for CLI commands */
80
+ format: OutputFormat;
81
+ /** Current project ID (null if not in project context) */
82
+ projectId: string | null;
83
+ /** Current specification ID (null if not set) */
84
+ specificationId: string | null;
85
+ /** Whether to auto-set working context */
86
+ autoSetContext: boolean;
87
+ /** Debug mode enabled */
88
+ debug: boolean;
89
+ /**
90
+ * Source tracking for each config value
91
+ * Useful for diagnostics and understanding where values come from
92
+ */
93
+ sources: ConfigSources;
94
+ }
95
+ /**
96
+ * Tracks the source of each resolved configuration value
97
+ */
98
+ export interface ConfigSources {
99
+ /** Where the API key was loaded from */
100
+ apiKey: 'env' | 'global' | null;
101
+ /** Where the project ID was loaded from */
102
+ projectId: 'env' | 'project' | 'global' | null;
103
+ /** Where the specification ID was loaded from */
104
+ specificationId: 'project' | null;
105
+ /** Where the format setting was loaded from */
106
+ format: 'env' | 'project' | 'global' | 'default';
107
+ }
108
+ /**
109
+ * Configuration file paths used by the CLI
110
+ */
111
+ export interface ConfigPaths {
112
+ /** Global config directory (~/.specforge/) */
113
+ globalDir: string;
114
+ /** Global config file (~/.specforge/config.json) */
115
+ globalConfig: string;
116
+ /** Project config file (./.specforge.json) */
117
+ projectConfig: string;
118
+ /** MCP config file for Claude Code (./.mcp.json) */
119
+ mcpConfig: string;
120
+ }
121
+ /**
122
+ * Default configuration values
123
+ */
124
+ export declare const CONFIG_DEFAULTS: {
125
+ readonly apiUrl: "https://mcp.specforge.com.br/mcp";
126
+ readonly format: OutputFormat;
127
+ readonly autoSetContext: true;
128
+ readonly debug: false;
129
+ };
130
+ /**
131
+ * Environment variable names for configuration
132
+ */
133
+ export declare const CONFIG_ENV_VARS: {
134
+ readonly API_KEY: "SPECFORGE_API_KEY";
135
+ readonly API_URL: "SPECFORGE_API_URL";
136
+ readonly FORMAT: "SPECFORGE_FORMAT";
137
+ readonly DEBUG: "SPECFORGE_DEBUG";
138
+ };
139
+ /**
140
+ * Configuration file names
141
+ */
142
+ export declare const CONFIG_FILES: {
143
+ readonly GLOBAL_DIR: ".specforge";
144
+ readonly GLOBAL_CONFIG: "config.json";
145
+ readonly PROJECT_CONFIG: ".specforge.json";
146
+ readonly MCP_CONFIG: ".mcp.json";
147
+ };
148
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/config/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,MAAM,EAAE,YAAY,CAAC;IAErB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,iDAAiD;IACjD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,0CAA0C;IAC1C,cAAc,EAAE,OAAO,CAAC;IAExB,yBAAyB;IACzB,KAAK,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;IAEhC,2CAA2C;IAC3C,SAAS,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAE/C,iDAAiD;IACjD,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;IAElC,+CAA+C;IAC/C,MAAM,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAElB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IAErB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;IAEtB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;qBAER,YAAY;;;CAGtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;CAKf,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * CLI Configuration Types
3
+ *
4
+ * Defines interfaces for global, project, and resolved configuration
5
+ * used throughout the CLI application.
6
+ */
7
+ /**
8
+ * Default configuration values
9
+ */
10
+ export const CONFIG_DEFAULTS = {
11
+ apiUrl: 'https://mcp.specforge.com.br/mcp',
12
+ format: 'toon',
13
+ autoSetContext: true,
14
+ debug: false,
15
+ };
16
+ /**
17
+ * Environment variable names for configuration
18
+ */
19
+ export const CONFIG_ENV_VARS = {
20
+ API_KEY: 'SPECFORGE_API_KEY',
21
+ API_URL: 'SPECFORGE_API_URL',
22
+ FORMAT: 'SPECFORGE_FORMAT',
23
+ DEBUG: 'SPECFORGE_DEBUG',
24
+ };
25
+ /**
26
+ * Configuration file names
27
+ */
28
+ export const CONFIG_FILES = {
29
+ GLOBAL_DIR: '.specforge',
30
+ GLOBAL_CONFIG: 'config.json',
31
+ PROJECT_CONFIG: '.specforge.json',
32
+ MCP_CONFIG: '.mcp.json',
33
+ };
34
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cli/config/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6IH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,kCAAkC;IAC1C,MAAM,EAAE,MAAsB;IAC9B,cAAc,EAAE,IAAI;IACpB,KAAK,EAAE,KAAK;CACJ,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mBAAmB;IAC5B,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB;CAChB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,aAAa;IAC5B,cAAc,EAAE,iBAAiB;IACjC,UAAU,EAAE,WAAW;CACf,CAAC"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Config Writer
3
+ *
4
+ * Provides safe config file writing with atomic operations and proper permissions.
5
+ *
6
+ * Security features:
7
+ * - Global config (contains API key) written with mode 0600 (owner read/write only)
8
+ * - Global directory created with mode 0700 (owner access only)
9
+ * - Project config written with standard permissions (0644)
10
+ * - Path validation to prevent writes outside allowed directories
11
+ */
12
+ import { GlobalConfig, ProjectConfig } from './types.js';
13
+ /**
14
+ * Ensure global config directory exists with secure permissions
15
+ *
16
+ * Creates ~/.specforge/ if it doesn't exist, with mode 0700 (owner-only access).
17
+ * Idempotent - safe to call multiple times.
18
+ *
19
+ * @throws Error if directory creation fails
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * ensureGlobalDir();
24
+ * // ~/.specforge/ now exists with drwx------ permissions
25
+ * ```
26
+ */
27
+ export declare function ensureGlobalDir(): void;
28
+ /**
29
+ * Save global configuration
30
+ *
31
+ * Merges the provided config with existing global config and writes to
32
+ * ~/.specforge/config.json with secure permissions (0600).
33
+ *
34
+ * Undefined values are removed from the final config.
35
+ *
36
+ * @param config - Partial global config to save
37
+ * @throws Error if write fails
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // Save API key
42
+ * saveGlobalConfig({ apiKey: 'sf_live_...' });
43
+ *
44
+ * // Update format, keeping existing apiKey
45
+ * saveGlobalConfig({ format: 'json' });
46
+ * ```
47
+ */
48
+ export declare function saveGlobalConfig(config: Partial<GlobalConfig>): void;
49
+ /**
50
+ * Delete a field from global config
51
+ *
52
+ * Loads existing config, removes the specified field, and saves.
53
+ * No-op if the field doesn't exist.
54
+ *
55
+ * @param field - Field name to remove
56
+ * @throws Error if read/write fails
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * deleteGlobalConfigField('apiKey');
61
+ * deleteGlobalConfigField('defaultProjectId');
62
+ * ```
63
+ */
64
+ export declare function deleteGlobalConfigField(field: keyof GlobalConfig): void;
65
+ /**
66
+ * Save project configuration
67
+ *
68
+ * Merges the provided config with existing project config and writes to
69
+ * .specforge.json in the current directory.
70
+ *
71
+ * Undefined values are removed from the final config.
72
+ *
73
+ * @param config - Partial project config to save
74
+ * @param targetDir - Directory to write .specforge.json to (defaults to cwd)
75
+ * @throws Error if write fails
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * // Initialize project
80
+ * saveProjectConfig({
81
+ * projectId: 'proj_123',
82
+ * specificationId: 'spec_456',
83
+ * });
84
+ *
85
+ * // Update format setting
86
+ * saveProjectConfig({ format: 'json' });
87
+ * ```
88
+ */
89
+ export declare function saveProjectConfig(config: Partial<ProjectConfig>, targetDir?: string): void;
90
+ /**
91
+ * Generate MCP configuration for Claude Code integration
92
+ *
93
+ * Creates a .mcp.json configuration that registers the SpecForge MCP server
94
+ * for Claude Code. The server is registered under the @specforge/mcp
95
+ * package name.
96
+ *
97
+ * @returns MCP config object
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * const mcpConfig = generateMcpConfig();
102
+ * console.log(mcpConfig.mcpServers['@specforge/mcp']);
103
+ * // { command: 'npx', args: [...] }
104
+ * ```
105
+ */
106
+ export declare function generateMcpConfig(): {
107
+ mcpServers: {
108
+ '@specforge/mcp': {
109
+ command: string;
110
+ args: string[];
111
+ };
112
+ };
113
+ };
114
+ /**
115
+ * Save MCP configuration file
116
+ *
117
+ * Writes .mcp.json to the current directory (or specified directory)
118
+ * to enable Claude Code integration with the SpecForge MCP server.
119
+ *
120
+ * @param targetDir - Directory to write .mcp.json to (defaults to cwd)
121
+ * @throws Error if write fails
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * saveMcpConfig();
126
+ * // .mcp.json created in current directory
127
+ * ```
128
+ */
129
+ export declare function saveMcpConfig(targetDir?: string): void;
130
+ /**
131
+ * Add an entry to .gitignore if it exists
132
+ *
133
+ * Does not create .gitignore if it doesn't exist.
134
+ * Does not duplicate existing entries.
135
+ *
136
+ * @param entry - Line to add to .gitignore
137
+ * @param targetDir - Directory containing .gitignore (defaults to cwd)
138
+ * @returns true if entry was added, false if already exists or no .gitignore
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * const added = addToGitignore('.specforge.json');
143
+ * if (added) {
144
+ * console.log('Added .specforge.json to .gitignore');
145
+ * }
146
+ * ```
147
+ */
148
+ export declare function addToGitignore(entry: string, targetDir?: string): boolean;
149
+ /**
150
+ * Remove API key from global config (logout)
151
+ *
152
+ * @example
153
+ * ```typescript
154
+ * clearApiKey();
155
+ * console.log('Logged out successfully');
156
+ * ```
157
+ */
158
+ export declare function clearApiKey(): void;
159
+ /**
160
+ * Check if global config file exists
161
+ *
162
+ * @returns true if ~/.specforge/config.json exists
163
+ */
164
+ export declare function hasGlobalConfig(): boolean;
165
+ /**
166
+ * Check if project config file exists in cwd
167
+ *
168
+ * @returns true if .specforge.json exists
169
+ */
170
+ export declare function hasProjectConfig(): boolean;
171
+ //# sourceMappingURL=writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/cli/config/writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,YAAY,CAAC;AAsBpB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAetC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAgCpE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,YAAY,GAAG,IAAI,CAuBvE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,EAC9B,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAgCN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB;;;;;;;EAShC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAetD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAiCzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}