superacli 1.1.21 → 1.1.23

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 (375) hide show
  1. package/.beads/.br_history/{issues.20260426_162712_190824905.jsonl → issues.20260427_104606_658098709.jsonl} +49 -48
  2. package/.beads/.br_history/{issues.20260426_162513_726336785.jsonl → issues.20260427_104607_085798670.jsonl} +50 -48
  3. package/.beads/.br_history/{issues.20260426_162331_516939737.jsonl → issues.20260427_104607_627598880.jsonl} +51 -48
  4. package/.beads/.br_history/{issues.20260426_134150_938793400.jsonl → issues.20260427_104608_071298223.jsonl} +52 -48
  5. package/.beads/.br_history/issues.20260427_104615_198124329.jsonl +261 -0
  6. package/.beads/.br_history/issues.20260427_104615_669652069.jsonl +261 -0
  7. package/.beads/.br_history/issues.20260427_104637_752744777.jsonl +261 -0
  8. package/.beads/.br_history/issues.20260427_104638_209211116.jsonl +261 -0
  9. package/.beads/.br_history/issues.20260427_104638_898729442.jsonl +261 -0
  10. package/.beads/.br_history/issues.20260427_104639_368827997.jsonl +261 -0
  11. package/.beads/.br_history/issues.20260427_104639_823343822.jsonl +261 -0
  12. package/.beads/.br_history/issues.20260427_104640_354170001.jsonl +261 -0
  13. package/.beads/.br_history/issues.20260427_104640_937129660.jsonl +261 -0
  14. package/.beads/.br_history/issues.20260427_104647_408876191.jsonl +261 -0
  15. package/.beads/.br_history/issues.20260427_104659_300660476.jsonl +261 -0
  16. package/.beads/.br_history/issues.20260427_104800_415120762.jsonl +261 -0
  17. package/.beads/.br_history/issues.20260427_104901_529669396.jsonl +261 -0
  18. package/.beads/.br_history/issues.20260427_105002_587183822.jsonl +261 -0
  19. package/.beads/.br_history/issues.20260427_105103_686748531.jsonl +261 -0
  20. package/.beads/.br_history/issues.20260427_105204_721591044.jsonl +261 -0
  21. package/.beads/.br_history/issues.20260427_105305_855661211.jsonl +261 -0
  22. package/.beads/.br_history/issues.20260427_105407_641630152.jsonl +261 -0
  23. package/.beads/.br_history/issues.20260427_105509_159649245.jsonl +261 -0
  24. package/.beads/.br_history/issues.20260427_105610_283950586.jsonl +261 -0
  25. package/.beads/.br_history/issues.20260427_105637_656057143.jsonl +261 -0
  26. package/.beads/.br_history/issues.20260427_105738_863187883.jsonl +261 -0
  27. package/.beads/.br_history/issues.20260427_105839_958463404.jsonl +261 -0
  28. package/.beads/.br_history/issues.20260427_105941_092827317.jsonl +261 -0
  29. package/.beads/.br_history/issues.20260427_110042_110436110.jsonl +261 -0
  30. package/.beads/.br_history/issues.20260427_110143_343801118.jsonl +261 -0
  31. package/.beads/.br_history/issues.20260427_110244_379134729.jsonl +261 -0
  32. package/.beads/.br_history/issues.20260427_110345_445658284.jsonl +261 -0
  33. package/.beads/.br_history/issues.20260427_110446_689391882.jsonl +261 -0
  34. package/.beads/.br_history/issues.20260427_110547_667705716.jsonl +261 -0
  35. package/.beads/.br_history/issues.20260427_110609_987816377.jsonl +261 -0
  36. package/.beads/.br_history/issues.20260427_110711_086550915.jsonl +261 -0
  37. package/.beads/.br_history/issues.20260427_110812_204821395.jsonl +261 -0
  38. package/.beads/.br_history/issues.20260427_110913_259688311.jsonl +261 -0
  39. package/.beads/.br_history/issues.20260427_111014_297775509.jsonl +261 -0
  40. package/.beads/.br_history/issues.20260427_111115_195150935.jsonl +261 -0
  41. package/.beads/.br_history/issues.20260427_111216_316259530.jsonl +261 -0
  42. package/.beads/.br_history/issues.20260427_111317_298020330.jsonl +261 -0
  43. package/.beads/.br_history/issues.20260427_111418_604431267.jsonl +261 -0
  44. package/.beads/.br_history/issues.20260427_111519_617870969.jsonl +261 -0
  45. package/.beads/.br_history/issues.20260427_111533_024097015.jsonl +261 -0
  46. package/.beads/.br_history/issues.20260427_111634_138814655.jsonl +261 -0
  47. package/.beads/.br_history/issues.20260427_111737_148398766.jsonl +261 -0
  48. package/.beads/.br_history/issues.20260427_111838_507704112.jsonl +261 -0
  49. package/.beads/.br_history/issues.20260427_111939_468325527.jsonl +261 -0
  50. package/.beads/.br_history/issues.20260427_112041_044923744.jsonl +261 -0
  51. package/.beads/.br_history/issues.20260427_112142_224127430.jsonl +261 -0
  52. package/.beads/.br_history/issues.20260427_112243_212317525.jsonl +261 -0
  53. package/.beads/.br_history/issues.20260427_112344_182300930.jsonl +261 -0
  54. package/.beads/.br_history/issues.20260427_112445_197922899.jsonl +261 -0
  55. package/.beads/.br_history/issues.20260427_112502_597304488.jsonl +261 -0
  56. package/.beads/.br_history/issues.20260427_112604_292832651.jsonl +261 -0
  57. package/.beads/.br_history/issues.20260427_112706_051581607.jsonl +261 -0
  58. package/.beads/.br_history/issues.20260427_112807_066213762.jsonl +261 -0
  59. package/.beads/.br_history/issues.20260427_112908_145315373.jsonl +261 -0
  60. package/.beads/.br_history/issues.20260427_113009_141079023.jsonl +261 -0
  61. package/.beads/.br_history/issues.20260427_113110_601071412.jsonl +261 -0
  62. package/.beads/.br_history/issues.20260427_113211_601412739.jsonl +261 -0
  63. package/.beads/.br_history/issues.20260427_113312_771171767.jsonl +261 -0
  64. package/.beads/.br_history/issues.20260427_113413_719165420.jsonl +261 -0
  65. package/.beads/.br_history/issues.20260427_113430_416576564.jsonl +261 -0
  66. package/.beads/.br_history/issues.20260427_113531_553842703.jsonl +261 -0
  67. package/.beads/.br_history/issues.20260427_113633_137526241.jsonl +261 -0
  68. package/.beads/.br_history/issues.20260427_113735_697152101.jsonl +261 -0
  69. package/.beads/.br_history/issues.20260427_113836_810884202.jsonl +261 -0
  70. package/.beads/.br_history/issues.20260427_113938_312284719.jsonl +261 -0
  71. package/.beads/.br_history/issues.20260427_114039_390178502.jsonl +261 -0
  72. package/.beads/.br_history/issues.20260427_114140_483586632.jsonl +261 -0
  73. package/.beads/.br_history/issues.20260427_114241_502376670.jsonl +261 -0
  74. package/.beads/.br_history/issues.20260427_114342_927243830.jsonl +261 -0
  75. package/.beads/.br_history/issues.20260427_114405_996651227.jsonl +261 -0
  76. package/.beads/.br_history/issues.20260427_114507_946708398.jsonl +261 -0
  77. package/.beads/.br_history/issues.20260427_114608_914493506.jsonl +261 -0
  78. package/.beads/.br_history/issues.20260427_114709_935565841.jsonl +261 -0
  79. package/.beads/.br_history/issues.20260427_114810_981588378.jsonl +261 -0
  80. package/.beads/.br_history/issues.20260427_114912_061702372.jsonl +261 -0
  81. package/.beads/.br_history/issues.20260427_115013_063113906.jsonl +261 -0
  82. package/.beads/.br_history/issues.20260427_115114_208497343.jsonl +261 -0
  83. package/.beads/.br_history/issues.20260427_115215_176080241.jsonl +261 -0
  84. package/.beads/.br_history/issues.20260427_115316_481573328.jsonl +261 -0
  85. package/.beads/.br_history/issues.20260427_115335_866978652.jsonl +261 -0
  86. package/.beads/.br_history/issues.20260427_115436_866087391.jsonl +261 -0
  87. package/.beads/.br_history/issues.20260427_115538_016094860.jsonl +261 -0
  88. package/.beads/.br_history/issues.20260427_115638_932947449.jsonl +261 -0
  89. package/.beads/.br_history/issues.20260427_115739_982932603.jsonl +261 -0
  90. package/.beads/.br_history/issues.20260427_115840_963681039.jsonl +261 -0
  91. package/.beads/.br_history/issues.20260427_115941_912431509.jsonl +261 -0
  92. package/.beads/.br_history/issues.20260427_120043_043356448.jsonl +261 -0
  93. package/.beads/.br_history/issues.20260427_120144_955596968.jsonl +261 -0
  94. package/.beads/.br_history/issues.20260427_120246_060733977.jsonl +261 -0
  95. package/.beads/.br_history/issues.20260427_120307_717985017.jsonl +261 -0
  96. package/.beads/.br_history/issues.20260427_120408_871846736.jsonl +261 -0
  97. package/.beads/.br_history/issues.20260427_121003_963750732.jsonl +261 -0
  98. package/.beads/.br_history/issues.20260427_121006_018509431.jsonl +261 -0
  99. package/.beads/.br_history/issues.20260427_121019_617062931.jsonl +261 -0
  100. package/.beads/.br_history/issues.20260427_121021_689536311.jsonl +261 -0
  101. package/.beads/.br_recovery/beads.db-wal.20260427_104615_902749843.rebuild-failed +0 -0
  102. package/.beads/.br_recovery/beads.db-wal.20260427_121006_010373120.rebuild-failed +0 -0
  103. package/.beads/.br_recovery/beads.db.20260427_104615_902749843.rebuild-failed +0 -0
  104. package/.beads/.br_recovery/beads.db.20260427_121006_010373120.rebuild-failed +0 -0
  105. package/.beads/beads.db.corrupted +0 -0
  106. package/.beads/issues.jsonl +144 -144
  107. package/.supercli/adapters/test-cli-adapter.js +19 -0
  108. package/cli/adapters/mcp.js +89 -3
  109. package/cli/adapters/openapi.js +71 -2
  110. package/cli/config.js +69 -1
  111. package/cli/daemon.js +349 -0
  112. package/cli/plugins-manager.js +42 -9
  113. package/cli/server-command.js +174 -4
  114. package/cli/supercli.js +35 -15
  115. package/docs/changelog-2026-04.html +6 -0
  116. package/docs/index.html +94 -11
  117. package/docs/plugins.html +30 -0
  118. package/docs/server.md +80 -0
  119. package/graphify-out/GRAPH_REPORT.md +154 -162
  120. package/graphify-out/cache/11938479cfbdb8e52bf5f0f3c132d56204245ebb19aefe89bb0394feb36dbd5e.json +1 -0
  121. package/graphify-out/cache/141362b25039dee7a4959ef475befea0a25671aae66f3d14917e711e597ffbf6.json +1 -0
  122. package/graphify-out/cache/2f23b1be3f6434f60138a04261d83ca71b128f405bd68fb19abf48cd61108dfc.json +1 -0
  123. package/graphify-out/cache/362adb1b6b483f56d09feaf652f4122366e568aaede752f48383b76d61f5d9d6.json +1 -0
  124. package/graphify-out/cache/42bc8f64d69d2cd9ecf64e92e38f89f7ea479f69c947de5984919e2fd5a716ee.json +1 -0
  125. package/graphify-out/cache/4b5cffce31d9193b7d0a8f15e8a41c66f6733a6490ebaeff2c8ca19701c72c0e.json +1 -0
  126. package/graphify-out/cache/5ef4e31750d9e7bc4ff4a7b535f247d9ab5ab9627d72e20794779ec4be424c66.json +1 -0
  127. package/graphify-out/cache/6d5023ecffa52382d31152c8c06e86e286789228a3d4f7fde72087f3eafa11bc.json +1 -0
  128. package/graphify-out/cache/6e5776e123142a78f50fa0bfd5ae2d289282051a9b392ae507de7aa9017f95d4.json +1 -0
  129. package/graphify-out/cache/75982dc60fa7353600ca48a3b33f5ba497eea9d5743daac6e61e9cf4f64774be.json +1 -0
  130. package/graphify-out/cache/7796066b51d3a99071debdfb5f40c854400b5bf3aa7c1e83dd6ae88eddca0370.json +1 -0
  131. package/graphify-out/cache/8ccd3b557a1ea98005fba84433f160ccd4a951fbdb6a4c9b7d7ba894f905b06b.json +1 -0
  132. package/graphify-out/cache/90ab53b8f1f3306e7c3a1f92ec628717ea90f4e684db764f7d7aa8e884fe2cae.json +1 -0
  133. package/graphify-out/cache/99c8133d0ccf5bf29a0a03caa6811d2ff8d73bcccf20681687876c890b94740e.json +1 -0
  134. package/graphify-out/cache/9fa6604cc820f3857c55c753ca0024788e4cbb61c4e12ba7ce0e4a1ce4ee0655.json +1 -0
  135. package/graphify-out/cache/a1e24a07beede2876e688cdb6c14e2d24abb22064862a6420cac321efabd3efd.json +1 -0
  136. package/graphify-out/cache/a418312f2805259c33007a18b36b6ae3b6a4da376ccae6006a3b9999262495db.json +1 -0
  137. package/graphify-out/cache/a6d9c029bd31a99b67357291305e27b01c5ef388925f7f2a6e985fec4efa8024.json +1 -0
  138. package/graphify-out/cache/a6ed52b709dd79f98adf72c483e8dfb6098203d7327470b82feb5e11390a5cf4.json +1 -0
  139. package/graphify-out/cache/b045ae4443d972ee8f47b91a0d61c984a190195b38ae1d331430b4c51c43acfd.json +1 -0
  140. package/graphify-out/cache/bc514f4074f89d2f7e7834670602e50bba0f24b8cd8c9d21ff4d361d3fd4d558.json +1 -0
  141. package/graphify-out/cache/be3fc87936f9f24d2d4f4b22b9d2a16f33f538cef1a181663120e23ecf16b81a.json +1 -0
  142. package/graphify-out/cache/c5a4822edbe3a95a56f9f943eed1567e5a5c913d59b1fa3df4ad54ffd9b02697.json +1 -0
  143. package/graphify-out/cache/cf411f1ddde50ee97c1c501f59ed7985bcdc022134574816bcce37ac20848e64.json +1 -0
  144. package/graphify-out/cache/d88625b5813742ca941ce8155cb77afb02425632002f621aca34f217440a392d.json +1 -0
  145. package/graphify-out/cache/da97fdc8af2a3306c292921110f84648bba2b0e85d27473b460b0e8a862ff225.json +1 -0
  146. package/graphify-out/cache/e88de9f1ae117f26fd217c3717eff7e525a284cc942b5f4d26ef2c4d65db59bd.json +1 -0
  147. package/graphify-out/cache/ebf6bd96ef2d8d396389ac7199e6ba818ee2d0c5dfc131fab7cdece9fb710f11.json +1 -0
  148. package/graphify-out/cache/f2a302550a6fe0649d36b8ef0b04b77673bca9f115732af8ae89751944dc9cc6.json +1 -0
  149. package/graphify-out/cache/fb46bd3ef530273918fc8915842453f21b418d536653d3b705b75b417255c246.json +1 -0
  150. package/graphify-out/cache/fcfdab94fe91af1f21fcefdba5a96674b9a16bb768288f3573fe68765163c765.json +1 -0
  151. package/graphify-out/graph.json +2669 -1121
  152. package/package.json +1 -1
  153. package/plugins/context-mode/plugin.json +10 -0
  154. package/plugins/context-mode/scripts/post-install.js +1 -1
  155. package/plugins/example-server-resources/meta.json +11 -0
  156. package/plugins/example-server-resources/plugin.json +46 -0
  157. package/server/app.js +43 -11
  158. package/server/middleware/auth.js +70 -0
  159. package/server/routes/adapters.js +3 -11
  160. package/server/routes/docs.js +10 -0
  161. package/server/routes/jobs.js +3 -2
  162. package/server/routes/mcp.js +1 -0
  163. package/server/routes/plugins.js +209 -10
  164. package/server/routes/specs.js +8 -3
  165. package/server/services/adaptersService.js +1 -0
  166. package/server/services/pluginResourceService.js +262 -0
  167. package/server/services/pluginsService.js +24 -0
  168. package/server/uploads/superbackend-openapi.json +47 -0
  169. package/server/uploads/test-auth-openapi.json +74 -0
  170. package/server/uploads/test-auth-spec.json +36 -0
  171. package/server/views/adapters.ejs +1 -0
  172. package/server/views/clients.ejs +82 -0
  173. package/server/views/docs.ejs +7 -0
  174. package/server/views/jobs.ejs +26 -2
  175. package/server/views/layout.ejs +0 -23
  176. package/server/views/mcp.ejs +278 -21
  177. package/server/views/partials/head.ejs +2 -0
  178. package/server/views/plugins.ejs +81 -1
  179. package/server/views/specs.ejs +217 -22
  180. package/.beads/.br_history/issues.20260424_173219_825545950.jsonl +0 -161
  181. package/.beads/.br_history/issues.20260424_173236_386891868.jsonl +0 -162
  182. package/.beads/.br_history/issues.20260424_174502_086707155.jsonl +0 -163
  183. package/.beads/.br_history/issues.20260424_174510_654230822.jsonl +0 -164
  184. package/.beads/.br_history/issues.20260424_174517_409774596.jsonl +0 -165
  185. package/.beads/.br_history/issues.20260424_174523_607561636.jsonl +0 -166
  186. package/.beads/.br_history/issues.20260424_174532_546016322.jsonl +0 -167
  187. package/.beads/.br_history/issues.20260424_175209_319624367.jsonl +0 -168
  188. package/.beads/.br_history/issues.20260424_175214_798999893.jsonl +0 -169
  189. package/.beads/.br_history/issues.20260424_175217_989449734.jsonl +0 -170
  190. package/.beads/.br_history/issues.20260424_175221_701416034.jsonl +0 -171
  191. package/.beads/.br_history/issues.20260424_175225_550538874.jsonl +0 -172
  192. package/.beads/.br_history/issues.20260424_180143_241956058.jsonl +0 -173
  193. package/.beads/.br_history/issues.20260424_180153_817576164.jsonl +0 -174
  194. package/.beads/.br_history/issues.20260424_180201_739387030.jsonl +0 -175
  195. package/.beads/.br_history/issues.20260424_180213_488389024.jsonl +0 -176
  196. package/.beads/.br_history/issues.20260424_180221_754279177.jsonl +0 -177
  197. package/.beads/.br_history/issues.20260424_181149_604365436.jsonl +0 -178
  198. package/.beads/.br_history/issues.20260424_181158_931468591.jsonl +0 -179
  199. package/.beads/.br_history/issues.20260424_181209_516766803.jsonl +0 -180
  200. package/.beads/.br_history/issues.20260424_181219_459169740.jsonl +0 -181
  201. package/.beads/.br_history/issues.20260424_181227_996490697.jsonl +0 -182
  202. package/.beads/.br_history/issues.20260424_181958_717811271.jsonl +0 -183
  203. package/.beads/.br_history/issues.20260424_182002_913828749.jsonl +0 -184
  204. package/.beads/.br_history/issues.20260424_182006_779786523.jsonl +0 -185
  205. package/.beads/.br_history/issues.20260424_182010_368190795.jsonl +0 -186
  206. package/.beads/.br_history/issues.20260424_182016_217217108.jsonl +0 -187
  207. package/.beads/.br_history/issues.20260424_182539_287444292.jsonl +0 -188
  208. package/.beads/.br_history/issues.20260424_182543_343189534.jsonl +0 -189
  209. package/.beads/.br_history/issues.20260424_182547_119975837.jsonl +0 -190
  210. package/.beads/.br_history/issues.20260424_182550_849315940.jsonl +0 -191
  211. package/.beads/.br_history/issues.20260424_182554_677413036.jsonl +0 -192
  212. package/.beads/.br_history/issues.20260424_183140_390494612.jsonl +0 -193
  213. package/.beads/.br_history/issues.20260424_183144_266256714.jsonl +0 -194
  214. package/.beads/.br_history/issues.20260424_183152_839579876.jsonl +0 -195
  215. package/.beads/.br_history/issues.20260424_183202_355634088.jsonl +0 -196
  216. package/.beads/.br_history/issues.20260424_183209_438616861.jsonl +0 -197
  217. package/.beads/.br_history/issues.20260424_183753_517602948.jsonl +0 -198
  218. package/.beads/.br_history/issues.20260424_183757_533544458.jsonl +0 -199
  219. package/.beads/.br_history/issues.20260424_183803_063929316.jsonl +0 -200
  220. package/.beads/.br_history/issues.20260424_183807_014724964.jsonl +0 -201
  221. package/.beads/.br_history/issues.20260424_183813_278844212.jsonl +0 -202
  222. package/.beads/.br_history/issues.20260424_190900_876564388.jsonl +0 -203
  223. package/.beads/.br_history/issues.20260424_192047_121286991.jsonl +0 -204
  224. package/.beads/.br_history/issues.20260424_192811_866934994.jsonl +0 -205
  225. package/.beads/.br_history/issues.20260424_193837_426102367.jsonl +0 -206
  226. package/.beads/.br_history/issues.20260424_194617_271952813.jsonl +0 -207
  227. package/.beads/.br_history/issues.20260424_195430_952967644.jsonl +0 -208
  228. package/.beads/.br_history/issues.20260424_200234_439280977.jsonl +0 -209
  229. package/.beads/.br_history/issues.20260424_200923_545127361.jsonl +0 -210
  230. package/.beads/.br_history/issues.20260424_204056_586059018.jsonl +0 -211
  231. package/.beads/.br_history/issues.20260424_205301_854556209.jsonl +0 -212
  232. package/.beads/.br_history/issues.20260424_210455_501610650.jsonl +0 -213
  233. package/.beads/.br_history/issues.20260424_212803_108840399.jsonl +0 -214
  234. package/.beads/.br_history/issues.20260425_045812_041336580.jsonl +0 -215
  235. package/.beads/.br_history/issues.20260425_045914_762139232.jsonl +0 -216
  236. package/.beads/.br_history/issues.20260425_050011_038094726.jsonl +0 -217
  237. package/.beads/.br_history/issues.20260425_050140_047103928.jsonl +0 -218
  238. package/.beads/.br_history/issues.20260425_054328_968771145.jsonl +0 -219
  239. package/.beads/.br_history/issues.20260425_054419_800564203.jsonl +0 -220
  240. package/.beads/.br_history/issues.20260425_054543_771812828.jsonl +0 -221
  241. package/.beads/.br_history/issues.20260425_054648_963773974.jsonl +0 -222
  242. package/.beads/.br_history/issues.20260425_054751_122349828.jsonl +0 -223
  243. package/.beads/.br_history/issues.20260425_060749_403415856.jsonl +0 -224
  244. package/.beads/.br_history/issues.20260425_062503_208821903.jsonl +0 -225
  245. package/.beads/.br_history/issues.20260425_063134_587505560.jsonl +0 -226
  246. package/.beads/.br_history/issues.20260425_064005_565019560.jsonl +0 -227
  247. package/.beads/.br_history/issues.20260425_064651_250053752.jsonl +0 -228
  248. package/.beads/.br_history/issues.20260425_065904_323410469.jsonl +0 -229
  249. package/.beads/.br_history/issues.20260425_070603_854872783.jsonl +0 -230
  250. package/.beads/.br_history/issues.20260425_071232_499550581.jsonl +0 -231
  251. package/.beads/.br_history/issues.20260425_071859_753108611.jsonl +0 -232
  252. package/.beads/.br_history/issues.20260425_171215_558114276.jsonl +0 -233
  253. package/.beads/.br_history/issues.20260425_171228_711028872.jsonl +0 -234
  254. package/.beads/.br_history/issues.20260425_171908_608455863.jsonl +0 -235
  255. package/.beads/.br_history/issues.20260425_172952_108071113.jsonl +0 -236
  256. package/.beads/.br_history/issues.20260425_200313_037876111.jsonl +0 -237
  257. package/.beads/.br_history/issues.20260425_201117_411540946.jsonl +0 -238
  258. package/.beads/.br_history/issues.20260425_210522_892936637.jsonl +0 -239
  259. package/.beads/.br_history/issues.20260425_210949_356368198.jsonl +0 -240
  260. package/.beads/.br_history/issues.20260425_211617_355720902.jsonl +0 -241
  261. package/.beads/.br_history/issues.20260425_213515_555595766.jsonl +0 -242
  262. package/.beads/.br_history/issues.20260425_214642_203845514.jsonl +0 -243
  263. package/.beads/.br_history/issues.20260425_221221_451474472.jsonl +0 -244
  264. package/.beads/.br_history/issues.20260425_222608_800503496.jsonl +0 -245
  265. package/.beads/.br_history/issues.20260426_071735_330251998.jsonl +0 -246
  266. package/.beads/.br_history/issues.20260426_071755_925764854.jsonl +0 -247
  267. package/.beads/.br_history/issues.20260426_071818_936440407.jsonl +0 -248
  268. package/.beads/.br_history/issues.20260426_071834_033200504.jsonl +0 -249
  269. package/.beads/.br_history/issues.20260426_072406_524696668.jsonl +0 -250
  270. package/.beads/.br_history/issues.20260426_073231_913315951.jsonl +0 -251
  271. package/.beads/.br_history/issues.20260426_074828_051470117.jsonl +0 -252
  272. package/.beads/.br_history/issues.20260426_080300_773872374.jsonl +0 -253
  273. package/.beads/.br_history/issues.20260426_121735_535252712.jsonl +0 -254
  274. package/.beads/.br_history/issues.20260426_125144_933153546.jsonl +0 -255
  275. package/.beads/.br_history/issues.20260426_132438_591463320.jsonl +0 -256
  276. /package/.beads/.br_history/{issues.20260424_173219_825545950.jsonl.meta.json → issues.20260427_104606_658098709.jsonl.meta.json} +0 -0
  277. /package/.beads/.br_history/{issues.20260424_173236_386891868.jsonl.meta.json → issues.20260427_104607_085798670.jsonl.meta.json} +0 -0
  278. /package/.beads/.br_history/{issues.20260424_174502_086707155.jsonl.meta.json → issues.20260427_104607_627598880.jsonl.meta.json} +0 -0
  279. /package/.beads/.br_history/{issues.20260424_174510_654230822.jsonl.meta.json → issues.20260427_104608_071298223.jsonl.meta.json} +0 -0
  280. /package/.beads/.br_history/{issues.20260424_174517_409774596.jsonl.meta.json → issues.20260427_104615_198124329.jsonl.meta.json} +0 -0
  281. /package/.beads/.br_history/{issues.20260424_174523_607561636.jsonl.meta.json → issues.20260427_104615_669652069.jsonl.meta.json} +0 -0
  282. /package/.beads/.br_history/{issues.20260424_174532_546016322.jsonl.meta.json → issues.20260427_104637_752744777.jsonl.meta.json} +0 -0
  283. /package/.beads/.br_history/{issues.20260424_175209_319624367.jsonl.meta.json → issues.20260427_104638_209211116.jsonl.meta.json} +0 -0
  284. /package/.beads/.br_history/{issues.20260424_175214_798999893.jsonl.meta.json → issues.20260427_104638_898729442.jsonl.meta.json} +0 -0
  285. /package/.beads/.br_history/{issues.20260424_175217_989449734.jsonl.meta.json → issues.20260427_104639_368827997.jsonl.meta.json} +0 -0
  286. /package/.beads/.br_history/{issues.20260424_175221_701416034.jsonl.meta.json → issues.20260427_104639_823343822.jsonl.meta.json} +0 -0
  287. /package/.beads/.br_history/{issues.20260424_175225_550538874.jsonl.meta.json → issues.20260427_104640_354170001.jsonl.meta.json} +0 -0
  288. /package/.beads/.br_history/{issues.20260424_180143_241956058.jsonl.meta.json → issues.20260427_104640_937129660.jsonl.meta.json} +0 -0
  289. /package/.beads/.br_history/{issues.20260424_180153_817576164.jsonl.meta.json → issues.20260427_104647_408876191.jsonl.meta.json} +0 -0
  290. /package/.beads/.br_history/{issues.20260424_180201_739387030.jsonl.meta.json → issues.20260427_104659_300660476.jsonl.meta.json} +0 -0
  291. /package/.beads/.br_history/{issues.20260424_180213_488389024.jsonl.meta.json → issues.20260427_104800_415120762.jsonl.meta.json} +0 -0
  292. /package/.beads/.br_history/{issues.20260424_180221_754279177.jsonl.meta.json → issues.20260427_104901_529669396.jsonl.meta.json} +0 -0
  293. /package/.beads/.br_history/{issues.20260424_181149_604365436.jsonl.meta.json → issues.20260427_105002_587183822.jsonl.meta.json} +0 -0
  294. /package/.beads/.br_history/{issues.20260424_181158_931468591.jsonl.meta.json → issues.20260427_105103_686748531.jsonl.meta.json} +0 -0
  295. /package/.beads/.br_history/{issues.20260424_181209_516766803.jsonl.meta.json → issues.20260427_105204_721591044.jsonl.meta.json} +0 -0
  296. /package/.beads/.br_history/{issues.20260424_181219_459169740.jsonl.meta.json → issues.20260427_105305_855661211.jsonl.meta.json} +0 -0
  297. /package/.beads/.br_history/{issues.20260424_181227_996490697.jsonl.meta.json → issues.20260427_105407_641630152.jsonl.meta.json} +0 -0
  298. /package/.beads/.br_history/{issues.20260424_181958_717811271.jsonl.meta.json → issues.20260427_105509_159649245.jsonl.meta.json} +0 -0
  299. /package/.beads/.br_history/{issues.20260424_182002_913828749.jsonl.meta.json → issues.20260427_105610_283950586.jsonl.meta.json} +0 -0
  300. /package/.beads/.br_history/{issues.20260424_182006_779786523.jsonl.meta.json → issues.20260427_105637_656057143.jsonl.meta.json} +0 -0
  301. /package/.beads/.br_history/{issues.20260424_182010_368190795.jsonl.meta.json → issues.20260427_105738_863187883.jsonl.meta.json} +0 -0
  302. /package/.beads/.br_history/{issues.20260424_182016_217217108.jsonl.meta.json → issues.20260427_105839_958463404.jsonl.meta.json} +0 -0
  303. /package/.beads/.br_history/{issues.20260424_182539_287444292.jsonl.meta.json → issues.20260427_105941_092827317.jsonl.meta.json} +0 -0
  304. /package/.beads/.br_history/{issues.20260424_182543_343189534.jsonl.meta.json → issues.20260427_110042_110436110.jsonl.meta.json} +0 -0
  305. /package/.beads/.br_history/{issues.20260424_182547_119975837.jsonl.meta.json → issues.20260427_110143_343801118.jsonl.meta.json} +0 -0
  306. /package/.beads/.br_history/{issues.20260424_182550_849315940.jsonl.meta.json → issues.20260427_110244_379134729.jsonl.meta.json} +0 -0
  307. /package/.beads/.br_history/{issues.20260424_182554_677413036.jsonl.meta.json → issues.20260427_110345_445658284.jsonl.meta.json} +0 -0
  308. /package/.beads/.br_history/{issues.20260424_183140_390494612.jsonl.meta.json → issues.20260427_110446_689391882.jsonl.meta.json} +0 -0
  309. /package/.beads/.br_history/{issues.20260424_183144_266256714.jsonl.meta.json → issues.20260427_110547_667705716.jsonl.meta.json} +0 -0
  310. /package/.beads/.br_history/{issues.20260424_183152_839579876.jsonl.meta.json → issues.20260427_110609_987816377.jsonl.meta.json} +0 -0
  311. /package/.beads/.br_history/{issues.20260424_183202_355634088.jsonl.meta.json → issues.20260427_110711_086550915.jsonl.meta.json} +0 -0
  312. /package/.beads/.br_history/{issues.20260424_183209_438616861.jsonl.meta.json → issues.20260427_110812_204821395.jsonl.meta.json} +0 -0
  313. /package/.beads/.br_history/{issues.20260424_183753_517602948.jsonl.meta.json → issues.20260427_110913_259688311.jsonl.meta.json} +0 -0
  314. /package/.beads/.br_history/{issues.20260424_183757_533544458.jsonl.meta.json → issues.20260427_111014_297775509.jsonl.meta.json} +0 -0
  315. /package/.beads/.br_history/{issues.20260424_183803_063929316.jsonl.meta.json → issues.20260427_111115_195150935.jsonl.meta.json} +0 -0
  316. /package/.beads/.br_history/{issues.20260424_183807_014724964.jsonl.meta.json → issues.20260427_111216_316259530.jsonl.meta.json} +0 -0
  317. /package/.beads/.br_history/{issues.20260424_183813_278844212.jsonl.meta.json → issues.20260427_111317_298020330.jsonl.meta.json} +0 -0
  318. /package/.beads/.br_history/{issues.20260424_190900_876564388.jsonl.meta.json → issues.20260427_111418_604431267.jsonl.meta.json} +0 -0
  319. /package/.beads/.br_history/{issues.20260424_192047_121286991.jsonl.meta.json → issues.20260427_111519_617870969.jsonl.meta.json} +0 -0
  320. /package/.beads/.br_history/{issues.20260424_192811_866934994.jsonl.meta.json → issues.20260427_111533_024097015.jsonl.meta.json} +0 -0
  321. /package/.beads/.br_history/{issues.20260424_193837_426102367.jsonl.meta.json → issues.20260427_111634_138814655.jsonl.meta.json} +0 -0
  322. /package/.beads/.br_history/{issues.20260424_194617_271952813.jsonl.meta.json → issues.20260427_111737_148398766.jsonl.meta.json} +0 -0
  323. /package/.beads/.br_history/{issues.20260424_195430_952967644.jsonl.meta.json → issues.20260427_111838_507704112.jsonl.meta.json} +0 -0
  324. /package/.beads/.br_history/{issues.20260424_200234_439280977.jsonl.meta.json → issues.20260427_111939_468325527.jsonl.meta.json} +0 -0
  325. /package/.beads/.br_history/{issues.20260424_200923_545127361.jsonl.meta.json → issues.20260427_112041_044923744.jsonl.meta.json} +0 -0
  326. /package/.beads/.br_history/{issues.20260424_204056_586059018.jsonl.meta.json → issues.20260427_112142_224127430.jsonl.meta.json} +0 -0
  327. /package/.beads/.br_history/{issues.20260424_205301_854556209.jsonl.meta.json → issues.20260427_112243_212317525.jsonl.meta.json} +0 -0
  328. /package/.beads/.br_history/{issues.20260424_210455_501610650.jsonl.meta.json → issues.20260427_112344_182300930.jsonl.meta.json} +0 -0
  329. /package/.beads/.br_history/{issues.20260424_212803_108840399.jsonl.meta.json → issues.20260427_112445_197922899.jsonl.meta.json} +0 -0
  330. /package/.beads/.br_history/{issues.20260425_045812_041336580.jsonl.meta.json → issues.20260427_112502_597304488.jsonl.meta.json} +0 -0
  331. /package/.beads/.br_history/{issues.20260425_045914_762139232.jsonl.meta.json → issues.20260427_112604_292832651.jsonl.meta.json} +0 -0
  332. /package/.beads/.br_history/{issues.20260425_050011_038094726.jsonl.meta.json → issues.20260427_112706_051581607.jsonl.meta.json} +0 -0
  333. /package/.beads/.br_history/{issues.20260425_050140_047103928.jsonl.meta.json → issues.20260427_112807_066213762.jsonl.meta.json} +0 -0
  334. /package/.beads/.br_history/{issues.20260425_054328_968771145.jsonl.meta.json → issues.20260427_112908_145315373.jsonl.meta.json} +0 -0
  335. /package/.beads/.br_history/{issues.20260425_054419_800564203.jsonl.meta.json → issues.20260427_113009_141079023.jsonl.meta.json} +0 -0
  336. /package/.beads/.br_history/{issues.20260425_054543_771812828.jsonl.meta.json → issues.20260427_113110_601071412.jsonl.meta.json} +0 -0
  337. /package/.beads/.br_history/{issues.20260425_054648_963773974.jsonl.meta.json → issues.20260427_113211_601412739.jsonl.meta.json} +0 -0
  338. /package/.beads/.br_history/{issues.20260425_054751_122349828.jsonl.meta.json → issues.20260427_113312_771171767.jsonl.meta.json} +0 -0
  339. /package/.beads/.br_history/{issues.20260425_060749_403415856.jsonl.meta.json → issues.20260427_113413_719165420.jsonl.meta.json} +0 -0
  340. /package/.beads/.br_history/{issues.20260425_062503_208821903.jsonl.meta.json → issues.20260427_113430_416576564.jsonl.meta.json} +0 -0
  341. /package/.beads/.br_history/{issues.20260425_063134_587505560.jsonl.meta.json → issues.20260427_113531_553842703.jsonl.meta.json} +0 -0
  342. /package/.beads/.br_history/{issues.20260425_064005_565019560.jsonl.meta.json → issues.20260427_113633_137526241.jsonl.meta.json} +0 -0
  343. /package/.beads/.br_history/{issues.20260425_064651_250053752.jsonl.meta.json → issues.20260427_113735_697152101.jsonl.meta.json} +0 -0
  344. /package/.beads/.br_history/{issues.20260425_065904_323410469.jsonl.meta.json → issues.20260427_113836_810884202.jsonl.meta.json} +0 -0
  345. /package/.beads/.br_history/{issues.20260425_070603_854872783.jsonl.meta.json → issues.20260427_113938_312284719.jsonl.meta.json} +0 -0
  346. /package/.beads/.br_history/{issues.20260425_071232_499550581.jsonl.meta.json → issues.20260427_114039_390178502.jsonl.meta.json} +0 -0
  347. /package/.beads/.br_history/{issues.20260425_071859_753108611.jsonl.meta.json → issues.20260427_114140_483586632.jsonl.meta.json} +0 -0
  348. /package/.beads/.br_history/{issues.20260425_171215_558114276.jsonl.meta.json → issues.20260427_114241_502376670.jsonl.meta.json} +0 -0
  349. /package/.beads/.br_history/{issues.20260425_171228_711028872.jsonl.meta.json → issues.20260427_114342_927243830.jsonl.meta.json} +0 -0
  350. /package/.beads/.br_history/{issues.20260425_171908_608455863.jsonl.meta.json → issues.20260427_114405_996651227.jsonl.meta.json} +0 -0
  351. /package/.beads/.br_history/{issues.20260425_172952_108071113.jsonl.meta.json → issues.20260427_114507_946708398.jsonl.meta.json} +0 -0
  352. /package/.beads/.br_history/{issues.20260425_200313_037876111.jsonl.meta.json → issues.20260427_114608_914493506.jsonl.meta.json} +0 -0
  353. /package/.beads/.br_history/{issues.20260425_201117_411540946.jsonl.meta.json → issues.20260427_114709_935565841.jsonl.meta.json} +0 -0
  354. /package/.beads/.br_history/{issues.20260425_210522_892936637.jsonl.meta.json → issues.20260427_114810_981588378.jsonl.meta.json} +0 -0
  355. /package/.beads/.br_history/{issues.20260425_210949_356368198.jsonl.meta.json → issues.20260427_114912_061702372.jsonl.meta.json} +0 -0
  356. /package/.beads/.br_history/{issues.20260425_211617_355720902.jsonl.meta.json → issues.20260427_115013_063113906.jsonl.meta.json} +0 -0
  357. /package/.beads/.br_history/{issues.20260425_213515_555595766.jsonl.meta.json → issues.20260427_115114_208497343.jsonl.meta.json} +0 -0
  358. /package/.beads/.br_history/{issues.20260425_214642_203845514.jsonl.meta.json → issues.20260427_115215_176080241.jsonl.meta.json} +0 -0
  359. /package/.beads/.br_history/{issues.20260425_221221_451474472.jsonl.meta.json → issues.20260427_115316_481573328.jsonl.meta.json} +0 -0
  360. /package/.beads/.br_history/{issues.20260425_222608_800503496.jsonl.meta.json → issues.20260427_115335_866978652.jsonl.meta.json} +0 -0
  361. /package/.beads/.br_history/{issues.20260426_071735_330251998.jsonl.meta.json → issues.20260427_115436_866087391.jsonl.meta.json} +0 -0
  362. /package/.beads/.br_history/{issues.20260426_071755_925764854.jsonl.meta.json → issues.20260427_115538_016094860.jsonl.meta.json} +0 -0
  363. /package/.beads/.br_history/{issues.20260426_071818_936440407.jsonl.meta.json → issues.20260427_115638_932947449.jsonl.meta.json} +0 -0
  364. /package/.beads/.br_history/{issues.20260426_071834_033200504.jsonl.meta.json → issues.20260427_115739_982932603.jsonl.meta.json} +0 -0
  365. /package/.beads/.br_history/{issues.20260426_072406_524696668.jsonl.meta.json → issues.20260427_115840_963681039.jsonl.meta.json} +0 -0
  366. /package/.beads/.br_history/{issues.20260426_073231_913315951.jsonl.meta.json → issues.20260427_115941_912431509.jsonl.meta.json} +0 -0
  367. /package/.beads/.br_history/{issues.20260426_074828_051470117.jsonl.meta.json → issues.20260427_120043_043356448.jsonl.meta.json} +0 -0
  368. /package/.beads/.br_history/{issues.20260426_080300_773872374.jsonl.meta.json → issues.20260427_120144_955596968.jsonl.meta.json} +0 -0
  369. /package/.beads/.br_history/{issues.20260426_121735_535252712.jsonl.meta.json → issues.20260427_120246_060733977.jsonl.meta.json} +0 -0
  370. /package/.beads/.br_history/{issues.20260426_125144_933153546.jsonl.meta.json → issues.20260427_120307_717985017.jsonl.meta.json} +0 -0
  371. /package/.beads/.br_history/{issues.20260426_132438_591463320.jsonl.meta.json → issues.20260427_120408_871846736.jsonl.meta.json} +0 -0
  372. /package/.beads/.br_history/{issues.20260426_134150_938793400.jsonl.meta.json → issues.20260427_121003_963750732.jsonl.meta.json} +0 -0
  373. /package/.beads/.br_history/{issues.20260426_162331_516939737.jsonl.meta.json → issues.20260427_121006_018509431.jsonl.meta.json} +0 -0
  374. /package/.beads/.br_history/{issues.20260426_162513_726336785.jsonl.meta.json → issues.20260427_121019_617062931.jsonl.meta.json} +0 -0
  375. /package/.beads/.br_history/{issues.20260426_162712_190824905.jsonl.meta.json → issues.20260427_121021_689536311.jsonl.meta.json} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superacli",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "Config-driven, AI-friendly dynamic CLI",
5
5
  "license": "MIT",
6
6
  "main": "server/app.js",
@@ -6,6 +6,16 @@
6
6
  "checks": [
7
7
  { "type": "binary", "name": "context-mode" }
8
8
  ],
9
+ "server_resources": {
10
+ "mcp": [
11
+ {
12
+ "name": "context-mode",
13
+ "command": "context-mode",
14
+ "args": [],
15
+ "stateful": true
16
+ }
17
+ ]
18
+ },
9
19
  "install_guidance": {
10
20
  "plugin": "context-mode",
11
21
  "binary": "context-mode",
@@ -28,7 +28,7 @@ async function runCommand(cmd, args) {
28
28
 
29
29
  async function main() {
30
30
  try {
31
- // Register context-mode as a stateful MCP server
31
+ // Register context-mode as a stateful MCP server locally
32
32
  await runCommand('sc', ['mcp', 'add', 'context-mode', '--command', 'context-mode', '--args-json', '[]', '--stateful']);
33
33
  console.log('✓ context-mode registered as stateful MCP server');
34
34
 
@@ -0,0 +1,11 @@
1
+ {
2
+ "description": "Example plugin demonstrating server resource auto-registration for MCP servers and OpenAPI specs",
3
+ "tags": [
4
+ "example",
5
+ "server-resources",
6
+ "mcp",
7
+ "openapi",
8
+ "auto-registration"
9
+ ],
10
+ "has_learn": false
11
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "example-server-resources",
3
+ "version": "1.0.0",
4
+ "description": "Example plugin demonstrating server resource auto-registration",
5
+ "source": "https://github.com/example/server-resources-plugin",
6
+ "checks": [
7
+ {
8
+ "type": "binary",
9
+ "name": "node"
10
+ }
11
+ ],
12
+ "server_resources": {
13
+ "mcp": [
14
+ {
15
+ "name": "example-mcp",
16
+ "url": "http://localhost:8080/mcp",
17
+ "headers": {
18
+ "Authorization": "Bearer ${EXAMPLE_TOKEN}"
19
+ },
20
+ "stateful": true,
21
+ "timeout_ms": 30000
22
+ }
23
+ ],
24
+ "specs": [
25
+ {
26
+ "name": "example-api",
27
+ "url": "http://localhost:8080/openapi.json",
28
+ "auth": "apiKey"
29
+ }
30
+ ]
31
+ },
32
+ "commands": [
33
+ {
34
+ "namespace": "example",
35
+ "resource": "server",
36
+ "action": "status",
37
+ "description": "Check example server status",
38
+ "adapter": "http",
39
+ "adapterConfig": {
40
+ "url": "http://localhost:8080/status",
41
+ "method": "GET"
42
+ },
43
+ "args": []
44
+ }
45
+ ]
46
+ }
package/server/app.js CHANGED
@@ -1,6 +1,8 @@
1
1
  const express = require("express");
2
2
  const path = require("path");
3
3
  const { getStorage } = require("./storage/adapter");
4
+ const { registerAllPluginResources, syncPluginResources } = require("./services/pluginResourceService");
5
+ const { requireAuth } = require("./middleware/auth");
4
6
 
5
7
  const dashboardRouter = require("./routes/dashboard");
6
8
  const adaptersRouter = require("./routes/adapters");
@@ -12,6 +14,7 @@ const plansRouter = require("./routes/plans");
12
14
  const jobsRouter = require("./routes/jobs");
13
15
  const askRouter = require("./routes/ask");
14
16
  const pluginsRouter = require("./routes/plugins");
17
+ const docsRouter = require("./routes/docs");
15
18
 
16
19
  const PORT = process.env.PORT || 3000;
17
20
 
@@ -23,22 +26,26 @@ app.use(express.urlencoded({ extended: true, limit: "20mb" }));
23
26
  app.set("view engine", "ejs");
24
27
  app.set("views", path.join(__dirname, "views"));
25
28
 
29
+ // Static file serving - must be before API routes
26
30
  app.use("/static", express.static(path.join(__dirname, "public")));
31
+ app.use("/uploads", express.static(path.join(__dirname, "uploads")));
32
+ app.use("/docs", express.static(path.join(__dirname, "../docs")));
27
33
 
28
- // API routes
29
- app.use("/api/dashboard", dashboardRouter);
30
- app.use("/api/adapters", adaptersRouter);
31
- app.use("/api/config", configRouter);
32
- app.use("/api/commands", commandsRouter);
33
- app.use("/api/specs", specsRouter);
34
- app.use("/api/mcp", mcpRouter);
35
- app.use("/api/plans", plansRouter);
36
- app.use("/api/jobs", jobsRouter);
37
- app.use("/api/ask", askRouter);
34
+ // API routes (with authentication)
35
+ app.use("/api/dashboard", requireAuth, dashboardRouter);
36
+ app.use("/api/adapters", requireAuth, adaptersRouter);
37
+ app.use("/api/config", requireAuth, configRouter);
38
+ app.use("/api/commands", requireAuth, commandsRouter);
39
+ app.use("/api/specs", requireAuth, specsRouter);
40
+ app.use("/api/mcp", requireAuth, mcpRouter);
41
+ app.use("/api/plans", requireAuth, plansRouter);
42
+ app.use("/api/jobs", requireAuth, jobsRouter);
43
+ app.use("/api/ask", requireAuth, askRouter);
38
44
  app.use("/api/plugins", pluginsRouter);
45
+ app.use("/api/docs", requireAuth, docsRouter);
39
46
 
40
47
  // Tree/command endpoints under /api (config router handles them)
41
- app.use("/api", configRouter);
48
+ app.use("/api", requireAuth, configRouter);
42
49
 
43
50
  app.use("/", dashboardRouter);
44
51
 
@@ -66,12 +73,37 @@ app.get("/mcp", (req, res) => res.redirect("/api/mcp"));
66
73
  app.get("/jobs", (req, res) => res.redirect("/api/jobs"));
67
74
  app.get("/plugins", (req, res) => res.redirect("/api/plugins"));
68
75
  app.get("/adapters", (req, res) => res.redirect("/api/adapters"));
76
+ app.get("/docs", (req, res) => res.redirect("/api/docs"));
77
+
78
+ // Doc sub-page redirects
79
+ app.get("/api/plugins.html", (req, res) => res.redirect("/docs/plugins.html"));
80
+ app.get("/api/adapters.html", (req, res) => res.redirect("/docs/adapters.html"));
81
+ app.get("/api/server.md", (req, res) => res.redirect("/docs/server.md"));
82
+ app.get("/api/changelog.html", (req, res) => res.redirect("/docs/changelog.html"));
69
83
 
70
84
  async function start() {
71
85
  try {
72
86
  // Initialize storage singleton
73
87
  getStorage();
74
88
 
89
+ // Sync plugin resources (cleanup orphaned)
90
+ console.log("[Plugin Resources] Syncing plugin resources...");
91
+ const syncResults = await syncPluginResources();
92
+ if (syncResults.removedMcp.length > 0 || syncResults.removedSpecs.length > 0) {
93
+ console.log(`[Plugin Resources] Cleaned up ${syncResults.removedMcp.length} MCP and ${syncResults.removedSpecs.length} orphaned specs`);
94
+ }
95
+ if (syncResults.errors.length > 0) {
96
+ console.warn(`[Plugin Resources] ${syncResults.errors.length} sync errors`);
97
+ }
98
+
99
+ // Register plugin resources (self-healing)
100
+ console.log("[Plugin Resources] Registering plugin resources...");
101
+ const resourceResults = await registerAllPluginResources();
102
+ if (resourceResults.totalErrors > 0) {
103
+ console.warn(`[Plugin Resources] ${resourceResults.totalErrors} errors during registration`);
104
+ }
105
+ console.log(`[Plugin Resources] Registered ${resourceResults.registeredMcp} MCP servers and ${resourceResults.registeredSpecs} OpenAPI specs`);
106
+
75
107
  app.listen(PORT, () => {
76
108
  console.log(`SUPERCLI server running on http://localhost:${PORT}`);
77
109
  });
@@ -0,0 +1,70 @@
1
+ const { getSettings } = require("../services/pluginsService");
2
+
3
+ // Cache settings for 30 seconds to avoid repeated storage reads
4
+ let cachedSettings = null;
5
+ let cacheExpiry = 0;
6
+
7
+ async function getCachedSettings() {
8
+ const now = Date.now();
9
+ if (cachedSettings && now < cacheExpiry) {
10
+ return cachedSettings;
11
+ }
12
+ cachedSettings = await getSettings();
13
+ cacheExpiry = now + 30000; // 30 seconds
14
+ return cachedSettings;
15
+ }
16
+
17
+ /**
18
+ * Authentication middleware for API endpoints
19
+ *
20
+ * Flow:
21
+ * 1. Check admin_mode_enabled - if true, skip all auth
22
+ * 2. Check public_access - if true, allow all requests
23
+ * 3. Allow settings endpoint when no API keys exist (for bootstrapping)
24
+ * 4. Check X-API-Key header - validate against stored API keys
25
+ * 5. Return 401 if no valid auth
26
+ */
27
+ async function requireAuth(req, res, next) {
28
+ try {
29
+ const settings = await getCachedSettings();
30
+
31
+ // Admin mode - skip all authentication
32
+ if (settings.admin_mode_enabled === true) {
33
+ return next();
34
+ }
35
+
36
+ // Public access - allow all requests
37
+ if (settings.public_access === true) {
38
+ return next();
39
+ }
40
+
41
+ // Allow settings and API keys endpoints when no API keys exist (bootstrapping)
42
+ const apiKeys = Array.isArray(settings.api_keys) ? settings.api_keys : [];
43
+ const fullPath = (req.baseUrl || "") + (req.path || "");
44
+ if (apiKeys.length === 0 && (fullPath.includes("/settings") || fullPath.includes("/api-keys"))) {
45
+ return next();
46
+ }
47
+
48
+ // Check API key
49
+ const apiKey = req.headers["x-api-key"];
50
+ if (!apiKey) {
51
+ return res.status(401).json({ error: "Unauthorized: API key required" });
52
+ }
53
+
54
+ // Validate API key against stored keys
55
+ const isValid = apiKeys.some(k => k.key === apiKey);
56
+
57
+ if (!isValid) {
58
+ return res.status(401).json({ error: "Unauthorized: Invalid API key" });
59
+ }
60
+
61
+ // Valid API key
62
+ next();
63
+ } catch (err) {
64
+ console.error("Auth middleware error:", err);
65
+ // Fail open on error to avoid breaking existing deployments
66
+ next();
67
+ }
68
+ }
69
+
70
+ module.exports = { requireAuth, getCachedSettings };
@@ -55,6 +55,9 @@ router.get("/:name/packages", async (req, res, next) => {
55
55
  return res.status(404).render("error", { message: `Adapter '${name}' not found` })
56
56
  }
57
57
  const packages = await adaptersService.getAdapterPackages(name)
58
+ if (req.headers.accept?.includes("application/json") || req.query.format === "json") {
59
+ return res.json({ packages })
60
+ }
58
61
  res.render("adapter-packages", { adapter, packages })
59
62
  } catch (err) {
60
63
  next(err)
@@ -151,17 +154,6 @@ router.delete("/:name", async (req, res, next) => {
151
154
  }
152
155
  })
153
156
 
154
- // Get adapter packages
155
- router.get("/:name/packages", async (req, res, next) => {
156
- try {
157
- const { name } = req.params
158
- const packages = await adaptersService.getAdapterPackages(name)
159
- res.json({ packages })
160
- } catch (err) {
161
- next(err)
162
- }
163
- })
164
-
165
157
  // Add package to adapter
166
158
  router.post("/:name/packages", async (req, res, next) => {
167
159
  try {
@@ -0,0 +1,10 @@
1
+ const { Router } = require("express")
2
+
3
+ const router = Router()
4
+
5
+ // GET /api/docs - redirect to standalone docs with fromServerUI param
6
+ router.get("/", (req, res) => {
7
+ res.redirect("/docs/index.html?fromServerUI=1")
8
+ })
9
+
10
+ module.exports = router
@@ -7,7 +7,7 @@ const router = Router()
7
7
  router.post("/", async (req, res) => {
8
8
  try {
9
9
  const storage = getStorage()
10
- const { command, args, status, duration_ms, timestamp, plan_id, error } = req.body
10
+ const { command, args, status, duration_ms, timestamp, plan_id, error, client_id } = req.body
11
11
 
12
12
  // Generate a unique sequential-ish ID
13
13
  const jobId = `job:${Date.now()}_${Math.random().toString(36).substring(2, 9)}`
@@ -20,7 +20,8 @@ router.post("/", async (req, res) => {
20
20
  duration_ms: duration_ms || 0,
21
21
  plan_id: plan_id || null,
22
22
  error: error || null,
23
- timestamp: timestamp || new Date().toISOString()
23
+ timestamp: timestamp || new Date().toISOString(),
24
+ client_id: client_id || null
24
25
  }
25
26
 
26
27
  await storage.set(jobId, doc)
@@ -19,6 +19,7 @@ function sanitizeMcpPayload(payload, fallbackName) {
19
19
  }
20
20
  if (typeof payload.timeout_ms === "number" && payload.timeout_ms > 0) out.timeout_ms = payload.timeout_ms
21
21
  if (payload.stateful === true || payload.stateful === "true" || payload.stateful === "on") out.stateful = true
22
+ if (typeof payload.pluginSource === "string") out.pluginSource = payload.pluginSource
22
23
  return out
23
24
  }
24
25
 
@@ -10,6 +10,10 @@ const {
10
10
  removeServerPlugin,
11
11
  getPluginArchiveBuffer,
12
12
  } = require("../services/pluginsService")
13
+ const { getStorage } = require("../storage/adapter")
14
+ const { registerPluginResources, unregisterPluginResources } = require("../services/pluginResourceService")
15
+ const { bumpVersion } = require("../services/configService")
16
+ const { requireAuth } = require("../middleware/auth")
13
17
 
14
18
  const router = Router()
15
19
 
@@ -147,7 +151,7 @@ async function parseMultipartFormData(req) {
147
151
  }
148
152
  }
149
153
 
150
- router.get("/", async (req, res) => {
154
+ router.get("/", requireAuth, async (req, res) => {
151
155
  try {
152
156
  const plugins = await listServerPlugins()
153
157
  const settings = await getSettings()
@@ -160,7 +164,7 @@ router.get("/", async (req, res) => {
160
164
  }
161
165
  })
162
166
 
163
- router.get("/settings", async (req, res) => {
167
+ router.get("/settings", allowIfNoApiKeys, async (req, res) => {
164
168
  try {
165
169
  const settings = await getSettings()
166
170
  res.json(settings)
@@ -169,7 +173,7 @@ router.get("/settings", async (req, res) => {
169
173
  }
170
174
  })
171
175
 
172
- router.put("/settings", async (req, res) => {
176
+ router.put("/settings", allowIfNoApiKeys, async (req, res) => {
173
177
  try {
174
178
  const settings = await updateSettings(req.body || {})
175
179
  res.json({ ok: true, settings })
@@ -178,7 +182,25 @@ router.put("/settings", async (req, res) => {
178
182
  }
179
183
  })
180
184
 
181
- router.post("/", async (req, res) => {
185
+ // Bootstrapping middleware for settings and api-keys when no API keys exist
186
+ async function allowIfNoApiKeys(req, res, next) {
187
+ try {
188
+ const { getCachedSettings } = require("../middleware/auth")
189
+ const settings = await getCachedSettings()
190
+ const apiKeys = Array.isArray(settings.api_keys) ? settings.api_keys : []
191
+ if (apiKeys.length === 0) {
192
+ return next()
193
+ }
194
+ // If API keys exist, require auth
195
+ return requireAuth(req, res, next)
196
+ } catch (err) {
197
+ console.error("Bootstrapping middleware error:", err)
198
+ // Fail open on error
199
+ next()
200
+ }
201
+ }
202
+
203
+ router.post("/", requireAuth, async (req, res) => {
182
204
  try {
183
205
  const sourceType = String((req.body && req.body.source_type) || "json").trim().toLowerCase()
184
206
  const plugin = sourceType === "zip"
@@ -190,7 +212,7 @@ router.post("/", async (req, res) => {
190
212
  }
191
213
  })
192
214
 
193
- router.post("/upload", async (req, res) => {
215
+ router.post("/upload", requireAuth, async (req, res) => {
194
216
  try {
195
217
  const contentType = String(req.headers["content-type"] || "")
196
218
  const payload = contentType.includes("multipart/form-data")
@@ -203,7 +225,38 @@ router.post("/upload", async (req, res) => {
203
225
  }
204
226
  })
205
227
 
206
- router.get("/:name", async (req, res) => {
228
+ // List clients endpoint (must be before /:name)
229
+ router.get("/clients", requireAuth, async (req, res) => {
230
+ try {
231
+ const storage = getStorage()
232
+ const clientKeys = await storage.listKeys("client:")
233
+ const clients = []
234
+
235
+ for (const key of clientKeys) {
236
+ try {
237
+ const client = await storage.get(key)
238
+ if (client && client.client_id) {
239
+ clients.push(client)
240
+ }
241
+ } catch (err) {
242
+ // Skip if client read fails
243
+ }
244
+ }
245
+
246
+ // Sort by last_seen descending
247
+ clients.sort((a, b) => new Date(b.last_seen) - new Date(a.last_seen))
248
+
249
+ if (req.query.format !== "json" && req.accepts("html") && !req.xhr && !req.headers["x-requested-with"]) {
250
+ return res.render("clients", { clients })
251
+ }
252
+
253
+ res.json({ clients })
254
+ } catch (err) {
255
+ handleError(res, err)
256
+ }
257
+ })
258
+
259
+ router.get("/:name", requireAuth, async (req, res) => {
207
260
  try {
208
261
  const plugin = await getServerPlugin(req.params.name)
209
262
  if (!plugin) {
@@ -215,7 +268,7 @@ router.get("/:name", async (req, res) => {
215
268
  }
216
269
  })
217
270
 
218
- router.patch("/:name", async (req, res) => {
271
+ router.patch("/:name", requireAuth, async (req, res) => {
219
272
  try {
220
273
  const plugin = await updatePluginMetadata(req.params.name, req.body || {})
221
274
  res.json({ ok: true, plugin })
@@ -224,7 +277,7 @@ router.patch("/:name", async (req, res) => {
224
277
  }
225
278
  })
226
279
 
227
- router.delete("/:name", async (req, res) => {
280
+ router.delete("/:name", requireAuth, async (req, res) => {
228
281
  try {
229
282
  const removed = await removeServerPlugin(req.params.name)
230
283
  res.json({ ok: true, removed })
@@ -233,7 +286,7 @@ router.delete("/:name", async (req, res) => {
233
286
  }
234
287
  })
235
288
 
236
- router.get("/:name/manifest", async (req, res) => {
289
+ router.get("/:name/manifest", requireAuth, async (req, res) => {
237
290
  try {
238
291
  const plugin = await getServerPlugin(req.params.name)
239
292
  if (!plugin) {
@@ -245,7 +298,7 @@ router.get("/:name/manifest", async (req, res) => {
245
298
  }
246
299
  })
247
300
 
248
- router.get("/:name/archive", async (req, res) => {
301
+ router.get("/:name/archive", requireAuth, async (req, res) => {
249
302
  try {
250
303
  const archive = await getPluginArchiveBuffer(req.params.name)
251
304
  if (!archive) {
@@ -259,4 +312,150 @@ router.get("/:name/archive", async (req, res) => {
259
312
  }
260
313
  })
261
314
 
315
+ router.post("/client-resources", requireAuth, async (req, res) => {
316
+ try {
317
+ const storage = getStorage()
318
+ const { client_id, plugins } = req.body || {}
319
+
320
+ if (!Array.isArray(plugins)) {
321
+ return res.status(400).json({ error: "plugins must be an array", type: "invalid_argument" })
322
+ }
323
+
324
+ if (!client_id || typeof client_id !== "string") {
325
+ return res.status(400).json({ error: "client_id is required", type: "invalid_argument" })
326
+ }
327
+
328
+ // Update client last_seen
329
+ await storage.set(`client:${client_id}`, {
330
+ client_id: client_id,
331
+ last_seen: new Date(),
332
+ plugin_count: plugins.length
333
+ })
334
+
335
+ // Remove existing cli resources from this specific client only
336
+ const allMcpKeys = await storage.listKeys("mcp:")
337
+ const allSpecKeys = await storage.listKeys("spec:")
338
+ const clientMcpKeys = allMcpKeys.filter(k => k.startsWith(`mcp:cli:${client_id}:`))
339
+ const clientSpecKeys = allSpecKeys.filter(k => k.startsWith(`spec:cli:${client_id}:`))
340
+
341
+ // Remove this client's existing resources
342
+ for (const key of clientMcpKeys) {
343
+ await storage.delete(key)
344
+ }
345
+ for (const key of clientSpecKeys) {
346
+ await storage.delete(key)
347
+ }
348
+
349
+ // Store plugin metadata and register resources
350
+ const results = { synced: plugins.length, registered_mcp: 0, registered_specs: 0, errors: [] }
351
+
352
+ for (const plugin of plugins) {
353
+ if (!plugin.name || !plugin.server_resources) continue
354
+
355
+ try {
356
+ // Store plugin metadata with client_id
357
+ await storage.set(`plugin_client:${client_id}:${plugin.name}`, {
358
+ name: plugin.name,
359
+ server_resources: plugin.server_resources,
360
+ client_id: client_id,
361
+ synced_at: new Date()
362
+ })
363
+
364
+ // Register resources with client_id in key
365
+ const regResults = await registerPluginResources(plugin.name, plugin.server_resources, "cli", client_id)
366
+ results.registered_mcp += regResults.mcp.length
367
+ results.registered_specs += regResults.specs.length
368
+ results.errors.push(...regResults.errors)
369
+ } catch (err) {
370
+ results.errors.push(`Failed to sync plugin ${plugin.name}: ${err.message}`)
371
+ }
372
+ }
373
+
374
+ await bumpVersion()
375
+ res.json({ ok: true, ...results })
376
+ } catch (err) {
377
+ handleError(res, err)
378
+ }
379
+ })
380
+
381
+ // List clients endpoint
382
+ router.get("/clients", async (req, res) => {
383
+ try {
384
+ const storage = getStorage()
385
+ const clientKeys = await storage.listKeys("client:")
386
+ const clients = []
387
+
388
+ for (const key of clientKeys) {
389
+ try {
390
+ const client = await storage.get(key)
391
+ if (client && client.client_id) {
392
+ clients.push(client)
393
+ }
394
+ } catch (err) {
395
+ // Skip if client read fails
396
+ }
397
+ }
398
+
399
+ // Sort by last_seen descending
400
+ clients.sort((a, b) => new Date(b.last_seen) - new Date(a.last_seen))
401
+
402
+ if (req.query.format !== "json" && req.accepts("html") && !req.xhr && !req.headers["x-requested-with"]) {
403
+ return res.render("clients", { clients })
404
+ }
405
+
406
+ res.json({ clients })
407
+ } catch (err) {
408
+ handleError(res, err)
409
+ }
410
+ })
411
+
412
+ // API Keys endpoints
413
+
414
+ // POST /api/plugins/api-keys - Create API key
415
+ router.post("/api-keys", allowIfNoApiKeys, async (req, res) => {
416
+ try {
417
+ const { name } = req.body || {}
418
+ if (!name || typeof name !== "string") {
419
+ return res.status(400).json({ error: "name is required", type: "invalid_argument" })
420
+ }
421
+
422
+ const settings = await getSettings()
423
+ const crypto = require("crypto")
424
+ const key = crypto.randomBytes(32).toString("hex")
425
+
426
+ const newApiKey = {
427
+ name: String(name).trim(),
428
+ key,
429
+ created_at: new Date().toISOString()
430
+ }
431
+
432
+ const apiKeys = Array.isArray(settings.api_keys) ? settings.api_keys : []
433
+ apiKeys.push(newApiKey)
434
+
435
+ await updateSettings({ api_keys: apiKeys })
436
+ res.status(201).json(newApiKey)
437
+ } catch (err) {
438
+ handleError(res, err)
439
+ }
440
+ })
441
+
442
+ // DELETE /api/plugins/api-keys/:key - Delete API key
443
+ router.delete("/api-keys/:key", allowIfNoApiKeys, async (req, res) => {
444
+ try {
445
+ const keyToDelete = req.params.key
446
+ const settings = await getSettings()
447
+ const apiKeys = Array.isArray(settings.api_keys) ? settings.api_keys : []
448
+ const filtered = apiKeys.filter(k => k.key !== keyToDelete)
449
+
450
+ if (filtered.length === apiKeys.length) {
451
+ return res.status(404).json({ error: "API key not found", type: "resource_not_found" })
452
+ }
453
+
454
+ await updateSettings({ api_keys: filtered })
455
+ res.json({ ok: true })
456
+ } catch (err) {
457
+ handleError(res, err)
458
+ }
459
+ })
460
+
262
461
  module.exports = router
@@ -28,9 +28,12 @@ router.get("/", async (req, res) => {
28
28
  router.post("/", async (req, res) => {
29
29
  try {
30
30
  const storage = getStorage()
31
- const { name, url, auth } = req.body
31
+ const { name, url, auth, pluginSource } = req.body
32
32
  const key = `spec:${name}`
33
- const doc = { _id: key, name, url, auth: auth || "none", createdAt: new Date() }
33
+ // Support both simple string auth and object auth
34
+ const authValue = auth || "none"
35
+ const doc = { _id: key, name, url, auth: authValue, createdAt: new Date() }
36
+ if (typeof pluginSource === "string") doc.pluginSource = pluginSource
34
37
  await storage.set(key, doc)
35
38
  await bumpVersion()
36
39
  if (req.headers["content-type"]?.includes("urlencoded")) {
@@ -54,7 +57,9 @@ router.put("/:id", async (req, res) => {
54
57
  await storage.delete(id)
55
58
  }
56
59
 
57
- const doc = { _id: newKey, name, url, auth: auth || "none" }
60
+ // Support both simple string auth and object auth
61
+ const authValue = auth || "none"
62
+ const doc = { _id: newKey, name, url, auth: authValue }
58
63
  await storage.set(newKey, doc)
59
64
  await bumpVersion()
60
65
  res.json({ ok: true })
@@ -65,6 +65,7 @@ async function listAdapters() {
65
65
  const records = await Promise.all(keys.map(k => storage.get(k)))
66
66
  return records
67
67
  .filter(Boolean)
68
+ .filter(record => record.name) // Filter out records without name (e.g., package records)
68
69
  .sort((a, b) => String(a.name || "").localeCompare(String(b.name || "")))
69
70
  .map(toPublicAdapter)
70
71
  }