upfynai-code 2.5.1 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/README.md +123 -88
  2. package/bin/cli.js +63 -0
  3. package/package.json +48 -112
  4. package/src/auth.js +115 -0
  5. package/src/config.js +33 -0
  6. package/src/connect.js +314 -0
  7. package/src/launch.js +54 -0
  8. package/src/mcp.js +57 -0
  9. package/src/server.js +54 -0
  10. package/client/dist/api-docs.html +0 -879
  11. package/client/dist/assets/AppContent-C0CyP3g5.js +0 -513
  12. package/client/dist/assets/CanvasPanel-0u9QR7U-.js +0 -34
  13. package/client/dist/assets/CanvasPanel-WhZulBJw.css +0 -1
  14. package/client/dist/assets/DashboardPanel-Dgqw1yZk.js +0 -1
  15. package/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  16. package/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  17. package/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  18. package/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  19. package/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  20. package/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  21. package/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  22. package/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  23. package/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  24. package/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  25. package/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  26. package/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  27. package/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  28. package/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  29. package/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  30. package/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  31. package/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  32. package/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  33. package/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  34. package/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  35. package/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  36. package/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  37. package/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  38. package/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  39. package/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  40. package/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  41. package/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  42. package/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  43. package/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  44. package/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  45. package/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  46. package/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  47. package/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  48. package/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  49. package/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  50. package/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  51. package/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  52. package/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  53. package/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  54. package/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  55. package/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  56. package/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  57. package/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  58. package/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  59. package/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  60. package/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  61. package/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  62. package/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  63. package/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  64. package/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  65. package/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  66. package/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  67. package/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  68. package/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  69. package/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  70. package/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  71. package/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  72. package/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  73. package/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  74. package/client/dist/assets/LoginModal-CZDEzqjK.js +0 -19
  75. package/client/dist/assets/MarkdownPreview-CYdvwJaV.js +0 -1
  76. package/client/dist/assets/Onboarding-DR6NZ4Vz.js +0 -1
  77. package/client/dist/assets/SetupForm-D49gtWY4.js +0 -1
  78. package/client/dist/assets/Tableau10-B-NsZVaP.js +0 -1
  79. package/client/dist/assets/WorkflowsPanel-CqlbEJA_.js +0 -1
  80. package/client/dist/assets/_commonjs-dynamic-modules-TDtrdbi3.js +0 -1
  81. package/client/dist/assets/ar-SA-G6X2FPQ2-BWqa1yBH.js +0 -10
  82. package/client/dist/assets/arc-BegSKqEW.js +0 -1
  83. package/client/dist/assets/array-BKyUJesY.js +0 -1
  84. package/client/dist/assets/az-AZ-76LH7QW2-DrVlbZDP.js +0 -1
  85. package/client/dist/assets/bg-BG-XCXSNQG7-DdunjBgT.js +0 -5
  86. package/client/dist/assets/blockDiagram-38ab4fdb-BKMbwGHu.js +0 -118
  87. package/client/dist/assets/bn-BD-2XOGV67Q-_7DtmvwO.js +0 -5
  88. package/client/dist/assets/c4Diagram-3d4e48cf-hJuiHhSn.js +0 -10
  89. package/client/dist/assets/ca-ES-6MX7JW3Y-BFIrmojG.js +0 -8
  90. package/client/dist/assets/channel-Bur-rRTp.js +0 -1
  91. package/client/dist/assets/classDiagram-70f12bd4-BjiAf9cM.js +0 -2
  92. package/client/dist/assets/classDiagram-v2-f2320105-pwBewejc.js +0 -2
  93. package/client/dist/assets/clone-BtqXeoBJ.js +0 -1
  94. package/client/dist/assets/createText-2e5e7dd3-Dq_acOWe.js +0 -5
  95. package/client/dist/assets/cs-CZ-2BRQDIVT-B-x4F6TJ.js +0 -11
  96. package/client/dist/assets/da-DK-5WZEPLOC-Btlc8Dgn.js +0 -5
  97. package/client/dist/assets/de-DE-XR44H4JA-BVu3ZIoD.js +0 -8
  98. package/client/dist/assets/directory-open-01563666-DWU9wJ6I.js +0 -1
  99. package/client/dist/assets/directory-open-4ed118d0-CunoC1EB.js +0 -1
  100. package/client/dist/assets/edges-e0da2a9e-DH0wVTXR.js +0 -4
  101. package/client/dist/assets/el-GR-BZB4AONW-h2ll8_ZC.js +0 -10
  102. package/client/dist/assets/erDiagram-9861fffd-BYezLIR7.js +0 -51
  103. package/client/dist/assets/es-ES-U4NZUMDT-Cveiulwt.js +0 -9
  104. package/client/dist/assets/eu-ES-A7QVB2H4-DQluL2PY.js +0 -11
  105. package/client/dist/assets/fa-IR-HGAKTJCU-BJtcMBSv.js +0 -8
  106. package/client/dist/assets/fi-FI-Z5N7JZ37-D8NfbVXV.js +0 -6
  107. package/client/dist/assets/file-open-002ab408-DIuFHtCF.js +0 -1
  108. package/client/dist/assets/file-open-7c801643-684qeFg4.js +0 -1
  109. package/client/dist/assets/file-save-3189631c-C1wFhQhH.js +0 -1
  110. package/client/dist/assets/file-save-745eba88-Bb9F9Kg7.js +0 -1
  111. package/client/dist/assets/flowDb-956e92f1-scnUykhM.js +0 -10
  112. package/client/dist/assets/flowDiagram-66a62f08-jVyWsfyU.js +0 -4
  113. package/client/dist/assets/flowDiagram-v2-96b9c2cf-N6xgi25h.js +0 -1
  114. package/client/dist/assets/flowchart-elk-definition-4a651766-gKGX3HqR.js +0 -139
  115. package/client/dist/assets/fr-FR-RHASNOE6-vdj42kC6.js +0 -9
  116. package/client/dist/assets/ganttDiagram-c361ad54-C2CiWFUP.js +0 -257
  117. package/client/dist/assets/gitGraphDiagram-72cf32ee-C59Yz2LK.js +0 -70
  118. package/client/dist/assets/gl-ES-HMX3MZ6V-DQo0TzoP.js +0 -10
  119. package/client/dist/assets/graph-Dx_H43Kv.js +0 -1
  120. package/client/dist/assets/he-IL-6SHJWFNN-DKXK5e33.js +0 -10
  121. package/client/dist/assets/hi-IN-IWLTKZ5I-C2Qgqc0R.js +0 -4
  122. package/client/dist/assets/hu-HU-A5ZG7DT2-Ss-6vX0m.js +0 -7
  123. package/client/dist/assets/id-ID-SAP4L64H-D7Wsg1S2.js +0 -10
  124. package/client/dist/assets/image-blob-reduce.esm-D6s-rqMO.js +0 -7
  125. package/client/dist/assets/index-3862675e-u8Nv7hHC.js +0 -1
  126. package/client/dist/assets/index-BVowJdZF.js +0 -97
  127. package/client/dist/assets/index-ce18TYkg.js +0 -27
  128. package/client/dist/assets/index-kQoJx-bc.css +0 -1
  129. package/client/dist/assets/infoDiagram-f8f76790-LmoJYsxo.js +0 -7
  130. package/client/dist/assets/init-Gi6I4Gst.js +0 -1
  131. package/client/dist/assets/it-IT-JPQ66NNP-CAPTVl7M.js +0 -11
  132. package/client/dist/assets/ja-JP-DBVTYXUO-eNVPawR2.js +0 -8
  133. package/client/dist/assets/journeyDiagram-49397b02-BaJqehpR.js +0 -139
  134. package/client/dist/assets/kaa-6HZHGXH3-tpuNkKhS.js +0 -1
  135. package/client/dist/assets/kab-KAB-ZGHBKWFO-Dp83kx4x.js +0 -8
  136. package/client/dist/assets/kk-KZ-P5N5QNE5-B9IlC6YN.js +0 -1
  137. package/client/dist/assets/km-KH-HSX4SM5Z-B_KMYaMj.js +0 -11
  138. package/client/dist/assets/ko-KR-MTYHY66A-yebnUNdb.js +0 -9
  139. package/client/dist/assets/ku-TR-6OUDTVRD-BR6fh6-5.js +0 -9
  140. package/client/dist/assets/layout-DLl5Jwcl.js +0 -1
  141. package/client/dist/assets/line-FpB7omSK.js +0 -1
  142. package/client/dist/assets/linear-CkXqUFJ8.js +0 -1
  143. package/client/dist/assets/lt-LT-XHIRWOB4-SutZSWtR.js +0 -3
  144. package/client/dist/assets/lv-LV-5QDEKY6T-DuAxdcZL.js +0 -7
  145. package/client/dist/assets/mindmap-definition-fc14e90a-DyxXOExh.js +0 -425
  146. package/client/dist/assets/mr-IN-CRQNXWMA-DqDUWM_8.js +0 -13
  147. package/client/dist/assets/my-MM-5M5IBNSE-C40kMFMR.js +0 -1
  148. package/client/dist/assets/nb-NO-T6EIAALU-DVij32Ju.js +0 -10
  149. package/client/dist/assets/nl-NL-IS3SIHDZ-rT84mDYq.js +0 -8
  150. package/client/dist/assets/nn-NO-6E72VCQL-BBZXBW8V.js +0 -8
  151. package/client/dist/assets/oc-FR-POXYY2M6-DzjOugOf.js +0 -8
  152. package/client/dist/assets/ordinal-Cboi1Yqb.js +0 -1
  153. package/client/dist/assets/pa-IN-N4M65BXN-DD1iU8_F.js +0 -4
  154. package/client/dist/assets/path-CbwjOpE9.js +0 -1
  155. package/client/dist/assets/pdf-CE_K4jFx.js +0 -12
  156. package/client/dist/assets/pdf.worker-BA9kU3Pw.mjs +0 -61080
  157. package/client/dist/assets/percentages-BXMCSKIN-WVlHS4wx.js +0 -207
  158. package/client/dist/assets/pica-CQIY57Tf.js +0 -7
  159. package/client/dist/assets/pieDiagram-8a3498a8-Dd_85qBH.js +0 -35
  160. package/client/dist/assets/pl-PL-T2D74RX3-ukVXa48G.js +0 -9
  161. package/client/dist/assets/pt-BR-5N22H2LF-BibawarT.js +0 -9
  162. package/client/dist/assets/pt-PT-UZXXM6DQ-So3i9l9w.js +0 -9
  163. package/client/dist/assets/quadrantDiagram-120e2f19-C4dFVDEx.js +0 -7
  164. package/client/dist/assets/requirementDiagram-deff3bca-DrTO7yFl.js +0 -52
  165. package/client/dist/assets/ro-RO-JPDTUUEW-DY0Xq_Hd.js +0 -11
  166. package/client/dist/assets/roundRect-0PYZxl1G.js +0 -1
  167. package/client/dist/assets/ru-RU-B4JR7IUQ-B7u_Zvkd.js +0 -9
  168. package/client/dist/assets/sankeyDiagram-04a897e0-D24gfzuS.js +0 -8
  169. package/client/dist/assets/sequenceDiagram-704730f1-Dgji2XLQ.js +0 -122
  170. package/client/dist/assets/si-LK-N5RQ5JYF-OejsLzQ_.js +0 -1
  171. package/client/dist/assets/sk-SK-C5VTKIMK-_vy2Bt-M.js +0 -6
  172. package/client/dist/assets/sl-SI-NN7IZMDC-DKOl_u2M.js +0 -6
  173. package/client/dist/assets/stateDiagram-587899a1-CJ8eBaiU.js +0 -1
  174. package/client/dist/assets/stateDiagram-v2-d93cdb3a-C5K3l-Nt.js +0 -1
  175. package/client/dist/assets/styles-6aaf32cf-DAKE0jbx.js +0 -207
  176. package/client/dist/assets/styles-9a916d00-LFAJCgEy.js +0 -160
  177. package/client/dist/assets/styles-c10674c1-CllKO8NG.js +0 -116
  178. package/client/dist/assets/subset-shared.chunk-Uy-J87FQ.js +0 -84
  179. package/client/dist/assets/subset-worker.chunk-dvgDvqt9.js +0 -1
  180. package/client/dist/assets/sv-SE-XGPEYMSR-CDCB2ZV5.js +0 -10
  181. package/client/dist/assets/svgDrawCommon-08f97a94-CObOzbFQ.js +0 -1
  182. package/client/dist/assets/ta-IN-2NMHFXQM-DHUNdO69.js +0 -9
  183. package/client/dist/assets/th-TH-HPSO5L25-zI2hnBq3.js +0 -2
  184. package/client/dist/assets/timeline-definition-85554ec2-C2XHRmxK.js +0 -61
  185. package/client/dist/assets/tr-TR-DEFEU3FU-l-6Hu4-D.js +0 -7
  186. package/client/dist/assets/uk-UA-QMV73CPH-CqSOwrl7.js +0 -6
  187. package/client/dist/assets/vendor-codemirror-D_s0aGBu.js +0 -35
  188. package/client/dist/assets/vendor-i18n-DCFGyhQR.js +0 -1
  189. package/client/dist/assets/vendor-icons-Lb69KSFJ.js +0 -646
  190. package/client/dist/assets/vendor-markdown-BXEi_H3G.js +0 -298
  191. package/client/dist/assets/vendor-react-9mUTKBHH.js +0 -67
  192. package/client/dist/assets/vendor-syntax-DnmwQQJF.js +0 -16
  193. package/client/dist/assets/vendor-xterm-CZq1hqo1.js +0 -66
  194. package/client/dist/assets/vendor-xterm-qxJ8_QYu.css +0 -32
  195. package/client/dist/assets/vi-VN-M7AON7JQ-CUL8-mBZ.js +0 -5
  196. package/client/dist/assets/xychartDiagram-e933f94c-1fmf6slj.js +0 -7
  197. package/client/dist/assets/zh-CN-LNUGB5OW-CB5y5VVU.js +0 -10
  198. package/client/dist/assets/zh-HK-E62DVLB3-BHcrrEeJ.js +0 -1
  199. package/client/dist/assets/zh-TW-RAJ6MFWO-DoDUdkaJ.js +0 -9
  200. package/client/dist/clear-cache.html +0 -85
  201. package/client/dist/convert-icons.md +0 -53
  202. package/client/dist/favicon.png +0 -0
  203. package/client/dist/favicon.svg +0 -9
  204. package/client/dist/generate-icons.js +0 -49
  205. package/client/dist/icons/claude-ai-icon.svg +0 -1
  206. package/client/dist/icons/codex-white.svg +0 -3
  207. package/client/dist/icons/codex.svg +0 -3
  208. package/client/dist/icons/cursor-white.svg +0 -12
  209. package/client/dist/icons/cursor.svg +0 -1
  210. package/client/dist/icons/icon-128x128.png +0 -0
  211. package/client/dist/icons/icon-128x128.svg +0 -12
  212. package/client/dist/icons/icon-144x144.png +0 -0
  213. package/client/dist/icons/icon-144x144.svg +0 -12
  214. package/client/dist/icons/icon-152x152.png +0 -0
  215. package/client/dist/icons/icon-152x152.svg +0 -12
  216. package/client/dist/icons/icon-192x192.png +0 -0
  217. package/client/dist/icons/icon-192x192.svg +0 -12
  218. package/client/dist/icons/icon-384x384.png +0 -0
  219. package/client/dist/icons/icon-384x384.svg +0 -12
  220. package/client/dist/icons/icon-512x512.png +0 -0
  221. package/client/dist/icons/icon-512x512.svg +0 -12
  222. package/client/dist/icons/icon-72x72.png +0 -0
  223. package/client/dist/icons/icon-72x72.svg +0 -12
  224. package/client/dist/icons/icon-96x96.png +0 -0
  225. package/client/dist/icons/icon-96x96.svg +0 -12
  226. package/client/dist/icons/icon-template.svg +0 -12
  227. package/client/dist/index.html +0 -128
  228. package/client/dist/logo-128.png +0 -0
  229. package/client/dist/logo-256.png +0 -0
  230. package/client/dist/logo-32.png +0 -0
  231. package/client/dist/logo-512.png +0 -0
  232. package/client/dist/logo-64.png +0 -0
  233. package/client/dist/logo.svg +0 -17
  234. package/client/dist/manifest.json +0 -61
  235. package/client/dist/mcp-docs.html +0 -119
  236. package/client/dist/screenshots/cli-selection.png +0 -0
  237. package/client/dist/screenshots/desktop-main.png +0 -0
  238. package/client/dist/screenshots/mobile-chat.png +0 -0
  239. package/client/dist/screenshots/tools-modal.png +0 -0
  240. package/client/dist/sw.js +0 -19
  241. package/commands/upfynai-connect.md +0 -59
  242. package/commands/upfynai-disconnect.md +0 -31
  243. package/commands/upfynai-doctor.md +0 -99
  244. package/commands/upfynai-export.md +0 -49
  245. package/commands/upfynai-local.md +0 -82
  246. package/commands/upfynai-status.md +0 -75
  247. package/commands/upfynai-stop.md +0 -49
  248. package/commands/upfynai-uninstall.md +0 -58
  249. package/commands/upfynai.md +0 -69
  250. package/scripts/build-client.js +0 -17
  251. package/scripts/fix-node-pty.js +0 -67
  252. package/scripts/install-commands.js +0 -78
  253. package/server/claude-sdk.js +0 -714
  254. package/server/cli-ui.js +0 -785
  255. package/server/cli.js +0 -596
  256. package/server/constants/config.js +0 -31
  257. package/server/cursor-cli.js +0 -270
  258. package/server/database/auth.db +0 -0
  259. package/server/database/db.js +0 -808
  260. package/server/database/init.sql +0 -70
  261. package/server/index.js +0 -2621
  262. package/server/load-env.js +0 -26
  263. package/server/mcp-server.js +0 -621
  264. package/server/middleware/auth.js +0 -173
  265. package/server/openai-codex.js +0 -403
  266. package/server/openrouter.js +0 -137
  267. package/server/projects.js +0 -1742
  268. package/server/relay-client.js +0 -619
  269. package/server/routes/agent.js +0 -1266
  270. package/server/routes/auth.js +0 -263
  271. package/server/routes/cli-auth.js +0 -263
  272. package/server/routes/codex.js +0 -344
  273. package/server/routes/commands.js +0 -601
  274. package/server/routes/cursor.js +0 -808
  275. package/server/routes/dashboard.js +0 -52
  276. package/server/routes/git.js +0 -1165
  277. package/server/routes/mcp-utils.js +0 -48
  278. package/server/routes/mcp.js +0 -552
  279. package/server/routes/payments.js +0 -172
  280. package/server/routes/projects.js +0 -552
  281. package/server/routes/settings.js +0 -269
  282. package/server/routes/taskmaster.js +0 -1964
  283. package/server/routes/user.js +0 -106
  284. package/server/routes/voice.js +0 -198
  285. package/server/routes/webhooks.js +0 -166
  286. package/server/routes/workflows.js +0 -118
  287. package/server/services/whisperService.js +0 -84
  288. package/server/services/workflowScheduler.js +0 -186
  289. package/server/utils/commandParser.js +0 -303
  290. package/server/utils/gitConfig.js +0 -24
  291. package/server/utils/mcp-detector.js +0 -198
  292. package/server/utils/taskmaster-websocket.js +0 -129
  293. package/shared/modelConstants.js +0 -96
@@ -1,48 +0,0 @@
1
- /**
2
- * MCP UTILITIES API ROUTES
3
- * ========================
4
- *
5
- * API endpoints for MCP server detection and configuration utilities.
6
- * These endpoints expose centralized MCP detection functionality.
7
- */
8
-
9
- import express from 'express';
10
- import { detectTaskMasterMCPServer, getAllMCPServers } from '../utils/mcp-detector.js';
11
-
12
- const router = express.Router();
13
-
14
- /**
15
- * GET /api/mcp-utils/taskmaster-server
16
- * Check if TaskMaster MCP server is configured
17
- */
18
- router.get('/taskmaster-server', async (req, res) => {
19
- try {
20
- const result = await detectTaskMasterMCPServer();
21
- res.json(result);
22
- } catch (error) {
23
- // MCP detection error
24
- res.status(500).json({
25
- error: 'Failed to detect TaskMaster MCP server',
26
- message: 'An error occurred'
27
- });
28
- }
29
- });
30
-
31
- /**
32
- * GET /api/mcp-utils/all-servers
33
- * Get all configured MCP servers
34
- */
35
- router.get('/all-servers', async (req, res) => {
36
- try {
37
- const result = await getAllMCPServers();
38
- res.json(result);
39
- } catch (error) {
40
- // MCP servers detection error
41
- res.status(500).json({
42
- error: 'Failed to get MCP servers',
43
- message: 'An error occurred'
44
- });
45
- }
46
- });
47
-
48
- export default router;
@@ -1,552 +0,0 @@
1
- import express from 'express';
2
- import { promises as fs } from 'fs';
3
- import path from 'path';
4
- import os from 'os';
5
- import { fileURLToPath } from 'url';
6
- import { dirname } from 'path';
7
- import { spawn } from 'child_process';
8
-
9
- const router = express.Router();
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = dirname(__filename);
12
-
13
- // Claude CLI command routes
14
-
15
- // GET /api/mcp/cli/list - List MCP servers using Claude CLI
16
- router.get('/cli/list', async (req, res) => {
17
- try {
18
- console.log('📋 Listing MCP servers using Claude CLI');
19
-
20
- const { spawn } = await import('child_process');
21
- const { promisify } = await import('util');
22
- const exec = promisify(spawn);
23
-
24
- const process = spawn('claude', ['mcp', 'list'], {
25
- stdio: ['pipe', 'pipe', 'pipe']
26
- });
27
-
28
- let stdout = '';
29
- let stderr = '';
30
-
31
- process.stdout.on('data', (data) => {
32
- stdout += data.toString();
33
- });
34
-
35
- process.stderr.on('data', (data) => {
36
- stderr += data.toString();
37
- });
38
-
39
- process.on('close', (code) => {
40
- if (code === 0) {
41
- res.json({ success: true, output: stdout, servers: parseClaudeListOutput(stdout) });
42
- } else {
43
- // CLI error
44
- res.status(500).json({ error: 'Claude CLI command failed', details: stderr });
45
- }
46
- });
47
-
48
- process.on('error', (error) => {
49
- // CLI run error
50
- res.status(500).json({ error: 'Failed to run Claude CLI', details: 'An error occurred' });
51
- });
52
- } catch (error) {
53
- // MCP list error
54
- res.status(500).json({ error: 'Failed to list MCP servers', details: 'An error occurred' });
55
- }
56
- });
57
-
58
- // POST /api/mcp/cli/add - Add MCP server using Claude CLI
59
- router.post('/cli/add', async (req, res) => {
60
- try {
61
- const { name, type = 'stdio', command, args = [], url, headers = {}, env = {}, scope = 'user', projectPath } = req.body;
62
-
63
- console.log(`➕ Adding MCP server using Claude CLI (${scope} scope):`, name);
64
-
65
- const { spawn } = await import('child_process');
66
-
67
- let cliArgs = ['mcp', 'add'];
68
-
69
- // Add scope flag
70
- cliArgs.push('--scope', scope);
71
-
72
- if (type === 'http') {
73
- cliArgs.push('--transport', 'http', name, url);
74
- // Add headers if provided
75
- Object.entries(headers).forEach(([key, value]) => {
76
- cliArgs.push('--header', `${key}: ${value}`);
77
- });
78
- } else if (type === 'sse') {
79
- cliArgs.push('--transport', 'sse', name, url);
80
- // Add headers if provided
81
- Object.entries(headers).forEach(([key, value]) => {
82
- cliArgs.push('--header', `${key}: ${value}`);
83
- });
84
- } else {
85
- // stdio (default): claude mcp add --scope user <name> <command> [args...]
86
- cliArgs.push(name);
87
- // Add environment variables
88
- Object.entries(env).forEach(([key, value]) => {
89
- cliArgs.push('-e', `${key}=${value}`);
90
- });
91
- cliArgs.push(command);
92
- if (args && args.length > 0) {
93
- cliArgs.push(...args);
94
- }
95
- }
96
-
97
- console.log('🔧 Running Claude CLI command:', 'claude', cliArgs.join(' '));
98
-
99
- // For local scope, we need to run the command in the project directory
100
- const spawnOptions = {
101
- stdio: ['pipe', 'pipe', 'pipe']
102
- };
103
-
104
- if (scope === 'local' && projectPath) {
105
- spawnOptions.cwd = projectPath;
106
- console.log('📁 Running in project directory:', projectPath);
107
- }
108
-
109
- const process = spawn('claude', cliArgs, spawnOptions);
110
-
111
- let stdout = '';
112
- let stderr = '';
113
-
114
- process.stdout.on('data', (data) => {
115
- stdout += data.toString();
116
- });
117
-
118
- process.stderr.on('data', (data) => {
119
- stderr += data.toString();
120
- });
121
-
122
- process.on('close', (code) => {
123
- if (code === 0) {
124
- res.json({ success: true, output: stdout, message: `MCP server "${name}" added successfully` });
125
- } else {
126
- // CLI error
127
- res.status(400).json({ error: 'Claude CLI command failed', details: stderr });
128
- }
129
- });
130
-
131
- process.on('error', (error) => {
132
- // CLI run error
133
- res.status(500).json({ error: 'Failed to run Claude CLI', details: 'An error occurred' });
134
- });
135
- } catch (error) {
136
- // MCP add error
137
- res.status(500).json({ error: 'Failed to add MCP server', details: 'An error occurred' });
138
- }
139
- });
140
-
141
- // POST /api/mcp/cli/add-json - Add MCP server using JSON format
142
- router.post('/cli/add-json', async (req, res) => {
143
- try {
144
- const { name, jsonConfig, scope = 'user', projectPath } = req.body;
145
-
146
- console.log('➕ Adding MCP server using JSON format:', name);
147
-
148
- // Validate and parse JSON config
149
- let parsedConfig;
150
- try {
151
- parsedConfig = typeof jsonConfig === 'string' ? JSON.parse(jsonConfig) : jsonConfig;
152
- } catch (parseError) {
153
- return res.status(400).json({
154
- error: 'Invalid JSON configuration',
155
- details: parseError.message
156
- });
157
- }
158
-
159
- // Validate required fields
160
- if (!parsedConfig.type) {
161
- return res.status(400).json({
162
- error: 'Invalid configuration',
163
- details: 'Missing required field: type'
164
- });
165
- }
166
-
167
- if (parsedConfig.type === 'stdio' && !parsedConfig.command) {
168
- return res.status(400).json({
169
- error: 'Invalid configuration',
170
- details: 'stdio type requires a command field'
171
- });
172
- }
173
-
174
- if ((parsedConfig.type === 'http' || parsedConfig.type === 'sse') && !parsedConfig.url) {
175
- return res.status(400).json({
176
- error: 'Invalid configuration',
177
- details: `${parsedConfig.type} type requires a url field`
178
- });
179
- }
180
-
181
- const { spawn } = await import('child_process');
182
-
183
- // Build the command: claude mcp add-json --scope <scope> <name> '<json>'
184
- const cliArgs = ['mcp', 'add-json', '--scope', scope, name];
185
-
186
- // Add the JSON config as a properly formatted string
187
- const jsonString = JSON.stringify(parsedConfig);
188
- cliArgs.push(jsonString);
189
-
190
- console.log('🔧 Running Claude CLI command:', 'claude', cliArgs[0], cliArgs[1], cliArgs[2], cliArgs[3], cliArgs[4], jsonString);
191
-
192
- // For local scope, we need to run the command in the project directory
193
- const spawnOptions = {
194
- stdio: ['pipe', 'pipe', 'pipe']
195
- };
196
-
197
- if (scope === 'local' && projectPath) {
198
- spawnOptions.cwd = projectPath;
199
- console.log('📁 Running in project directory:', projectPath);
200
- }
201
-
202
- const process = spawn('claude', cliArgs, spawnOptions);
203
-
204
- let stdout = '';
205
- let stderr = '';
206
-
207
- process.stdout.on('data', (data) => {
208
- stdout += data.toString();
209
- });
210
-
211
- process.stderr.on('data', (data) => {
212
- stderr += data.toString();
213
- });
214
-
215
- process.on('close', (code) => {
216
- if (code === 0) {
217
- res.json({ success: true, output: stdout, message: `MCP server "${name}" added successfully via JSON` });
218
- } else {
219
- // CLI error
220
- res.status(400).json({ error: 'Claude CLI command failed', details: stderr });
221
- }
222
- });
223
-
224
- process.on('error', (error) => {
225
- // CLI run error
226
- res.status(500).json({ error: 'Failed to run Claude CLI', details: 'An error occurred' });
227
- });
228
- } catch (error) {
229
- // MCP JSON add error
230
- res.status(500).json({ error: 'Failed to add MCP server', details: 'An error occurred' });
231
- }
232
- });
233
-
234
- // DELETE /api/mcp/cli/remove/:name - Remove MCP server using Claude CLI
235
- router.delete('/cli/remove/:name', async (req, res) => {
236
- try {
237
- const { name } = req.params;
238
- const { scope } = req.query; // Get scope from query params
239
-
240
- // Handle the ID format (remove scope prefix if present)
241
- let actualName = name;
242
- let actualScope = scope;
243
-
244
- // If the name includes a scope prefix like "local:test", extract it
245
- if (name.includes(':')) {
246
- const [prefix, serverName] = name.split(':');
247
- actualName = serverName;
248
- actualScope = actualScope || prefix; // Use prefix as scope if not provided in query
249
- }
250
-
251
- console.log('🗑️ Removing MCP server using Claude CLI:', actualName, 'scope:', actualScope);
252
-
253
- const { spawn } = await import('child_process');
254
-
255
- // Build command args based on scope
256
- let cliArgs = ['mcp', 'remove'];
257
-
258
- // Add scope flag if it's local scope
259
- if (actualScope === 'local') {
260
- cliArgs.push('--scope', 'local');
261
- } else if (actualScope === 'user' || !actualScope) {
262
- // User scope is default, but we can be explicit
263
- cliArgs.push('--scope', 'user');
264
- }
265
-
266
- cliArgs.push(actualName);
267
-
268
- console.log('🔧 Running Claude CLI command:', 'claude', cliArgs.join(' '));
269
-
270
- const process = spawn('claude', cliArgs, {
271
- stdio: ['pipe', 'pipe', 'pipe']
272
- });
273
-
274
- let stdout = '';
275
- let stderr = '';
276
-
277
- process.stdout.on('data', (data) => {
278
- stdout += data.toString();
279
- });
280
-
281
- process.stderr.on('data', (data) => {
282
- stderr += data.toString();
283
- });
284
-
285
- process.on('close', (code) => {
286
- if (code === 0) {
287
- res.json({ success: true, output: stdout, message: `MCP server "${name}" removed successfully` });
288
- } else {
289
- // CLI error
290
- res.status(400).json({ error: 'Claude CLI command failed', details: stderr });
291
- }
292
- });
293
-
294
- process.on('error', (error) => {
295
- // CLI run error
296
- res.status(500).json({ error: 'Failed to run Claude CLI', details: 'An error occurred' });
297
- });
298
- } catch (error) {
299
- // MCP remove error
300
- res.status(500).json({ error: 'Failed to remove MCP server', details: 'An error occurred' });
301
- }
302
- });
303
-
304
- // GET /api/mcp/cli/get/:name - Get MCP server details using Claude CLI
305
- router.get('/cli/get/:name', async (req, res) => {
306
- try {
307
- const { name } = req.params;
308
-
309
- // getting MCP server details
310
-
311
- const { spawn } = await import('child_process');
312
-
313
- const process = spawn('claude', ['mcp', 'get', name], {
314
- stdio: ['pipe', 'pipe', 'pipe']
315
- });
316
-
317
- let stdout = '';
318
- let stderr = '';
319
-
320
- process.stdout.on('data', (data) => {
321
- stdout += data.toString();
322
- });
323
-
324
- process.stderr.on('data', (data) => {
325
- stderr += data.toString();
326
- });
327
-
328
- process.on('close', (code) => {
329
- if (code === 0) {
330
- res.json({ success: true, output: stdout, server: parseClaudeGetOutput(stdout) });
331
- } else {
332
- // CLI error
333
- res.status(404).json({ error: 'Claude CLI command failed', details: stderr });
334
- }
335
- });
336
-
337
- process.on('error', (error) => {
338
- // CLI run error
339
- res.status(500).json({ error: 'Failed to run Claude CLI', details: 'An error occurred' });
340
- });
341
- } catch (error) {
342
- // MCP CLI details error
343
- res.status(500).json({ error: 'Failed to get MCP server details', details: 'An error occurred' });
344
- }
345
- });
346
-
347
- // GET /api/mcp/config/read - Read MCP servers directly from Claude config files
348
- router.get('/config/read', async (req, res) => {
349
- try {
350
- console.log('📖 Reading MCP servers from Claude config files');
351
-
352
- const homeDir = os.homedir();
353
- const configPaths = [
354
- path.join(homeDir, '.claude.json'),
355
- path.join(homeDir, '.claude', 'settings.json')
356
- ];
357
-
358
- let configData = null;
359
- let configPath = null;
360
-
361
- // Try to read from either config file
362
- for (const filepath of configPaths) {
363
- try {
364
- const fileContent = await fs.readFile(filepath, 'utf8');
365
- configData = JSON.parse(fileContent);
366
- configPath = filepath;
367
- console.log(`✅ Found Claude config at: ${filepath}`);
368
- break;
369
- } catch (error) {
370
- // File doesn't exist or is not valid JSON, try next
371
- console.log(`ℹ️ Config not found or invalid at: ${filepath}`);
372
- }
373
- }
374
-
375
- if (!configData) {
376
- return res.json({
377
- success: false,
378
- message: 'No Claude configuration file found',
379
- servers: []
380
- });
381
- }
382
-
383
- // Extract MCP servers from the config
384
- const servers = [];
385
-
386
- // Check for user-scoped MCP servers (at root level)
387
- if (configData.mcpServers && typeof configData.mcpServers === 'object' && Object.keys(configData.mcpServers).length > 0) {
388
- console.log('🔍 Found user-scoped MCP servers:', Object.keys(configData.mcpServers));
389
- for (const [name, config] of Object.entries(configData.mcpServers)) {
390
- const server = {
391
- id: name,
392
- name: name,
393
- type: 'stdio', // Default type
394
- scope: 'user', // User scope - available across all projects
395
- config: {},
396
- raw: config // Include raw config for full details
397
- };
398
-
399
- // Determine transport type and extract config
400
- if (config.command) {
401
- server.type = 'stdio';
402
- server.config.command = config.command;
403
- server.config.args = config.args || [];
404
- server.config.env = config.env || {};
405
- } else if (config.url) {
406
- server.type = config.transport || 'http';
407
- server.config.url = config.url;
408
- server.config.headers = config.headers || {};
409
- }
410
-
411
- servers.push(server);
412
- }
413
- }
414
-
415
- // Check for local-scoped MCP servers (project-specific)
416
- const currentProjectPath = process.cwd();
417
-
418
- // Check under 'projects' key
419
- if (configData.projects && configData.projects[currentProjectPath]) {
420
- const projectConfig = configData.projects[currentProjectPath];
421
- if (projectConfig.mcpServers && typeof projectConfig.mcpServers === 'object' && Object.keys(projectConfig.mcpServers).length > 0) {
422
- console.log(`🔍 Found local-scoped MCP servers for ${currentProjectPath}:`, Object.keys(projectConfig.mcpServers));
423
- for (const [name, config] of Object.entries(projectConfig.mcpServers)) {
424
- const server = {
425
- id: `local:${name}`, // Prefix with scope for uniqueness
426
- name: name, // Keep original name
427
- type: 'stdio', // Default type
428
- scope: 'local', // Local scope - only for this project
429
- projectPath: currentProjectPath,
430
- config: {},
431
- raw: config // Include raw config for full details
432
- };
433
-
434
- // Determine transport type and extract config
435
- if (config.command) {
436
- server.type = 'stdio';
437
- server.config.command = config.command;
438
- server.config.args = config.args || [];
439
- server.config.env = config.env || {};
440
- } else if (config.url) {
441
- server.type = config.transport || 'http';
442
- server.config.url = config.url;
443
- server.config.headers = config.headers || {};
444
- }
445
-
446
- servers.push(server);
447
- }
448
- }
449
- }
450
-
451
- console.log(`📋 Found ${servers.length} MCP servers in config`);
452
-
453
- res.json({
454
- success: true,
455
- configPath: configPath,
456
- servers: servers
457
- });
458
- } catch (error) {
459
- console.error('Error reading Claude config:', error);
460
- res.status(500).json({
461
- error: 'Failed to read Claude configuration',
462
- details: 'An error occurred'
463
- });
464
- }
465
- });
466
-
467
- // Helper functions to parse Claude CLI output
468
- function parseClaudeListOutput(output) {
469
- const servers = [];
470
- const lines = output.split('\n').filter(line => line.trim());
471
-
472
- for (const line of lines) {
473
- // Skip the header line
474
- if (line.includes('Checking MCP server health')) continue;
475
-
476
- // Parse lines like "test: test test - ✗ Failed to connect"
477
- // or "server-name: command or description - ✓ Connected"
478
- if (line.includes(':')) {
479
- const colonIndex = line.indexOf(':');
480
- const name = line.substring(0, colonIndex).trim();
481
-
482
- // Skip empty names
483
- if (!name) continue;
484
-
485
- // Extract the rest after the name
486
- const rest = line.substring(colonIndex + 1).trim();
487
-
488
- // Try to extract description and status
489
- let description = rest;
490
- let status = 'unknown';
491
- let type = 'stdio'; // default type
492
-
493
- // Check for status indicators
494
- if (rest.includes('✓') || rest.includes('✗')) {
495
- const statusMatch = rest.match(/(.*?)\s*-\s*([✓✗].*)$/);
496
- if (statusMatch) {
497
- description = statusMatch[1].trim();
498
- status = statusMatch[2].includes('✓') ? 'connected' : 'failed';
499
- }
500
- }
501
-
502
- // Try to determine type from description
503
- if (description.startsWith('http://') || description.startsWith('https://')) {
504
- type = 'http';
505
- }
506
-
507
- servers.push({
508
- name,
509
- type,
510
- status: status || 'active',
511
- description
512
- });
513
- }
514
- }
515
-
516
- console.log('🔍 Parsed Claude CLI servers:', servers);
517
- return servers;
518
- }
519
-
520
- function parseClaudeGetOutput(output) {
521
- // Parse the output from 'claude mcp get <name>' command
522
- // This is a simple parser - might need adjustment based on actual output format
523
- try {
524
- // Try to extract JSON if present
525
- const jsonMatch = output.match(/\{[\s\S]*\}/);
526
- if (jsonMatch) {
527
- return JSON.parse(jsonMatch[0]);
528
- }
529
-
530
- // Otherwise, parse as text
531
- const server = { raw_output: output };
532
- const lines = output.split('\n');
533
-
534
- for (const line of lines) {
535
- if (line.includes('Name:')) {
536
- server.name = line.split(':')[1]?.trim();
537
- } else if (line.includes('Type:')) {
538
- server.type = line.split(':')[1]?.trim();
539
- } else if (line.includes('Command:')) {
540
- server.command = line.split(':')[1]?.trim();
541
- } else if (line.includes('URL:')) {
542
- server.url = line.split(':')[1]?.trim();
543
- }
544
- }
545
-
546
- return server;
547
- } catch (error) {
548
- return { raw_output: output, parse_error: error.message };
549
- }
550
- }
551
-
552
- export default router;