gitlab-mcp-test 6.62.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 (615) hide show
  1. package/LICENSE +202 -0
  2. package/LICENSE.MIT +21 -0
  3. package/README.md +122 -0
  4. package/README.md.in +122 -0
  5. package/dist/generated/prisma/client.d.ts +13 -0
  6. package/dist/generated/prisma/client.js +46 -0
  7. package/dist/generated/prisma/client.js.map +1 -0
  8. package/dist/generated/prisma/commonInputTypes.d.ts +245 -0
  9. package/dist/generated/prisma/commonInputTypes.js +3 -0
  10. package/dist/generated/prisma/commonInputTypes.js.map +1 -0
  11. package/dist/generated/prisma/enums.d.ts +1 -0
  12. package/dist/generated/prisma/enums.js +3 -0
  13. package/dist/generated/prisma/enums.js.map +1 -0
  14. package/dist/generated/prisma/internal/class.d.ts +47 -0
  15. package/dist/generated/prisma/internal/class.js +75 -0
  16. package/dist/generated/prisma/internal/class.js.map +1 -0
  17. package/dist/generated/prisma/internal/prismaNamespace.d.ts +714 -0
  18. package/dist/generated/prisma/internal/prismaNamespace.js +141 -0
  19. package/dist/generated/prisma/internal/prismaNamespace.js.map +1 -0
  20. package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +513 -0
  21. package/dist/generated/prisma/models/AuthCodeFlowState.js +3 -0
  22. package/dist/generated/prisma/models/AuthCodeFlowState.js.map +1 -0
  23. package/dist/generated/prisma/models/AuthorizationCode.d.ts +641 -0
  24. package/dist/generated/prisma/models/AuthorizationCode.js +3 -0
  25. package/dist/generated/prisma/models/AuthorizationCode.js.map +1 -0
  26. package/dist/generated/prisma/models/DeviceFlowState.d.ts +603 -0
  27. package/dist/generated/prisma/models/DeviceFlowState.js +3 -0
  28. package/dist/generated/prisma/models/DeviceFlowState.js.map +1 -0
  29. package/dist/generated/prisma/models/McpSessionMapping.d.ts +438 -0
  30. package/dist/generated/prisma/models/McpSessionMapping.js +3 -0
  31. package/dist/generated/prisma/models/McpSessionMapping.js.map +1 -0
  32. package/dist/generated/prisma/models/OAuthSession.d.ts +1037 -0
  33. package/dist/generated/prisma/models/OAuthSession.js +3 -0
  34. package/dist/generated/prisma/models/OAuthSession.js.map +1 -0
  35. package/dist/generated/prisma/models.d.ts +6 -0
  36. package/dist/generated/prisma/models.js +3 -0
  37. package/dist/generated/prisma/models.js.map +1 -0
  38. package/dist/src/cli/docker/container-runtime.d.ts +4 -0
  39. package/dist/src/cli/docker/container-runtime.js +85 -0
  40. package/dist/src/cli/docker/container-runtime.js.map +1 -0
  41. package/dist/src/cli/docker/docker-command.d.ts +15 -0
  42. package/dist/src/cli/docker/docker-command.js +421 -0
  43. package/dist/src/cli/docker/docker-command.js.map +1 -0
  44. package/dist/src/cli/docker/docker-utils.d.ts +25 -0
  45. package/dist/src/cli/docker/docker-utils.js +386 -0
  46. package/dist/src/cli/docker/docker-utils.js.map +1 -0
  47. package/dist/src/cli/docker/index.d.ts +4 -0
  48. package/dist/src/cli/docker/index.js +24 -0
  49. package/dist/src/cli/docker/index.js.map +1 -0
  50. package/dist/src/cli/docker/types.d.ts +83 -0
  51. package/dist/src/cli/docker/types.js +21 -0
  52. package/dist/src/cli/docker/types.js.map +1 -0
  53. package/dist/src/cli/init/browser.d.ts +7 -0
  54. package/dist/src/cli/init/browser.js +27 -0
  55. package/dist/src/cli/init/browser.js.map +1 -0
  56. package/dist/src/cli/init/config-generator.d.ts +11 -0
  57. package/dist/src/cli/init/config-generator.js +87 -0
  58. package/dist/src/cli/init/config-generator.js.map +1 -0
  59. package/dist/src/cli/init/connection.d.ts +8 -0
  60. package/dist/src/cli/init/connection.js +118 -0
  61. package/dist/src/cli/init/connection.js.map +1 -0
  62. package/dist/src/cli/init/index.d.ts +4 -0
  63. package/dist/src/cli/init/index.js +32 -0
  64. package/dist/src/cli/init/index.js.map +1 -0
  65. package/dist/src/cli/init/types.d.ts +31 -0
  66. package/dist/src/cli/init/types.js +66 -0
  67. package/dist/src/cli/init/types.js.map +1 -0
  68. package/dist/src/cli/init/wizard.d.ts +1 -0
  69. package/dist/src/cli/init/wizard.js +283 -0
  70. package/dist/src/cli/init/wizard.js.map +1 -0
  71. package/dist/src/cli/inject-tool-refs.d.ts +35 -0
  72. package/dist/src/cli/inject-tool-refs.js +261 -0
  73. package/dist/src/cli/inject-tool-refs.js.map +1 -0
  74. package/dist/src/cli/install/backup.d.ts +4 -0
  75. package/dist/src/cli/install/backup.js +63 -0
  76. package/dist/src/cli/install/backup.js.map +1 -0
  77. package/dist/src/cli/install/detector.d.ts +10 -0
  78. package/dist/src/cli/install/detector.js +133 -0
  79. package/dist/src/cli/install/detector.js.map +1 -0
  80. package/dist/src/cli/install/index.d.ts +5 -0
  81. package/dist/src/cli/install/index.js +27 -0
  82. package/dist/src/cli/install/index.js.map +1 -0
  83. package/dist/src/cli/install/install-command.d.ts +19 -0
  84. package/dist/src/cli/install/install-command.js +300 -0
  85. package/dist/src/cli/install/install-command.js.map +1 -0
  86. package/dist/src/cli/install/installers.d.ts +12 -0
  87. package/dist/src/cli/install/installers.js +439 -0
  88. package/dist/src/cli/install/installers.js.map +1 -0
  89. package/dist/src/cli/install/types.d.ts +52 -0
  90. package/dist/src/cli/install/types.js +87 -0
  91. package/dist/src/cli/install/types.js.map +1 -0
  92. package/dist/src/cli/instances/index.d.ts +2 -0
  93. package/dist/src/cli/instances/index.js +7 -0
  94. package/dist/src/cli/instances/index.js.map +1 -0
  95. package/dist/src/cli/instances/instances-command.d.ts +6 -0
  96. package/dist/src/cli/instances/instances-command.js +351 -0
  97. package/dist/src/cli/instances/instances-command.js.map +1 -0
  98. package/dist/src/cli/list-tools.d.ts +2 -0
  99. package/dist/src/cli/list-tools.js +1431 -0
  100. package/dist/src/cli/list-tools.js.map +1 -0
  101. package/dist/src/cli/setup/discovery.d.ts +3 -0
  102. package/dist/src/cli/setup/discovery.js +71 -0
  103. package/dist/src/cli/setup/discovery.js.map +1 -0
  104. package/dist/src/cli/setup/flows/configure-existing.d.ts +2 -0
  105. package/dist/src/cli/setup/flows/configure-existing.js +211 -0
  106. package/dist/src/cli/setup/flows/configure-existing.js.map +1 -0
  107. package/dist/src/cli/setup/flows/local-setup.d.ts +2 -0
  108. package/dist/src/cli/setup/flows/local-setup.js +206 -0
  109. package/dist/src/cli/setup/flows/local-setup.js.map +1 -0
  110. package/dist/src/cli/setup/flows/server-setup.d.ts +2 -0
  111. package/dist/src/cli/setup/flows/server-setup.js +185 -0
  112. package/dist/src/cli/setup/flows/server-setup.js.map +1 -0
  113. package/dist/src/cli/setup/flows/tool-selection.d.ts +3 -0
  114. package/dist/src/cli/setup/flows/tool-selection.js +275 -0
  115. package/dist/src/cli/setup/flows/tool-selection.js.map +1 -0
  116. package/dist/src/cli/setup/index.d.ts +4 -0
  117. package/dist/src/cli/setup/index.js +29 -0
  118. package/dist/src/cli/setup/index.js.map +1 -0
  119. package/dist/src/cli/setup/presets.d.ts +7 -0
  120. package/dist/src/cli/setup/presets.js +261 -0
  121. package/dist/src/cli/setup/presets.js.map +1 -0
  122. package/dist/src/cli/setup/types.d.ts +68 -0
  123. package/dist/src/cli/setup/types.js +3 -0
  124. package/dist/src/cli/setup/types.js.map +1 -0
  125. package/dist/src/cli/setup/wizard.d.ts +4 -0
  126. package/dist/src/cli/setup/wizard.js +128 -0
  127. package/dist/src/cli/setup/wizard.js.map +1 -0
  128. package/dist/src/cli/utils/index.d.ts +1 -0
  129. package/dist/src/cli/utils/index.js +6 -0
  130. package/dist/src/cli/utils/index.js.map +1 -0
  131. package/dist/src/cli/utils/path-utils.d.ts +1 -0
  132. package/dist/src/cli/utils/path-utils.js +18 -0
  133. package/dist/src/cli/utils/path-utils.js.map +1 -0
  134. package/dist/src/cli-utils.d.ts +19 -0
  135. package/dist/src/cli-utils.js +183 -0
  136. package/dist/src/cli-utils.js.map +1 -0
  137. package/dist/src/config/index.d.ts +4 -0
  138. package/dist/src/config/index.js +19 -0
  139. package/dist/src/config/index.js.map +1 -0
  140. package/dist/src/config/instances-loader.d.ts +10 -0
  141. package/dist/src/config/instances-loader.js +294 -0
  142. package/dist/src/config/instances-loader.js.map +1 -0
  143. package/dist/src/config/instances-schema.d.ts +89 -0
  144. package/dist/src/config/instances-schema.js +196 -0
  145. package/dist/src/config/instances-schema.js.map +1 -0
  146. package/dist/src/config.d.ts +82 -0
  147. package/dist/src/config.js +379 -0
  148. package/dist/src/config.js.map +1 -0
  149. package/dist/src/dashboard/handler.d.ts +4 -0
  150. package/dist/src/dashboard/handler.js +37 -0
  151. package/dist/src/dashboard/handler.js.map +1 -0
  152. package/dist/src/dashboard/html-template.d.ts +2 -0
  153. package/dist/src/dashboard/html-template.js +443 -0
  154. package/dist/src/dashboard/html-template.js.map +1 -0
  155. package/dist/src/dashboard/index.d.ts +4 -0
  156. package/dist/src/dashboard/index.js +15 -0
  157. package/dist/src/dashboard/index.js.map +1 -0
  158. package/dist/src/dashboard/metrics.d.ts +79 -0
  159. package/dist/src/dashboard/metrics.js +194 -0
  160. package/dist/src/dashboard/metrics.js.map +1 -0
  161. package/dist/src/discovery/auto.d.ts +22 -0
  162. package/dist/src/discovery/auto.js +170 -0
  163. package/dist/src/discovery/auto.js.map +1 -0
  164. package/dist/src/discovery/git-remote.d.ts +19 -0
  165. package/dist/src/discovery/git-remote.js +197 -0
  166. package/dist/src/discovery/git-remote.js.map +1 -0
  167. package/dist/src/discovery/index.d.ts +3 -0
  168. package/dist/src/discovery/index.js +16 -0
  169. package/dist/src/discovery/index.js.map +1 -0
  170. package/dist/src/discovery/profile-matcher.d.ts +8 -0
  171. package/dist/src/discovery/profile-matcher.js +48 -0
  172. package/dist/src/discovery/profile-matcher.js.map +1 -0
  173. package/dist/src/entities/context/context-manager.d.ts +31 -0
  174. package/dist/src/entities/context/context-manager.js +352 -0
  175. package/dist/src/entities/context/context-manager.js.map +1 -0
  176. package/dist/src/entities/context/handlers.d.ts +11 -0
  177. package/dist/src/entities/context/handlers.js +67 -0
  178. package/dist/src/entities/context/handlers.js.map +1 -0
  179. package/dist/src/entities/context/index.d.ts +11 -0
  180. package/dist/src/entities/context/index.js +34 -0
  181. package/dist/src/entities/context/index.js.map +1 -0
  182. package/dist/src/entities/context/registry.d.ts +5 -0
  183. package/dist/src/entities/context/registry.js +66 -0
  184. package/dist/src/entities/context/registry.js.map +1 -0
  185. package/dist/src/entities/context/schema.d.ts +60 -0
  186. package/dist/src/entities/context/schema.js +61 -0
  187. package/dist/src/entities/context/schema.js.map +1 -0
  188. package/dist/src/entities/context/types.d.ts +112 -0
  189. package/dist/src/entities/context/types.js +3 -0
  190. package/dist/src/entities/context/types.js.map +1 -0
  191. package/dist/src/entities/context/whoami.d.ts +2 -0
  192. package/dist/src/entities/context/whoami.js +267 -0
  193. package/dist/src/entities/context/whoami.js.map +1 -0
  194. package/dist/src/entities/core/index.d.ts +7 -0
  195. package/dist/src/entities/core/index.js +31 -0
  196. package/dist/src/entities/core/index.js.map +1 -0
  197. package/dist/src/entities/core/registry.d.ts +5 -0
  198. package/dist/src/entities/core/registry.js +784 -0
  199. package/dist/src/entities/core/registry.js.map +1 -0
  200. package/dist/src/entities/core/schema-readonly.d.ts +268 -0
  201. package/dist/src/entities/core/schema-readonly.js +289 -0
  202. package/dist/src/entities/core/schema-readonly.js.map +1 -0
  203. package/dist/src/entities/core/schema.d.ts +116 -0
  204. package/dist/src/entities/core/schema.js +173 -0
  205. package/dist/src/entities/core/schema.js.map +1 -0
  206. package/dist/src/entities/files/index.d.ts +7 -0
  207. package/dist/src/entities/files/index.js +31 -0
  208. package/dist/src/entities/files/index.js.map +1 -0
  209. package/dist/src/entities/files/registry.d.ts +5 -0
  210. package/dist/src/entities/files/registry.js +267 -0
  211. package/dist/src/entities/files/registry.js.map +1 -0
  212. package/dist/src/entities/files/schema-readonly.d.ts +83 -0
  213. package/dist/src/entities/files/schema-readonly.js +64 -0
  214. package/dist/src/entities/files/schema-readonly.js.map +1 -0
  215. package/dist/src/entities/files/schema.d.ts +43 -0
  216. package/dist/src/entities/files/schema.js +54 -0
  217. package/dist/src/entities/files/schema.js.map +1 -0
  218. package/dist/src/entities/index.d.ts +17 -0
  219. package/dist/src/entities/index.js +34 -0
  220. package/dist/src/entities/index.js.map +1 -0
  221. package/dist/src/entities/integrations/index.d.ts +4 -0
  222. package/dist/src/entities/integrations/index.js +21 -0
  223. package/dist/src/entities/integrations/index.js.map +1 -0
  224. package/dist/src/entities/integrations/registry.d.ts +5 -0
  225. package/dist/src/entities/integrations/registry.js +127 -0
  226. package/dist/src/entities/integrations/registry.js.map +1 -0
  227. package/dist/src/entities/integrations/schema-readonly.d.ts +63 -0
  228. package/dist/src/entities/integrations/schema-readonly.js +22 -0
  229. package/dist/src/entities/integrations/schema-readonly.js.map +1 -0
  230. package/dist/src/entities/integrations/schema.d.ts +180 -0
  231. package/dist/src/entities/integrations/schema.js +106 -0
  232. package/dist/src/entities/integrations/schema.js.map +1 -0
  233. package/dist/src/entities/iterations/index.d.ts +2 -0
  234. package/dist/src/entities/iterations/index.js +19 -0
  235. package/dist/src/entities/iterations/index.js.map +1 -0
  236. package/dist/src/entities/iterations/registry.d.ts +5 -0
  237. package/dist/src/entities/iterations/registry.js +106 -0
  238. package/dist/src/entities/iterations/registry.js.map +1 -0
  239. package/dist/src/entities/iterations/schema-readonly.d.ts +21 -0
  240. package/dist/src/entities/iterations/schema-readonly.js +28 -0
  241. package/dist/src/entities/iterations/schema-readonly.js.map +1 -0
  242. package/dist/src/entities/labels/index.d.ts +7 -0
  243. package/dist/src/entities/labels/index.js +31 -0
  244. package/dist/src/entities/labels/index.js.map +1 -0
  245. package/dist/src/entities/labels/registry.d.ts +5 -0
  246. package/dist/src/entities/labels/registry.js +131 -0
  247. package/dist/src/entities/labels/registry.js.map +1 -0
  248. package/dist/src/entities/labels/schema-readonly.d.ts +16 -0
  249. package/dist/src/entities/labels/schema-readonly.js +28 -0
  250. package/dist/src/entities/labels/schema-readonly.js.map +1 -0
  251. package/dist/src/entities/labels/schema.d.ts +23 -0
  252. package/dist/src/entities/labels/schema.js +46 -0
  253. package/dist/src/entities/labels/schema.js.map +1 -0
  254. package/dist/src/entities/members/index.d.ts +3 -0
  255. package/dist/src/entities/members/index.js +25 -0
  256. package/dist/src/entities/members/index.js.map +1 -0
  257. package/dist/src/entities/members/registry.d.ts +5 -0
  258. package/dist/src/entities/members/registry.js +224 -0
  259. package/dist/src/entities/members/registry.js.map +1 -0
  260. package/dist/src/entities/members/schema-readonly.d.ts +53 -0
  261. package/dist/src/entities/members/schema-readonly.js +79 -0
  262. package/dist/src/entities/members/schema-readonly.js.map +1 -0
  263. package/dist/src/entities/members/schema.d.ts +40 -0
  264. package/dist/src/entities/members/schema.js +80 -0
  265. package/dist/src/entities/members/schema.js.map +1 -0
  266. package/dist/src/entities/milestones/index.d.ts +7 -0
  267. package/dist/src/entities/milestones/index.js +31 -0
  268. package/dist/src/entities/milestones/index.js.map +1 -0
  269. package/dist/src/entities/milestones/registry.d.ts +5 -0
  270. package/dist/src/entities/milestones/registry.js +150 -0
  271. package/dist/src/entities/milestones/registry.js.map +1 -0
  272. package/dist/src/entities/milestones/schema-readonly.d.ts +57 -0
  273. package/dist/src/entities/milestones/schema-readonly.js +81 -0
  274. package/dist/src/entities/milestones/schema-readonly.js.map +1 -0
  275. package/dist/src/entities/milestones/schema.d.ts +30 -0
  276. package/dist/src/entities/milestones/schema.js +47 -0
  277. package/dist/src/entities/milestones/schema.js.map +1 -0
  278. package/dist/src/entities/mrs/index.d.ts +7 -0
  279. package/dist/src/entities/mrs/index.js +31 -0
  280. package/dist/src/entities/mrs/index.js.map +1 -0
  281. package/dist/src/entities/mrs/registry.d.ts +22 -0
  282. package/dist/src/entities/mrs/registry.js +495 -0
  283. package/dist/src/entities/mrs/registry.js.map +1 -0
  284. package/dist/src/entities/mrs/schema-readonly.d.ts +135 -0
  285. package/dist/src/entities/mrs/schema-readonly.js +326 -0
  286. package/dist/src/entities/mrs/schema-readonly.js.map +1 -0
  287. package/dist/src/entities/mrs/schema.d.ts +339 -0
  288. package/dist/src/entities/mrs/schema.js +259 -0
  289. package/dist/src/entities/mrs/schema.js.map +1 -0
  290. package/dist/src/entities/pipelines/index.d.ts +7 -0
  291. package/dist/src/entities/pipelines/index.js +31 -0
  292. package/dist/src/entities/pipelines/index.js.map +1 -0
  293. package/dist/src/entities/pipelines/registry.d.ts +5 -0
  294. package/dist/src/entities/pipelines/registry.js +323 -0
  295. package/dist/src/entities/pipelines/registry.js.map +1 -0
  296. package/dist/src/entities/pipelines/schema-readonly.d.ts +239 -0
  297. package/dist/src/entities/pipelines/schema-readonly.js +278 -0
  298. package/dist/src/entities/pipelines/schema-readonly.js.map +1 -0
  299. package/dist/src/entities/pipelines/schema.d.ts +47 -0
  300. package/dist/src/entities/pipelines/schema.js +73 -0
  301. package/dist/src/entities/pipelines/schema.js.map +1 -0
  302. package/dist/src/entities/refs/index.d.ts +3 -0
  303. package/dist/src/entities/refs/index.js +25 -0
  304. package/dist/src/entities/refs/index.js.map +1 -0
  305. package/dist/src/entities/refs/registry.d.ts +5 -0
  306. package/dist/src/entities/refs/registry.js +233 -0
  307. package/dist/src/entities/refs/registry.js.map +1 -0
  308. package/dist/src/entities/refs/schema-readonly.d.ts +48 -0
  309. package/dist/src/entities/refs/schema-readonly.js +76 -0
  310. package/dist/src/entities/refs/schema-readonly.js.map +1 -0
  311. package/dist/src/entities/refs/schema.d.ts +85 -0
  312. package/dist/src/entities/refs/schema.js +149 -0
  313. package/dist/src/entities/refs/schema.js.map +1 -0
  314. package/dist/src/entities/releases/index.d.ts +3 -0
  315. package/dist/src/entities/releases/index.js +13 -0
  316. package/dist/src/entities/releases/index.js.map +1 -0
  317. package/dist/src/entities/releases/registry.d.ts +5 -0
  318. package/dist/src/entities/releases/registry.js +183 -0
  319. package/dist/src/entities/releases/registry.js.map +1 -0
  320. package/dist/src/entities/releases/schema-readonly.d.ts +28 -0
  321. package/dist/src/entities/releases/schema-readonly.js +56 -0
  322. package/dist/src/entities/releases/schema-readonly.js.map +1 -0
  323. package/dist/src/entities/releases/schema.d.ts +56 -0
  324. package/dist/src/entities/releases/schema.js +97 -0
  325. package/dist/src/entities/releases/schema.js.map +1 -0
  326. package/dist/src/entities/search/index.d.ts +2 -0
  327. package/dist/src/entities/search/index.js +24 -0
  328. package/dist/src/entities/search/index.js.map +1 -0
  329. package/dist/src/entities/search/registry.d.ts +5 -0
  330. package/dist/src/entities/search/registry.js +113 -0
  331. package/dist/src/entities/search/registry.js.map +1 -0
  332. package/dist/src/entities/search/schema-readonly.d.ts +228 -0
  333. package/dist/src/entities/search/schema-readonly.js +64 -0
  334. package/dist/src/entities/search/schema-readonly.js.map +1 -0
  335. package/dist/src/entities/shared.d.ts +291 -0
  336. package/dist/src/entities/shared.js +269 -0
  337. package/dist/src/entities/shared.js.map +1 -0
  338. package/dist/src/entities/snippets/index.d.ts +7 -0
  339. package/dist/src/entities/snippets/index.js +31 -0
  340. package/dist/src/entities/snippets/index.js.map +1 -0
  341. package/dist/src/entities/snippets/registry.d.ts +5 -0
  342. package/dist/src/entities/snippets/registry.js +200 -0
  343. package/dist/src/entities/snippets/registry.js.map +1 -0
  344. package/dist/src/entities/snippets/schema-readonly.d.ts +25 -0
  345. package/dist/src/entities/snippets/schema-readonly.js +45 -0
  346. package/dist/src/entities/snippets/schema-readonly.js.map +1 -0
  347. package/dist/src/entities/snippets/schema.d.ts +56 -0
  348. package/dist/src/entities/snippets/schema.js +89 -0
  349. package/dist/src/entities/snippets/schema.js.map +1 -0
  350. package/dist/src/entities/utils.d.ts +16 -0
  351. package/dist/src/entities/utils.js +57 -0
  352. package/dist/src/entities/utils.js.map +1 -0
  353. package/dist/src/entities/variables/index.d.ts +7 -0
  354. package/dist/src/entities/variables/index.js +31 -0
  355. package/dist/src/entities/variables/index.js.map +1 -0
  356. package/dist/src/entities/variables/registry.d.ts +5 -0
  357. package/dist/src/entities/variables/registry.js +140 -0
  358. package/dist/src/entities/variables/registry.js.map +1 -0
  359. package/dist/src/entities/variables/schema-readonly.d.ts +15 -0
  360. package/dist/src/entities/variables/schema-readonly.js +33 -0
  361. package/dist/src/entities/variables/schema-readonly.js.map +1 -0
  362. package/dist/src/entities/variables/schema.d.ts +41 -0
  363. package/dist/src/entities/variables/schema.js +92 -0
  364. package/dist/src/entities/variables/schema.js.map +1 -0
  365. package/dist/src/entities/webhooks/index.d.ts +4 -0
  366. package/dist/src/entities/webhooks/index.js +21 -0
  367. package/dist/src/entities/webhooks/index.js.map +1 -0
  368. package/dist/src/entities/webhooks/registry.d.ts +5 -0
  369. package/dist/src/entities/webhooks/registry.js +162 -0
  370. package/dist/src/entities/webhooks/registry.js.map +1 -0
  371. package/dist/src/entities/webhooks/schema-readonly.d.ts +22 -0
  372. package/dist/src/entities/webhooks/schema-readonly.js +25 -0
  373. package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
  374. package/dist/src/entities/webhooks/schema.d.ts +101 -0
  375. package/dist/src/entities/webhooks/schema.js +101 -0
  376. package/dist/src/entities/webhooks/schema.js.map +1 -0
  377. package/dist/src/entities/wiki/index.d.ts +7 -0
  378. package/dist/src/entities/wiki/index.js +31 -0
  379. package/dist/src/entities/wiki/index.js.map +1 -0
  380. package/dist/src/entities/wiki/registry.d.ts +5 -0
  381. package/dist/src/entities/wiki/registry.js +127 -0
  382. package/dist/src/entities/wiki/registry.js.map +1 -0
  383. package/dist/src/entities/wiki/schema-readonly.d.ts +22 -0
  384. package/dist/src/entities/wiki/schema-readonly.js +27 -0
  385. package/dist/src/entities/wiki/schema-readonly.js.map +1 -0
  386. package/dist/src/entities/wiki/schema.d.ts +30 -0
  387. package/dist/src/entities/wiki/schema.js +38 -0
  388. package/dist/src/entities/wiki/schema.js.map +1 -0
  389. package/dist/src/entities/workitems/index.d.ts +7 -0
  390. package/dist/src/entities/workitems/index.js +31 -0
  391. package/dist/src/entities/workitems/index.js.map +1 -0
  392. package/dist/src/entities/workitems/registry.d.ts +5 -0
  393. package/dist/src/entities/workitems/registry.js +725 -0
  394. package/dist/src/entities/workitems/registry.js.map +1 -0
  395. package/dist/src/entities/workitems/schema-readonly.d.ts +49 -0
  396. package/dist/src/entities/workitems/schema-readonly.js +87 -0
  397. package/dist/src/entities/workitems/schema-readonly.js.map +1 -0
  398. package/dist/src/entities/workitems/schema.d.ts +97 -0
  399. package/dist/src/entities/workitems/schema.js +187 -0
  400. package/dist/src/entities/workitems/schema.js.map +1 -0
  401. package/dist/src/graphql/DynamicWorkItemsQuery.d.ts +56 -0
  402. package/dist/src/graphql/DynamicWorkItemsQuery.js +190 -0
  403. package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -0
  404. package/dist/src/graphql/client.d.ts +17 -0
  405. package/dist/src/graphql/client.js +56 -0
  406. package/dist/src/graphql/client.js.map +1 -0
  407. package/dist/src/graphql/index.d.ts +2 -0
  408. package/dist/src/graphql/index.js +21 -0
  409. package/dist/src/graphql/index.js.map +1 -0
  410. package/dist/src/graphql/workItems.d.ts +659 -0
  411. package/dist/src/graphql/workItems.js +1545 -0
  412. package/dist/src/graphql/workItems.js.map +1 -0
  413. package/dist/src/handlers.d.ts +2 -0
  414. package/dist/src/handlers.js +346 -0
  415. package/dist/src/handlers.js.map +1 -0
  416. package/dist/src/http-client.d.ts +1 -0
  417. package/dist/src/http-client.js +9 -0
  418. package/dist/src/http-client.js.map +1 -0
  419. package/dist/src/logger.d.ts +9 -0
  420. package/dist/src/logger.js +129 -0
  421. package/dist/src/logger.js.map +1 -0
  422. package/dist/src/logging/access-log.d.ts +15 -0
  423. package/dist/src/logging/access-log.js +157 -0
  424. package/dist/src/logging/access-log.js.map +1 -0
  425. package/dist/src/logging/connection-tracker.d.ts +21 -0
  426. package/dist/src/logging/connection-tracker.js +106 -0
  427. package/dist/src/logging/connection-tracker.js.map +1 -0
  428. package/dist/src/logging/index.d.ts +5 -0
  429. package/dist/src/logging/index.js +27 -0
  430. package/dist/src/logging/index.js.map +1 -0
  431. package/dist/src/logging/request-tracker.d.ts +39 -0
  432. package/dist/src/logging/request-tracker.js +208 -0
  433. package/dist/src/logging/request-tracker.js.map +1 -0
  434. package/dist/src/logging/types.d.ts +55 -0
  435. package/dist/src/logging/types.js +5 -0
  436. package/dist/src/logging/types.js.map +1 -0
  437. package/dist/src/main.d.ts +2 -0
  438. package/dist/src/main.js +219 -0
  439. package/dist/src/main.js.map +1 -0
  440. package/dist/src/middleware/index.d.ts +2 -0
  441. package/dist/src/middleware/index.js +12 -0
  442. package/dist/src/middleware/index.js.map +1 -0
  443. package/dist/src/middleware/oauth-auth.d.ts +4 -0
  444. package/dist/src/middleware/oauth-auth.js +137 -0
  445. package/dist/src/middleware/oauth-auth.js.map +1 -0
  446. package/dist/src/middleware/rate-limiter.d.ts +11 -0
  447. package/dist/src/middleware/rate-limiter.js +183 -0
  448. package/dist/src/middleware/rate-limiter.js.map +1 -0
  449. package/dist/src/oauth/config.d.ts +25 -0
  450. package/dist/src/oauth/config.js +109 -0
  451. package/dist/src/oauth/config.js.map +1 -0
  452. package/dist/src/oauth/endpoints/authorize.d.ts +3 -0
  453. package/dist/src/oauth/endpoints/authorize.js +454 -0
  454. package/dist/src/oauth/endpoints/authorize.js.map +1 -0
  455. package/dist/src/oauth/endpoints/callback.d.ts +2 -0
  456. package/dist/src/oauth/endpoints/callback.js +134 -0
  457. package/dist/src/oauth/endpoints/callback.js.map +1 -0
  458. package/dist/src/oauth/endpoints/index.d.ts +5 -0
  459. package/dist/src/oauth/endpoints/index.js +19 -0
  460. package/dist/src/oauth/endpoints/index.js.map +1 -0
  461. package/dist/src/oauth/endpoints/metadata.d.ts +5 -0
  462. package/dist/src/oauth/endpoints/metadata.js +42 -0
  463. package/dist/src/oauth/endpoints/metadata.js.map +1 -0
  464. package/dist/src/oauth/endpoints/register.d.ts +15 -0
  465. package/dist/src/oauth/endpoints/register.js +85 -0
  466. package/dist/src/oauth/endpoints/register.js.map +1 -0
  467. package/dist/src/oauth/endpoints/token.d.ts +2 -0
  468. package/dist/src/oauth/endpoints/token.js +167 -0
  469. package/dist/src/oauth/endpoints/token.js.map +1 -0
  470. package/dist/src/oauth/gitlab-device-flow.d.ts +10 -0
  471. package/dist/src/oauth/gitlab-device-flow.js +215 -0
  472. package/dist/src/oauth/gitlab-device-flow.js.map +1 -0
  473. package/dist/src/oauth/index.d.ts +10 -0
  474. package/dist/src/oauth/index.js +69 -0
  475. package/dist/src/oauth/index.js.map +1 -0
  476. package/dist/src/oauth/session-store.d.ts +54 -0
  477. package/dist/src/oauth/session-store.js +311 -0
  478. package/dist/src/oauth/session-store.js.map +1 -0
  479. package/dist/src/oauth/storage/factory.d.ts +4 -0
  480. package/dist/src/oauth/storage/factory.js +73 -0
  481. package/dist/src/oauth/storage/factory.js.map +1 -0
  482. package/dist/src/oauth/storage/file.d.ts +48 -0
  483. package/dist/src/oauth/storage/file.js +307 -0
  484. package/dist/src/oauth/storage/file.js.map +1 -0
  485. package/dist/src/oauth/storage/index.d.ts +5 -0
  486. package/dist/src/oauth/storage/index.js +22 -0
  487. package/dist/src/oauth/storage/index.js.map +1 -0
  488. package/dist/src/oauth/storage/memory.d.ts +76 -0
  489. package/dist/src/oauth/storage/memory.js +280 -0
  490. package/dist/src/oauth/storage/memory.js.map +1 -0
  491. package/dist/src/oauth/storage/postgresql.d.ts +41 -0
  492. package/dist/src/oauth/storage/postgresql.js +444 -0
  493. package/dist/src/oauth/storage/postgresql.js.map +1 -0
  494. package/dist/src/oauth/storage/types.d.ts +66 -0
  495. package/dist/src/oauth/storage/types.js +5 -0
  496. package/dist/src/oauth/storage/types.js.map +1 -0
  497. package/dist/src/oauth/token-context.d.ts +10 -0
  498. package/dist/src/oauth/token-context.js +50 -0
  499. package/dist/src/oauth/token-context.js.map +1 -0
  500. package/dist/src/oauth/token-utils.d.ts +14 -0
  501. package/dist/src/oauth/token-utils.js +148 -0
  502. package/dist/src/oauth/token-utils.js.map +1 -0
  503. package/dist/src/oauth/types.d.ts +117 -0
  504. package/dist/src/oauth/types.js +3 -0
  505. package/dist/src/oauth/types.js.map +1 -0
  506. package/dist/src/profiles/applicator.d.ts +19 -0
  507. package/dist/src/profiles/applicator.js +256 -0
  508. package/dist/src/profiles/applicator.js.map +1 -0
  509. package/dist/src/profiles/builtin/admin.yaml +30 -0
  510. package/dist/src/profiles/builtin/ci.yaml +35 -0
  511. package/dist/src/profiles/builtin/code-reviewer.yaml +41 -0
  512. package/dist/src/profiles/builtin/developer.yaml +40 -0
  513. package/dist/src/profiles/builtin/devops.yaml +33 -0
  514. package/dist/src/profiles/builtin/full-access.yaml +29 -0
  515. package/dist/src/profiles/builtin/gitlab-com.yaml +40 -0
  516. package/dist/src/profiles/builtin/junior-dev.yaml +35 -0
  517. package/dist/src/profiles/builtin/pm.yaml +36 -0
  518. package/dist/src/profiles/builtin/readonly.yaml +33 -0
  519. package/dist/src/profiles/builtin/senior-dev.yaml +41 -0
  520. package/dist/src/profiles/builtin/team-lead.yaml +42 -0
  521. package/dist/src/profiles/index.d.ts +5 -0
  522. package/dist/src/profiles/index.js +34 -0
  523. package/dist/src/profiles/index.js.map +1 -0
  524. package/dist/src/profiles/loader.d.ts +32 -0
  525. package/dist/src/profiles/loader.js +319 -0
  526. package/dist/src/profiles/loader.js.map +1 -0
  527. package/dist/src/profiles/project-loader.d.ts +12 -0
  528. package/dist/src/profiles/project-loader.js +214 -0
  529. package/dist/src/profiles/project-loader.js.map +1 -0
  530. package/dist/src/profiles/scope-enforcer.d.ts +28 -0
  531. package/dist/src/profiles/scope-enforcer.js +236 -0
  532. package/dist/src/profiles/scope-enforcer.js.map +1 -0
  533. package/dist/src/profiles/types.d.ts +261 -0
  534. package/dist/src/profiles/types.js +153 -0
  535. package/dist/src/profiles/types.js.map +1 -0
  536. package/dist/src/registry-manager.d.ts +37 -0
  537. package/dist/src/registry-manager.js +488 -0
  538. package/dist/src/registry-manager.js.map +1 -0
  539. package/dist/src/server.d.ts +2 -0
  540. package/dist/src/server.js +624 -0
  541. package/dist/src/server.js.map +1 -0
  542. package/dist/src/services/ConnectionManager.d.ts +41 -0
  543. package/dist/src/services/ConnectionManager.js +438 -0
  544. package/dist/src/services/ConnectionManager.js.map +1 -0
  545. package/dist/src/services/GitLabVersionDetector.d.ts +52 -0
  546. package/dist/src/services/GitLabVersionDetector.js +215 -0
  547. package/dist/src/services/GitLabVersionDetector.js.map +1 -0
  548. package/dist/src/services/InstanceConnectionPool.d.ts +54 -0
  549. package/dist/src/services/InstanceConnectionPool.js +180 -0
  550. package/dist/src/services/InstanceConnectionPool.js.map +1 -0
  551. package/dist/src/services/InstanceRateLimiter.d.ts +35 -0
  552. package/dist/src/services/InstanceRateLimiter.js +131 -0
  553. package/dist/src/services/InstanceRateLimiter.js.map +1 -0
  554. package/dist/src/services/InstanceRegistry.d.ts +61 -0
  555. package/dist/src/services/InstanceRegistry.js +250 -0
  556. package/dist/src/services/InstanceRegistry.js.map +1 -0
  557. package/dist/src/services/NamespaceTierDetector.d.ts +9 -0
  558. package/dist/src/services/NamespaceTierDetector.js +249 -0
  559. package/dist/src/services/NamespaceTierDetector.js.map +1 -0
  560. package/dist/src/services/SchemaIntrospector.d.ts +39 -0
  561. package/dist/src/services/SchemaIntrospector.js +190 -0
  562. package/dist/src/services/SchemaIntrospector.js.map +1 -0
  563. package/dist/src/services/TokenScopeDetector.d.ts +35 -0
  564. package/dist/src/services/TokenScopeDetector.js +232 -0
  565. package/dist/src/services/TokenScopeDetector.js.map +1 -0
  566. package/dist/src/services/ToolAvailability.d.ts +32 -0
  567. package/dist/src/services/ToolAvailability.js +410 -0
  568. package/dist/src/services/ToolAvailability.js.map +1 -0
  569. package/dist/src/services/WidgetAvailability.d.ts +23 -0
  570. package/dist/src/services/WidgetAvailability.js +158 -0
  571. package/dist/src/services/WidgetAvailability.js.map +1 -0
  572. package/dist/src/session-manager.d.ts +19 -0
  573. package/dist/src/session-manager.js +131 -0
  574. package/dist/src/session-manager.js.map +1 -0
  575. package/dist/src/types.d.ts +28 -0
  576. package/dist/src/types.js +11 -0
  577. package/dist/src/types.js.map +1 -0
  578. package/dist/src/utils/description-utils.d.ts +2 -0
  579. package/dist/src/utils/description-utils.js +25 -0
  580. package/dist/src/utils/description-utils.js.map +1 -0
  581. package/dist/src/utils/error-handler.d.ts +93 -0
  582. package/dist/src/utils/error-handler.js +597 -0
  583. package/dist/src/utils/error-handler.js.map +1 -0
  584. package/dist/src/utils/fetch.d.ts +13 -0
  585. package/dist/src/utils/fetch.js +539 -0
  586. package/dist/src/utils/fetch.js.map +1 -0
  587. package/dist/src/utils/gitlab-api.d.ts +24 -0
  588. package/dist/src/utils/gitlab-api.js +139 -0
  589. package/dist/src/utils/gitlab-api.js.map +1 -0
  590. package/dist/src/utils/idConversion.d.ts +81 -0
  591. package/dist/src/utils/idConversion.js +193 -0
  592. package/dist/src/utils/idConversion.js.map +1 -0
  593. package/dist/src/utils/namespace.d.ts +7 -0
  594. package/dist/src/utils/namespace.js +59 -0
  595. package/dist/src/utils/namespace.js.map +1 -0
  596. package/dist/src/utils/projectIdentifier.d.ts +9 -0
  597. package/dist/src/utils/projectIdentifier.js +59 -0
  598. package/dist/src/utils/projectIdentifier.js.map +1 -0
  599. package/dist/src/utils/request-logger.d.ts +24 -0
  600. package/dist/src/utils/request-logger.js +55 -0
  601. package/dist/src/utils/request-logger.js.map +1 -0
  602. package/dist/src/utils/schema-utils.d.ts +31 -0
  603. package/dist/src/utils/schema-utils.js +288 -0
  604. package/dist/src/utils/schema-utils.js.map +1 -0
  605. package/dist/src/utils/smart-user-search.d.ts +33 -0
  606. package/dist/src/utils/smart-user-search.js +142 -0
  607. package/dist/src/utils/smart-user-search.js.map +1 -0
  608. package/dist/src/utils/version.d.ts +1 -0
  609. package/dist/src/utils/version.js +14 -0
  610. package/dist/src/utils/version.js.map +1 -0
  611. package/dist/src/utils/workItemTypes.d.ts +6 -0
  612. package/dist/src/utils/workItemTypes.js +14 -0
  613. package/dist/src/utils/workItemTypes.js.map +1 -0
  614. package/dist/tsconfig.build.tsbuildinfo +1 -0
  615. package/package.json +511 -0
@@ -0,0 +1,1431 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.main = main;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const registry_manager_1 = require("../registry-manager");
41
+ const ToolAvailability_1 = require("../services/ToolAvailability");
42
+ const profiles_1 = require("../profiles");
43
+ function parseArgs() {
44
+ const args = process.argv.slice(2);
45
+ const options = {
46
+ format: "markdown",
47
+ showEnv: false,
48
+ showEnvGates: false,
49
+ verbose: false,
50
+ detail: false,
51
+ noExamples: false,
52
+ toc: false,
53
+ showPresets: false,
54
+ showProfiles: false,
55
+ validate: false,
56
+ };
57
+ for (let i = 0; i < args.length; i++) {
58
+ const arg = args[i];
59
+ switch (arg) {
60
+ case "--json":
61
+ options.format = "json";
62
+ break;
63
+ case "--simple":
64
+ options.format = "simple";
65
+ break;
66
+ case "--export":
67
+ options.format = "export";
68
+ break;
69
+ case "--entity":
70
+ if (i + 1 >= args.length) {
71
+ console.error("Error: --entity flag requires a value.");
72
+ console.error("Usage: yarn list-tools --entity <entity_name>");
73
+ process.exit(1);
74
+ }
75
+ options.entity = args[++i];
76
+ break;
77
+ case "--tool":
78
+ if (i + 1 >= args.length) {
79
+ console.error("Error: --tool flag requires a value.");
80
+ console.error("Usage: yarn list-tools --tool <tool_name>");
81
+ process.exit(1);
82
+ }
83
+ options.tool = args[++i];
84
+ break;
85
+ case "--env":
86
+ options.showEnv = true;
87
+ break;
88
+ case "--env-gates":
89
+ options.showEnvGates = true;
90
+ break;
91
+ case "--verbose":
92
+ case "-v":
93
+ options.verbose = true;
94
+ break;
95
+ case "--detail":
96
+ options.detail = true;
97
+ break;
98
+ case "--no-examples":
99
+ options.noExamples = true;
100
+ break;
101
+ case "--toc":
102
+ options.toc = true;
103
+ break;
104
+ case "--presets":
105
+ options.showPresets = true;
106
+ break;
107
+ case "--profiles":
108
+ options.showProfiles = true;
109
+ break;
110
+ case "--preset":
111
+ if (i + 1 >= args.length) {
112
+ console.error("Error: --preset flag requires a value.");
113
+ console.error("Usage: yarn list-tools --preset <preset_name>");
114
+ process.exit(1);
115
+ }
116
+ options.preset = args[++i];
117
+ break;
118
+ case "--profile":
119
+ if (i + 1 >= args.length) {
120
+ console.error("Error: --profile flag requires a value.");
121
+ console.error("Usage: yarn list-tools --profile <profile_name>");
122
+ process.exit(1);
123
+ }
124
+ options.profile = args[++i];
125
+ break;
126
+ case "--validate":
127
+ options.validate = true;
128
+ break;
129
+ case "--compare":
130
+ if (i + 1 >= args.length) {
131
+ console.error("Error: --compare flag requires a value.");
132
+ console.error("Usage: yarn list-tools --preset <name> --compare <other_name>");
133
+ process.exit(1);
134
+ }
135
+ options.compare = args[++i];
136
+ break;
137
+ case "--help":
138
+ case "-h":
139
+ printHelp();
140
+ process.exit(0);
141
+ break;
142
+ default:
143
+ if (arg.startsWith("-")) {
144
+ console.error(`Error: Unrecognized option '${arg}'.`);
145
+ console.error("Use '--help' to see available options.");
146
+ process.exit(1);
147
+ }
148
+ break;
149
+ }
150
+ }
151
+ return options;
152
+ }
153
+ function printHelp() {
154
+ console.log(`
155
+ GitLab MCP Tool Lister
156
+
157
+ Usage: yarn list-tools [options]
158
+
159
+ Tool Options:
160
+ --json Output in JSON format
161
+ --simple Simple list of tool names
162
+ --export Generate complete API reference documentation
163
+ --env-gates Show USE_* environment variable gates
164
+ --entity <name> Filter by entity (e.g., workitems, labels, mrs)
165
+ --tool <name> Show details for specific tool
166
+ --env Show environment configuration
167
+ --verbose, -v Show additional details
168
+ --detail Show all tools with their input schemas
169
+ --no-examples Skip example JSON blocks (for --export)
170
+ --toc Include table of contents (for --export)
171
+
172
+ Profile/Preset Options:
173
+ --presets List all available presets (built-in and user)
174
+ --profiles List user-defined profiles
175
+ --preset <name> Inspect a specific preset
176
+ --profile <name> Inspect a specific profile
177
+ --validate Validate configuration (use with --preset or --profile)
178
+ --compare <name> Compare two presets (use with --preset)
179
+
180
+ General:
181
+ --help, -h Show this help
182
+
183
+ Examples:
184
+ yarn list-tools # List all tools in markdown
185
+ yarn list-tools --json # JSON output
186
+ yarn list-tools --export # Generate API reference to stdout
187
+ yarn list-tools --export > docs/tools/api-reference.md # Generate to file
188
+ yarn list-tools --export --toc # With table of contents
189
+ yarn list-tools --export --no-examples # Skip example JSON blocks
190
+ yarn list-tools --env-gates # Show USE_* variable gates
191
+ yarn list-tools --env-gates --json # JSON output of gates
192
+ yarn list-tools --entity workitems # Only work items tools
193
+ yarn list-tools --tool list_work_items # Specific tool details
194
+
195
+ Profile/Preset Examples:
196
+ yarn list-tools --presets # List all presets
197
+ yarn list-tools --profiles # List user profiles
198
+ yarn list-tools --preset junior-dev # Inspect preset details
199
+ yarn list-tools --preset junior-dev --validate # Validate preset
200
+ yarn list-tools --preset junior-dev --compare senior-dev # Compare presets
201
+ yarn list-tools --presets --json # JSON output of presets
202
+
203
+ Environment Variables:
204
+ GITLAB_READONLY Show only read-only tools
205
+ GITLAB_DENIED_TOOLS_REGEX Regex pattern to exclude tools
206
+ GITLAB_ALLOWED_TOOLS_REGEX Regex pattern to include tools
207
+ `);
208
+ }
209
+ function resolveJsonSchemaType(prop, schema) {
210
+ if (prop.$ref) {
211
+ const refPath = prop.$ref.replace("#/properties/", "");
212
+ const referencedProp = schema.properties?.[refPath];
213
+ if (referencedProp) {
214
+ return resolveJsonSchemaType(referencedProp, schema);
215
+ }
216
+ return "reference";
217
+ }
218
+ if (prop.type) {
219
+ if (prop.type === "array" && prop.items) {
220
+ const itemType = resolveJsonSchemaType(prop.items, schema);
221
+ return `${itemType}[]`;
222
+ }
223
+ return prop.type;
224
+ }
225
+ if (prop.enum) {
226
+ return "enum";
227
+ }
228
+ if (prop.oneOf ?? prop.anyOf) {
229
+ const unionTypes = (prop.oneOf ?? prop.anyOf)?.map(option => resolveJsonSchemaType(option, schema)) ?? [];
230
+ return unionTypes.join(" | ");
231
+ }
232
+ return "unknown";
233
+ }
234
+ function getParameterDescription(schema) {
235
+ const params = [];
236
+ if (schema.properties) {
237
+ for (const [key, value] of Object.entries(schema.properties)) {
238
+ const prop = value;
239
+ const required = schema.required?.includes(key) ?? false;
240
+ const type = resolveJsonSchemaType(prop, schema);
241
+ const description = prop.description ?? "";
242
+ let paramStr = ` - \`${key}\` (${type}${required ? ", required" : ", optional"})`;
243
+ if (description) {
244
+ paramStr += `: ${description}`;
245
+ }
246
+ params.push(paramStr);
247
+ }
248
+ }
249
+ if (schema._def?.schema?._def?.checks) {
250
+ const checks = schema._def.schema._def.checks;
251
+ for (const check of checks) {
252
+ if (check.message) {
253
+ params.push(` - **Validation**: ${check.message}`);
254
+ }
255
+ }
256
+ }
257
+ return params;
258
+ }
259
+ function printEnvironmentInfo() {
260
+ console.log("=== Environment Configuration ===\n");
261
+ console.log(`GITLAB_READONLY: ${process.env.GITLAB_READONLY ?? "false"}`);
262
+ console.log(`GITLAB_DENIED_TOOLS_REGEX: ${process.env.GITLAB_DENIED_TOOLS_REGEX ?? "(not set)"}`);
263
+ console.log(`GITLAB_ALLOWED_TOOLS_REGEX: ${process.env.GITLAB_ALLOWED_TOOLS_REGEX ?? "(not set)"}`);
264
+ console.log(`GITLAB_API_URL: ${process.env.GITLAB_API_URL ?? "https://gitlab.com"}`);
265
+ console.log();
266
+ }
267
+ function getToolTierInfo(toolName, action) {
268
+ if (action) {
269
+ const requirement = ToolAvailability_1.ToolAvailability.getToolRequirement(toolName, action);
270
+ if (!requirement)
271
+ return "";
272
+ const tierBadge = {
273
+ free: "Free",
274
+ premium: "Premium",
275
+ ultimate: "Ultimate",
276
+ }[requirement.requiredTier] ?? requirement.requiredTier;
277
+ return `[tier: ${tierBadge}]`;
278
+ }
279
+ const highestTier = ToolAvailability_1.ToolAvailability.getHighestTier(toolName);
280
+ const tierBadge = {
281
+ free: "Free",
282
+ premium: "Premium",
283
+ ultimate: "Ultimate",
284
+ }[highestTier] ?? highestTier;
285
+ const toolReq = ToolAvailability_1.ToolAvailability.getActionRequirement(toolName);
286
+ const defaultTier = toolReq?.tier ?? "free";
287
+ const hasMixedTiers = highestTier !== defaultTier;
288
+ if (hasMixedTiers) {
289
+ return `[tier: ${tierBadge}*]`;
290
+ }
291
+ return `[tier: ${tierBadge}]`;
292
+ }
293
+ const ENTITY_TOOLS = {
294
+ "Projects & Repository": [
295
+ "browse_projects",
296
+ "browse_namespaces",
297
+ "browse_commits",
298
+ "browse_events",
299
+ "browse_files",
300
+ "browse_refs",
301
+ "manage_project",
302
+ "manage_namespace",
303
+ "manage_files",
304
+ "manage_ref",
305
+ "browse_releases",
306
+ "manage_release",
307
+ ],
308
+ Collaboration: [
309
+ "browse_merge_requests",
310
+ "browse_mr_discussions",
311
+ "manage_merge_request",
312
+ "manage_mr_discussion",
313
+ "manage_draft_notes",
314
+ "browse_members",
315
+ "manage_member",
316
+ "browse_users",
317
+ "browse_todos",
318
+ "manage_todos",
319
+ ],
320
+ Planning: [
321
+ "browse_work_items",
322
+ "manage_work_item",
323
+ "browse_milestones",
324
+ "manage_milestone",
325
+ "browse_labels",
326
+ "manage_label",
327
+ "browse_iterations",
328
+ ],
329
+ "CI/CD": [
330
+ "browse_pipelines",
331
+ "manage_pipeline",
332
+ "manage_pipeline_job",
333
+ "browse_variables",
334
+ "manage_variable",
335
+ ],
336
+ "Integrations & Content": [
337
+ "browse_wiki",
338
+ "manage_wiki",
339
+ "browse_snippets",
340
+ "manage_snippet",
341
+ "browse_webhooks",
342
+ "manage_webhook",
343
+ "browse_integrations",
344
+ "manage_integration",
345
+ ],
346
+ Discovery: ["browse_search"],
347
+ Session: ["manage_context"],
348
+ };
349
+ function groupToolsByEntity(tools) {
350
+ const grouped = new Map();
351
+ const toolToEntity = new Map();
352
+ for (const [entity, toolNames] of Object.entries(ENTITY_TOOLS)) {
353
+ for (const toolName of toolNames) {
354
+ toolToEntity.set(toolName, entity);
355
+ }
356
+ }
357
+ for (const tool of tools) {
358
+ const entity = toolToEntity.get(tool.name) ?? "Other";
359
+ if (!grouped.has(entity)) {
360
+ grouped.set(entity, []);
361
+ }
362
+ grouped.get(entity).push(tool);
363
+ }
364
+ const entityOrder = [
365
+ "Projects & Repository",
366
+ "Collaboration",
367
+ "Planning",
368
+ "CI/CD",
369
+ "Integrations & Content",
370
+ "Discovery",
371
+ "Session",
372
+ "Other",
373
+ ];
374
+ const sortedGrouped = new Map();
375
+ for (const entity of entityOrder) {
376
+ if (grouped.has(entity)) {
377
+ sortedGrouped.set(entity, grouped.get(entity));
378
+ }
379
+ }
380
+ return sortedGrouped;
381
+ }
382
+ const ACTION_DESCRIPTIONS = {
383
+ list: "List items with filtering and pagination",
384
+ get: "Get a single item by ID",
385
+ create: "Create a new item",
386
+ update: "Update an existing item",
387
+ delete: "Delete an item",
388
+ search: "Search for items",
389
+ diffs: "Get file changes/diffs",
390
+ compare: "Compare two branches or commits",
391
+ merge: "Merge a merge request",
392
+ approve: "Approve a merge request",
393
+ unapprove: "Remove approval from a merge request",
394
+ rebase: "Rebase a merge request",
395
+ cancel: "Cancel a running operation",
396
+ retry: "Retry a failed operation",
397
+ play: "Run a manual job",
398
+ publish: "Publish draft notes",
399
+ drafts: "List draft notes",
400
+ draft: "Get a single draft note",
401
+ resolve: "Resolve a discussion thread",
402
+ unresolve: "Unresolve a discussion thread",
403
+ note: "Add a note/comment",
404
+ mark_done: "Mark as done",
405
+ mark_pending: "Mark as pending",
406
+ disable: "Disable the integration",
407
+ test: "Test a webhook",
408
+ read: "Read item details",
409
+ };
410
+ function extractActions(schema) {
411
+ const actions = [];
412
+ if (schema.oneOf && Array.isArray(schema.oneOf)) {
413
+ for (const branch of schema.oneOf) {
414
+ const actionProp = branch.properties?.action;
415
+ const actionName = actionProp?.const;
416
+ if (actionName) {
417
+ const description = actionProp?.description ??
418
+ ACTION_DESCRIPTIONS[actionName] ??
419
+ `Perform ${actionName} operation`;
420
+ actions.push({ name: actionName, description });
421
+ }
422
+ }
423
+ return actions;
424
+ }
425
+ const actionProp = schema.properties?.action;
426
+ if (actionProp?.enum && Array.isArray(actionProp.enum)) {
427
+ for (const actionName of actionProp.enum) {
428
+ if (typeof actionName === "string") {
429
+ const description = ACTION_DESCRIPTIONS[actionName] ?? `Perform ${actionName} operation`;
430
+ actions.push({ name: actionName, description });
431
+ }
432
+ }
433
+ }
434
+ return actions;
435
+ }
436
+ function extractParameters(schema) {
437
+ if (!schema.properties)
438
+ return [];
439
+ const requiredFields = schema.required ?? [];
440
+ const params = [];
441
+ for (const [name, prop] of Object.entries(schema.properties)) {
442
+ params.push({
443
+ name,
444
+ type: resolveJsonSchemaType(prop, schema),
445
+ required: requiredFields.includes(name),
446
+ description: prop.description ?? "",
447
+ });
448
+ }
449
+ return sortParameters(params);
450
+ }
451
+ function sortParameters(params) {
452
+ return params.sort((a, b) => {
453
+ if (a.required && !b.required)
454
+ return -1;
455
+ if (!a.required && b.required)
456
+ return 1;
457
+ if (a.name === "action")
458
+ return -1;
459
+ if (b.name === "action")
460
+ return 1;
461
+ return a.name.localeCompare(b.name);
462
+ });
463
+ }
464
+ function extractParametersGrouped(schema) {
465
+ const result = {
466
+ common: [],
467
+ byAction: new Map(),
468
+ };
469
+ if (!schema.oneOf || !Array.isArray(schema.oneOf)) {
470
+ result.common = extractParameters(schema);
471
+ return result;
472
+ }
473
+ const totalActions = schema.oneOf.length;
474
+ const paramOccurrences = new Map();
475
+ for (const branch of schema.oneOf) {
476
+ const actionName = branch.properties?.action?.const;
477
+ if (!actionName || !branch.properties)
478
+ continue;
479
+ const requiredFields = branch.required ?? [];
480
+ for (const [name, prop] of Object.entries(branch.properties)) {
481
+ if (name === "action")
482
+ continue;
483
+ const type = resolveJsonSchemaType(prop, branch);
484
+ const required = requiredFields.includes(name);
485
+ const description = prop.description ?? "";
486
+ if (!paramOccurrences.has(name)) {
487
+ paramOccurrences.set(name, {
488
+ actions: new Map(),
489
+ type,
490
+ description,
491
+ });
492
+ }
493
+ const occurrence = paramOccurrences.get(name);
494
+ occurrence.actions.set(actionName, { required, type, description });
495
+ if (description.length > occurrence.description.length) {
496
+ occurrence.description = description;
497
+ }
498
+ }
499
+ }
500
+ for (const [name, data] of paramOccurrences) {
501
+ if (data.actions.size === totalActions) {
502
+ const requiredInAll = Array.from(data.actions.values()).every(a => a.required);
503
+ result.common.push({
504
+ name,
505
+ type: data.type,
506
+ required: requiredInAll,
507
+ description: data.description,
508
+ });
509
+ }
510
+ else {
511
+ for (const [actionName, actionData] of data.actions) {
512
+ if (!result.byAction.has(actionName)) {
513
+ result.byAction.set(actionName, []);
514
+ }
515
+ result.byAction.get(actionName).push({
516
+ name,
517
+ type: actionData.type,
518
+ required: actionData.required,
519
+ requiredForAction: actionData.required,
520
+ description: actionData.description || data.description,
521
+ });
522
+ }
523
+ }
524
+ }
525
+ result.common = sortParameters(result.common);
526
+ for (const [action, params] of result.byAction) {
527
+ result.byAction.set(action, params.sort((a, b) => {
528
+ if (a.requiredForAction && !b.requiredForAction)
529
+ return -1;
530
+ if (!a.requiredForAction && b.requiredForAction)
531
+ return 1;
532
+ return a.name.localeCompare(b.name);
533
+ }));
534
+ }
535
+ return result;
536
+ }
537
+ function generateExample(schema) {
538
+ const example = {};
539
+ const actions = extractActions(schema);
540
+ if (actions.length > 0) {
541
+ example.action = actions[0].name;
542
+ }
543
+ let targetSchema = schema;
544
+ let requiredFields;
545
+ if (schema.oneOf && Array.isArray(schema.oneOf) && schema.oneOf.length > 0) {
546
+ targetSchema = schema.oneOf[0];
547
+ requiredFields = targetSchema.required ?? [];
548
+ }
549
+ else if (schema.properties) {
550
+ requiredFields = schema.required ?? [];
551
+ }
552
+ else {
553
+ return example;
554
+ }
555
+ if (!targetSchema.properties)
556
+ return example;
557
+ for (const [name, prop] of Object.entries(targetSchema.properties)) {
558
+ if (name === "action")
559
+ continue;
560
+ const isRequired = requiredFields.includes(name);
561
+ const description = (prop.description ?? "").toLowerCase();
562
+ if (!isRequired)
563
+ continue;
564
+ if (prop.enum && Array.isArray(prop.enum) && prop.enum.length > 0) {
565
+ example[name] = prop.enum[0];
566
+ }
567
+ else if (name.includes("project_id") || name === "projectId") {
568
+ example[name] = "my-group/my-project";
569
+ }
570
+ else if (name.includes("group_id") || name === "groupId") {
571
+ example[name] = "my-group";
572
+ }
573
+ else if (name.includes("namespace")) {
574
+ example[name] = "my-group/my-project";
575
+ }
576
+ else if (name.includes("_iid") || name === "iid") {
577
+ example[name] = "1";
578
+ }
579
+ else if (name.includes("_id") || name === "id") {
580
+ example[name] = "123";
581
+ }
582
+ else if (name === "title") {
583
+ example[name] = "Example title";
584
+ }
585
+ else if (name === "description") {
586
+ example[name] = "Example description";
587
+ }
588
+ else if (name === "url") {
589
+ example[name] = "https://example.com/webhook";
590
+ }
591
+ else if (name === "content") {
592
+ example[name] = "File content here";
593
+ }
594
+ else if (name === "file_path" || name === "path") {
595
+ example[name] = "path/to/file.txt";
596
+ }
597
+ else if (name === "ref" || name === "branch") {
598
+ example[name] = "main";
599
+ }
600
+ else if (name === "from" || name === "to") {
601
+ example[name] = name === "from" ? "main" : "feature-branch";
602
+ }
603
+ else if (description.includes("boolean") || prop.type === "boolean") {
604
+ example[name] = true;
605
+ }
606
+ else if (prop.type === "number" || prop.type === "integer") {
607
+ example[name] = 10;
608
+ }
609
+ else if (prop.type === "array") {
610
+ example[name] = [];
611
+ }
612
+ else {
613
+ example[name] = `example_${name}`;
614
+ }
615
+ }
616
+ return example;
617
+ }
618
+ function getPackageVersion() {
619
+ try {
620
+ let dir = process.cwd();
621
+ let fallbackVersion = null;
622
+ for (let i = 0; i < 5; i++) {
623
+ const pkgPath = path.join(dir, "package.json");
624
+ if (fs.existsSync(pkgPath)) {
625
+ const content = fs.readFileSync(pkgPath, "utf8");
626
+ const pkg = JSON.parse(content);
627
+ if (fallbackVersion === null && pkg.version) {
628
+ fallbackVersion = pkg.version;
629
+ }
630
+ if (pkg.name === "@structured-world/gitlab-mcp") {
631
+ return pkg.version ?? "unknown";
632
+ }
633
+ }
634
+ const parent = path.dirname(dir);
635
+ if (parent === dir)
636
+ break;
637
+ dir = parent;
638
+ }
639
+ return fallbackVersion ?? "unknown";
640
+ }
641
+ catch {
642
+ return "unknown";
643
+ }
644
+ }
645
+ function generateExportMarkdown(tools, options) {
646
+ const lines = [];
647
+ const version = getPackageVersion();
648
+ const timestamp = new Date().toISOString().split("T")[0];
649
+ lines.push("# GitLab MCP Tools Reference");
650
+ lines.push("");
651
+ lines.push("> Auto-generated from source code. Do not edit manually.");
652
+ lines.push(`> Generated: ${timestamp} | Tools: ${tools.length} | Version: ${version}`);
653
+ lines.push("");
654
+ const grouped = groupToolsByEntity(tools);
655
+ if (options.toc) {
656
+ lines.push("## Table of Contents");
657
+ lines.push("");
658
+ for (const [entity, entityTools] of grouped) {
659
+ const anchor = entity.toLowerCase().replace(/\s+/g, "-");
660
+ lines.push(`- [${entity} (${entityTools.length})](#${anchor})`);
661
+ }
662
+ lines.push("");
663
+ lines.push("---");
664
+ lines.push("");
665
+ }
666
+ for (const [entity, entityTools] of grouped) {
667
+ lines.push(`## ${entity}`);
668
+ lines.push("");
669
+ for (const tool of entityTools) {
670
+ const tierInfo = getToolTierInfo(tool.name);
671
+ const tierDisplay = tierInfo ? ` ${tierInfo}` : "";
672
+ lines.push(`### ${tool.name}${tierDisplay}`);
673
+ lines.push("");
674
+ lines.push(tool.description);
675
+ lines.push("");
676
+ const actions = extractActions(tool.inputSchema);
677
+ if (actions.length > 0) {
678
+ lines.push("#### Actions");
679
+ lines.push("");
680
+ lines.push("| Action | Tier | Description |");
681
+ lines.push("|--------|------|-------------|");
682
+ for (const action of actions) {
683
+ const actionTierInfo = getToolTierInfo(tool.name, action.name);
684
+ const tierDisplay = actionTierInfo.replace("[tier: ", "").replace(/]/g, "") || "Free";
685
+ lines.push(`| \`${action.name}\` | ${tierDisplay} | ${action.description} |`);
686
+ }
687
+ lines.push("");
688
+ }
689
+ const groupedParams = extractParametersGrouped(tool.inputSchema);
690
+ const hasParams = groupedParams.common.length > 0 || groupedParams.byAction.size > 0;
691
+ if (hasParams) {
692
+ lines.push("#### Parameters");
693
+ lines.push("");
694
+ if (groupedParams.common.length > 0) {
695
+ if (groupedParams.byAction.size > 0) {
696
+ lines.push("**Common** (all actions):");
697
+ lines.push("");
698
+ }
699
+ lines.push("| Parameter | Type | Required | Description |");
700
+ lines.push("|-----------|------|----------|-------------|");
701
+ for (const param of groupedParams.common) {
702
+ const req = param.required ? "Yes" : "No";
703
+ const desc = param.description || "-";
704
+ lines.push(`| \`${param.name}\` | ${param.type} | ${req} | ${desc} |`);
705
+ }
706
+ lines.push("");
707
+ }
708
+ if (groupedParams.byAction.size > 0) {
709
+ const sortedActions = Array.from(groupedParams.byAction.keys()).sort();
710
+ for (const actionName of sortedActions) {
711
+ const actionParams = groupedParams.byAction.get(actionName);
712
+ if (actionParams.length === 0)
713
+ continue;
714
+ lines.push(`**Action \`${actionName}\`**:`);
715
+ lines.push("");
716
+ lines.push("| Parameter | Type | Required | Description |");
717
+ lines.push("|-----------|------|----------|-------------|");
718
+ for (const param of actionParams) {
719
+ const req = param.requiredForAction ? "Yes" : "No";
720
+ const desc = param.description || "-";
721
+ lines.push(`| \`${param.name}\` | ${param.type} | ${req} | ${desc} |`);
722
+ }
723
+ lines.push("");
724
+ }
725
+ }
726
+ }
727
+ if (!options.noExamples && tool.inputSchema) {
728
+ const example = generateExample(tool.inputSchema);
729
+ if (Object.keys(example).length > 0) {
730
+ lines.push("#### Example");
731
+ lines.push("");
732
+ lines.push("```json");
733
+ lines.push(JSON.stringify(example, null, 2));
734
+ lines.push("```");
735
+ lines.push("");
736
+ }
737
+ }
738
+ lines.push("---");
739
+ lines.push("");
740
+ }
741
+ }
742
+ return lines.join("\n");
743
+ }
744
+ function extractEnvGates(tools) {
745
+ const gatesMap = new Map();
746
+ for (const tool of tools) {
747
+ if (tool.gate) {
748
+ const existing = gatesMap.get(tool.gate.envVar);
749
+ if (existing) {
750
+ existing.tools.push(tool.name);
751
+ }
752
+ else {
753
+ gatesMap.set(tool.gate.envVar, {
754
+ envVar: tool.gate.envVar,
755
+ defaultValue: tool.gate.defaultValue,
756
+ tools: [tool.name],
757
+ });
758
+ }
759
+ }
760
+ }
761
+ return Array.from(gatesMap.values()).sort((a, b) => a.envVar.localeCompare(b.envVar));
762
+ }
763
+ function getUngatedTools(tools) {
764
+ return tools.filter(tool => !tool.gate).map(tool => tool.name);
765
+ }
766
+ function printEnvGatesMarkdown(gates, ungatedTools, format) {
767
+ if (format === "json") {
768
+ const output = {
769
+ gates: gates.map(g => ({
770
+ envVar: g.envVar,
771
+ defaultValue: g.defaultValue,
772
+ tools: g.tools,
773
+ })),
774
+ ungated: {
775
+ description: "Core tools (always enabled)",
776
+ tools: ungatedTools,
777
+ },
778
+ };
779
+ console.log(JSON.stringify(output, null, 2));
780
+ return;
781
+ }
782
+ console.log("# Environment Variable Gates\n");
783
+ console.log("This table shows which `USE_*` environment variables control which tools.\n");
784
+ console.log("| Variable | Default | Tools Controlled |");
785
+ console.log("|----------|---------|------------------|");
786
+ for (const gate of gates) {
787
+ const defaultStr = gate.defaultValue ? "`true`" : "`false`";
788
+ const toolsStr = gate.tools.map(t => `\`${t}\``).join(", ");
789
+ console.log(`| \`${gate.envVar}\` | ${defaultStr} | ${toolsStr} |`);
790
+ }
791
+ if (ungatedTools.length > 0) {
792
+ const toolsStr = ungatedTools.map(t => `\`${t}\``).join(", ");
793
+ console.log(`| *(none - always on)* | - | ${toolsStr} |`);
794
+ }
795
+ console.log("\n## Usage\n");
796
+ console.log("Set environment variables to `false` to disable tool groups:\n");
797
+ console.log("```bash");
798
+ console.log("# Disable wiki tools");
799
+ console.log("USE_GITLAB_WIKI=false");
800
+ console.log("");
801
+ console.log("# Disable pipeline tools");
802
+ console.log("USE_PIPELINE=false");
803
+ console.log("```");
804
+ }
805
+ const FEATURE_TO_TOOLS = {
806
+ wiki: ["browse_wiki", "manage_wiki"],
807
+ milestones: ["browse_milestones", "manage_milestone"],
808
+ pipelines: ["browse_pipelines", "manage_pipeline", "manage_pipeline_job"],
809
+ labels: ["browse_labels", "manage_label"],
810
+ mrs: [
811
+ "browse_merge_requests",
812
+ "browse_mr_discussions",
813
+ "manage_merge_request",
814
+ "manage_mr_discussion",
815
+ "manage_draft_notes",
816
+ ],
817
+ files: ["browse_files", "manage_files"],
818
+ variables: ["browse_variables", "manage_variable"],
819
+ workitems: ["browse_work_items", "manage_work_item"],
820
+ webhooks: ["browse_webhooks", "manage_webhook"],
821
+ snippets: ["browse_snippets", "manage_snippet"],
822
+ integrations: ["browse_integrations", "manage_integration"],
823
+ iterations: ["browse_iterations"],
824
+ };
825
+ const FEATURE_NAMES = Object.keys(FEATURE_TO_TOOLS);
826
+ function countToolsForPreset(preset, allToolNames) {
827
+ let enabledTools = allToolNames;
828
+ if (preset.read_only) {
829
+ enabledTools = enabledTools.filter(name => !name.startsWith("manage_"));
830
+ }
831
+ if (preset.denied_tools_regex) {
832
+ try {
833
+ const regex = new RegExp(preset.denied_tools_regex);
834
+ enabledTools = enabledTools.filter(name => !regex.test(name));
835
+ }
836
+ catch (error) {
837
+ console.warn(`Warning: invalid denied_tools_regex "${preset.denied_tools_regex}": ${error instanceof Error ? error.message : "unknown error"}`);
838
+ }
839
+ }
840
+ if (preset.allowed_tools && preset.allowed_tools.length > 0) {
841
+ const allowedSet = new Set(preset.allowed_tools);
842
+ enabledTools = enabledTools.filter(name => allowedSet.has(name));
843
+ }
844
+ if (preset.features) {
845
+ for (const [feature, tools] of Object.entries(FEATURE_TO_TOOLS)) {
846
+ const featureKey = feature;
847
+ if (preset.features[featureKey] === false) {
848
+ const toolSet = new Set(tools);
849
+ enabledTools = enabledTools.filter(name => !toolSet.has(name));
850
+ }
851
+ }
852
+ }
853
+ return enabledTools.length;
854
+ }
855
+ function getToolsForPreset(preset, allToolNames) {
856
+ let enabledTools = [...allToolNames];
857
+ const disabledTools = [];
858
+ if (preset.read_only) {
859
+ const manageTools = enabledTools.filter(name => name.startsWith("manage_"));
860
+ disabledTools.push(...manageTools);
861
+ enabledTools = enabledTools.filter(name => !name.startsWith("manage_"));
862
+ }
863
+ if (preset.denied_tools_regex) {
864
+ try {
865
+ const regex = new RegExp(preset.denied_tools_regex);
866
+ const denied = enabledTools.filter(name => regex.test(name));
867
+ disabledTools.push(...denied);
868
+ enabledTools = enabledTools.filter(name => !regex.test(name));
869
+ }
870
+ catch (error) {
871
+ console.warn(`Warning: invalid denied_tools_regex "${preset.denied_tools_regex}": ${error instanceof Error ? error.message : "unknown error"}`);
872
+ }
873
+ }
874
+ if (preset.allowed_tools && preset.allowed_tools.length > 0) {
875
+ const allowedSet = new Set(preset.allowed_tools);
876
+ const notAllowed = enabledTools.filter(name => !allowedSet.has(name));
877
+ disabledTools.push(...notAllowed);
878
+ enabledTools = enabledTools.filter(name => allowedSet.has(name));
879
+ }
880
+ if (preset.features) {
881
+ for (const [feature, tools] of Object.entries(FEATURE_TO_TOOLS)) {
882
+ const featureKey = feature;
883
+ if (preset.features[featureKey] === false) {
884
+ const toolSet = new Set(tools);
885
+ const disabled = enabledTools.filter(name => toolSet.has(name));
886
+ disabledTools.push(...disabled);
887
+ enabledTools = enabledTools.filter(name => !toolSet.has(name));
888
+ }
889
+ }
890
+ }
891
+ return {
892
+ enabled: enabledTools.sort(),
893
+ disabled: [...new Set(disabledTools)].sort(),
894
+ };
895
+ }
896
+ async function printPresetsList(loader, allToolNames, format) {
897
+ const profiles = await loader.listProfiles();
898
+ const presets = profiles.filter(p => p.isPreset);
899
+ const userProfiles = profiles.filter(p => !p.isPreset);
900
+ if (format === "json") {
901
+ const output = {
902
+ builtIn: await Promise.all(presets.map(async (p) => {
903
+ const preset = await loader.loadPreset(p.name);
904
+ return {
905
+ name: p.name,
906
+ description: p.description ?? "",
907
+ readOnly: p.readOnly,
908
+ toolCount: countToolsForPreset(preset, allToolNames),
909
+ };
910
+ })),
911
+ userPresets: userProfiles.length,
912
+ totalTools: allToolNames.length,
913
+ };
914
+ console.log(JSON.stringify(output, null, 2));
915
+ return;
916
+ }
917
+ console.log("# Available Presets\n");
918
+ console.log(`Total tools available: ${allToolNames.length}\n`);
919
+ console.log("## Built-in Presets\n");
920
+ console.log("| Preset | Tools | Read-Only | Description |");
921
+ console.log("|--------|-------|-----------|-------------|");
922
+ for (const p of presets) {
923
+ const preset = await loader.loadPreset(p.name);
924
+ const toolCount = countToolsForPreset(preset, allToolNames);
925
+ const ro = p.readOnly ? "Yes" : "No";
926
+ const desc = p.description ?? "-";
927
+ console.log(`| \`${p.name}\` | ${toolCount} | ${ro} | ${desc} |`);
928
+ }
929
+ if (userProfiles.length > 0) {
930
+ console.log("\n## User Profiles\n");
931
+ console.log(`${userProfiles.length} user profile(s) defined. Use \`--profiles\` to list them.`);
932
+ }
933
+ console.log("\nUse `yarn list-tools --preset <name>` for details.");
934
+ }
935
+ async function printProfilesList(loader, format) {
936
+ const profiles = await loader.listProfiles();
937
+ const userProfiles = profiles.filter(p => !p.isPreset);
938
+ if (format === "json") {
939
+ const output = userProfiles.map(p => ({
940
+ name: p.name,
941
+ host: p.host,
942
+ authType: p.authType,
943
+ readOnly: p.readOnly,
944
+ }));
945
+ console.log(JSON.stringify(output, null, 2));
946
+ return;
947
+ }
948
+ console.log("# User Profiles\n");
949
+ if (userProfiles.length === 0) {
950
+ console.log("No user profiles defined.\n");
951
+ console.log("Create profiles in: `~/.config/gitlab-mcp/profiles.yaml`\n");
952
+ console.log("Example:\n");
953
+ console.log("```yaml");
954
+ console.log("profiles:");
955
+ console.log(" work:");
956
+ console.log(" host: gitlab.company.com");
957
+ console.log(" auth:");
958
+ console.log(" type: pat");
959
+ console.log(" token_env: GITLAB_WORK_TOKEN");
960
+ console.log("```");
961
+ return;
962
+ }
963
+ console.log("| Profile | Host | Auth | Read-Only |");
964
+ console.log("|---------|------|------|-----------|");
965
+ for (const p of userProfiles) {
966
+ const ro = p.readOnly ? "Yes" : "No";
967
+ console.log(`| \`${p.name}\` | ${p.host ?? "-"} | ${p.authType ?? "-"} | ${ro} |`);
968
+ }
969
+ console.log("\nUse `yarn list-tools --profile <name>` for details.");
970
+ }
971
+ async function printPresetDetails(loader, presetName, allToolNames, format, validate) {
972
+ let preset;
973
+ try {
974
+ preset = await loader.loadPreset(presetName);
975
+ }
976
+ catch {
977
+ console.error(`Error: Preset '${presetName}' not found`);
978
+ process.exit(1);
979
+ return;
980
+ }
981
+ const { enabled, disabled } = getToolsForPreset(preset, allToolNames);
982
+ if (format === "json") {
983
+ const output = {
984
+ name: presetName,
985
+ type: "builtin",
986
+ description: preset.description ?? null,
987
+ readOnly: preset.read_only ?? false,
988
+ toolsEnabled: enabled.length,
989
+ toolsDisabled: disabled.length,
990
+ features: preset.features ?? {},
991
+ deniedToolsRegex: preset.denied_tools_regex ?? null,
992
+ allowedTools: preset.allowed_tools ?? null,
993
+ deniedActions: preset.denied_actions ?? null,
994
+ enabledTools: enabled,
995
+ disabledTools: disabled,
996
+ };
997
+ if (validate) {
998
+ const validation = await loader.validatePreset(preset);
999
+ output.validation = validation;
1000
+ }
1001
+ console.log(JSON.stringify(output, null, 2));
1002
+ return;
1003
+ }
1004
+ console.log(`# Preset: ${presetName}\n`);
1005
+ console.log(`**Type:** Built-in`);
1006
+ console.log(`**Description:** ${preset.description ?? "-"}`);
1007
+ console.log(`**Tools Enabled:** ${enabled.length} (of ${allToolNames.length} available)`);
1008
+ console.log(`**Read-Only:** ${preset.read_only ? "Yes" : "No"}\n`);
1009
+ if (preset.features) {
1010
+ console.log("## Features\n");
1011
+ console.log("| Feature | Status |");
1012
+ console.log("|---------|--------|");
1013
+ for (const f of FEATURE_NAMES) {
1014
+ const featureKey = f;
1015
+ const status = preset.features[featureKey] === true
1016
+ ? "Enabled"
1017
+ : preset.features[featureKey] === false
1018
+ ? "Disabled"
1019
+ : "-";
1020
+ console.log(`| ${f} | ${status} |`);
1021
+ }
1022
+ console.log();
1023
+ }
1024
+ console.log("## Tool Restrictions\n");
1025
+ if (preset.denied_tools_regex) {
1026
+ console.log(`**Denied tools regex:** \`${preset.denied_tools_regex}\`\n`);
1027
+ }
1028
+ if (preset.allowed_tools && preset.allowed_tools.length > 0) {
1029
+ console.log(`**Allowed tools (whitelist):** ${preset.allowed_tools.length} tools\n`);
1030
+ }
1031
+ if (preset.denied_actions && preset.denied_actions.length > 0) {
1032
+ console.log(`**Denied actions:** ${preset.denied_actions.join(", ")}\n`);
1033
+ }
1034
+ if (!preset.denied_tools_regex &&
1035
+ !preset.allowed_tools?.length &&
1036
+ !preset.denied_actions?.length) {
1037
+ console.log("No explicit tool restrictions.\n");
1038
+ }
1039
+ console.log("## Enabled Tools\n");
1040
+ for (const tool of enabled) {
1041
+ console.log(`- ${tool}`);
1042
+ }
1043
+ console.log();
1044
+ if (disabled.length > 0) {
1045
+ console.log("## Disabled Tools\n");
1046
+ for (const tool of disabled) {
1047
+ console.log(`- ${tool}`);
1048
+ }
1049
+ console.log();
1050
+ }
1051
+ if (validate) {
1052
+ console.log("## Validation\n");
1053
+ const validation = await loader.validatePreset(preset);
1054
+ if (validation.valid && validation.warnings.length === 0) {
1055
+ console.log("**Status: VALID**\n");
1056
+ }
1057
+ else if (validation.valid) {
1058
+ console.log(`**Status: VALID** (${validation.warnings.length} warning(s))\n`);
1059
+ console.log("### Warnings\n");
1060
+ for (const w of validation.warnings) {
1061
+ console.log(`- ${w}`);
1062
+ }
1063
+ }
1064
+ else {
1065
+ console.log(`**Status: INVALID** (${validation.errors.length} error(s))\n`);
1066
+ console.log("### Errors\n");
1067
+ for (const e of validation.errors) {
1068
+ console.log(`- ${e}`);
1069
+ }
1070
+ if (validation.warnings.length > 0) {
1071
+ console.log("\n### Warnings\n");
1072
+ for (const w of validation.warnings) {
1073
+ console.log(`- ${w}`);
1074
+ }
1075
+ }
1076
+ }
1077
+ }
1078
+ }
1079
+ async function printProfileDetails(loader, profileName, format, validate) {
1080
+ let profile;
1081
+ try {
1082
+ profile = await loader.loadProfile(profileName);
1083
+ }
1084
+ catch {
1085
+ console.error(`Error: Profile '${profileName}' not found`);
1086
+ process.exit(1);
1087
+ return;
1088
+ }
1089
+ if (format === "json") {
1090
+ const output = {
1091
+ name: profileName,
1092
+ type: "user",
1093
+ host: profile.host,
1094
+ authType: profile.auth.type,
1095
+ readOnly: profile.read_only ?? false,
1096
+ features: profile.features ?? {},
1097
+ deniedToolsRegex: profile.denied_tools_regex ?? null,
1098
+ allowedTools: profile.allowed_tools ?? null,
1099
+ deniedActions: profile.denied_actions ?? null,
1100
+ allowedProjects: profile.allowed_projects ?? null,
1101
+ allowedGroups: profile.allowed_groups ?? null,
1102
+ defaultProject: profile.default_project ?? null,
1103
+ defaultNamespace: profile.default_namespace ?? null,
1104
+ timeoutMs: profile.timeout_ms ?? null,
1105
+ skipTlsVerify: profile.skip_tls_verify ?? false,
1106
+ };
1107
+ if (validate) {
1108
+ const validation = await loader.validateProfile(profile);
1109
+ output.validation = validation;
1110
+ }
1111
+ console.log(JSON.stringify(output, null, 2));
1112
+ return;
1113
+ }
1114
+ console.log(`# Profile: ${profileName}\n`);
1115
+ console.log(`**Type:** User-defined`);
1116
+ console.log(`**Host:** ${profile.host}`);
1117
+ console.log(`**Auth:** ${profile.auth.type}`);
1118
+ console.log(`**Read-Only:** ${profile.read_only ? "Yes" : "No"}\n`);
1119
+ console.log("## Settings\n");
1120
+ console.log("| Setting | Value |");
1121
+ console.log("|---------|-------|");
1122
+ console.log(`| Timeout | ${profile.timeout_ms ?? "default"}ms |`);
1123
+ console.log(`| TLS Verify | ${profile.skip_tls_verify ? "No" : "Yes"} |`);
1124
+ if (profile.default_project) {
1125
+ console.log(`| Default Project | ${profile.default_project} |`);
1126
+ }
1127
+ if (profile.default_namespace) {
1128
+ console.log(`| Default Namespace | ${profile.default_namespace} |`);
1129
+ }
1130
+ console.log();
1131
+ if (profile.allowed_projects?.length || profile.allowed_groups?.length) {
1132
+ console.log("## Access Restrictions\n");
1133
+ if (profile.allowed_projects?.length) {
1134
+ console.log(`**Allowed Projects:** ${profile.allowed_projects.join(", ")}\n`);
1135
+ }
1136
+ if (profile.allowed_groups?.length) {
1137
+ console.log(`**Allowed Groups:** ${profile.allowed_groups.join(", ")}\n`);
1138
+ }
1139
+ }
1140
+ if (profile.denied_tools_regex ||
1141
+ profile.allowed_tools?.length ||
1142
+ profile.denied_actions?.length) {
1143
+ console.log("## Tool Restrictions\n");
1144
+ if (profile.denied_tools_regex) {
1145
+ console.log(`**Denied tools regex:** \`${profile.denied_tools_regex}\`\n`);
1146
+ }
1147
+ if (profile.allowed_tools?.length) {
1148
+ console.log(`**Allowed tools (whitelist):** ${profile.allowed_tools.length} tools\n`);
1149
+ }
1150
+ if (profile.denied_actions?.length) {
1151
+ console.log(`**Denied actions:** ${profile.denied_actions.join(", ")}\n`);
1152
+ }
1153
+ }
1154
+ if (validate) {
1155
+ console.log("## Validation\n");
1156
+ const validation = await loader.validateProfile(profile);
1157
+ if (validation.valid && validation.warnings.length === 0) {
1158
+ console.log("**Status: VALID**\n");
1159
+ }
1160
+ else if (validation.valid) {
1161
+ console.log(`**Status: VALID** (${validation.warnings.length} warning(s))\n`);
1162
+ console.log("### Warnings\n");
1163
+ for (const w of validation.warnings) {
1164
+ console.log(`- ${w}`);
1165
+ }
1166
+ }
1167
+ else {
1168
+ console.log(`**Status: INVALID** (${validation.errors.length} error(s))\n`);
1169
+ console.log("### Errors\n");
1170
+ for (const e of validation.errors) {
1171
+ console.log(`- ${e}`);
1172
+ }
1173
+ }
1174
+ }
1175
+ }
1176
+ async function comparePresets(loader, presetA, presetB, allToolNames, format) {
1177
+ let a, b;
1178
+ try {
1179
+ a = await loader.loadPreset(presetA);
1180
+ }
1181
+ catch {
1182
+ console.error(`Error: Preset '${presetA}' not found`);
1183
+ process.exit(1);
1184
+ return;
1185
+ }
1186
+ try {
1187
+ b = await loader.loadPreset(presetB);
1188
+ }
1189
+ catch {
1190
+ console.error(`Error: Preset '${presetB}' not found`);
1191
+ process.exit(1);
1192
+ return;
1193
+ }
1194
+ const toolsA = getToolsForPreset(a, allToolNames);
1195
+ const toolsB = getToolsForPreset(b, allToolNames);
1196
+ const enabledSetA = new Set(toolsA.enabled);
1197
+ const enabledSetB = new Set(toolsB.enabled);
1198
+ const onlyInA = toolsA.enabled.filter(t => !enabledSetB.has(t));
1199
+ const onlyInB = toolsB.enabled.filter(t => !enabledSetA.has(t));
1200
+ const common = toolsA.enabled.filter(t => enabledSetB.has(t));
1201
+ if (format === "json") {
1202
+ const output = {
1203
+ presetA: {
1204
+ name: presetA,
1205
+ description: a.description ?? null,
1206
+ toolCount: toolsA.enabled.length,
1207
+ readOnly: a.read_only ?? false,
1208
+ },
1209
+ presetB: {
1210
+ name: presetB,
1211
+ description: b.description ?? null,
1212
+ toolCount: toolsB.enabled.length,
1213
+ readOnly: b.read_only ?? false,
1214
+ },
1215
+ comparison: {
1216
+ commonTools: common.length,
1217
+ onlyInA: onlyInA.length,
1218
+ onlyInB: onlyInB.length,
1219
+ onlyInAList: onlyInA,
1220
+ onlyInBList: onlyInB,
1221
+ },
1222
+ };
1223
+ console.log(JSON.stringify(output, null, 2));
1224
+ return;
1225
+ }
1226
+ console.log(`# Comparison: ${presetA} vs ${presetB}\n`);
1227
+ console.log("## Summary\n");
1228
+ console.log("| | " + presetA + " | " + presetB + " |");
1229
+ console.log("|---|---|---|");
1230
+ console.log(`| Tools | ${toolsA.enabled.length} | ${toolsB.enabled.length} |`);
1231
+ console.log(`| Read-Only | ${a.read_only ? "Yes" : "No"} | ${b.read_only ? "Yes" : "No"} |`);
1232
+ console.log();
1233
+ console.log(`**Common tools:** ${common.length}\n`);
1234
+ if (onlyInA.length > 0) {
1235
+ console.log(`## Only in ${presetA} (${onlyInA.length})\n`);
1236
+ for (const t of onlyInA) {
1237
+ console.log(`- ${t}`);
1238
+ }
1239
+ console.log();
1240
+ }
1241
+ if (onlyInB.length > 0) {
1242
+ console.log(`## Only in ${presetB} (${onlyInB.length})\n`);
1243
+ for (const t of onlyInB) {
1244
+ console.log(`- ${t}`);
1245
+ }
1246
+ console.log();
1247
+ }
1248
+ if (a.features || b.features) {
1249
+ console.log("## Feature Comparison\n");
1250
+ console.log("| Feature | " + presetA + " | " + presetB + " |");
1251
+ console.log("|---------|---|---|");
1252
+ for (const f of FEATURE_NAMES) {
1253
+ const featureKey = f;
1254
+ const statusA = a.features?.[featureKey] === true ? "Yes" : a.features?.[featureKey] === false ? "No" : "-";
1255
+ const statusB = b.features?.[featureKey] === true ? "Yes" : b.features?.[featureKey] === false ? "No" : "-";
1256
+ if (statusA !== statusB) {
1257
+ console.log(`| **${f}** | ${statusA} | ${statusB} |`);
1258
+ }
1259
+ else {
1260
+ console.log(`| ${f} | ${statusA} | ${statusB} |`);
1261
+ }
1262
+ }
1263
+ }
1264
+ }
1265
+ async function main() {
1266
+ const options = parseArgs();
1267
+ if (options.compare && !options.preset) {
1268
+ console.error("Error: --compare flag must be used with --preset.");
1269
+ console.error("Usage: yarn list-tools --preset <name> --compare <other_name>");
1270
+ process.exit(1);
1271
+ return;
1272
+ }
1273
+ if (options.validate && !options.preset && !options.profile) {
1274
+ console.error("Error: --validate flag must be used with --preset or --profile.");
1275
+ console.error("Usage: yarn list-tools --preset <name> --validate");
1276
+ console.error(" or: yarn list-tools --profile <name> --validate");
1277
+ process.exit(1);
1278
+ return;
1279
+ }
1280
+ if (options.showEnv) {
1281
+ printEnvironmentInfo();
1282
+ }
1283
+ const registryManager = registry_manager_1.RegistryManager.getInstance();
1284
+ if (options.showEnvGates) {
1285
+ const allTools = registryManager.getAllToolDefinitionsUnfiltered();
1286
+ const gates = extractEnvGates(allTools);
1287
+ const ungated = getUngatedTools(allTools);
1288
+ printEnvGatesMarkdown(gates, ungated, options.format === "json" ? "json" : "markdown");
1289
+ return;
1290
+ }
1291
+ const needsProfileLoader = Boolean(options.showPresets) ||
1292
+ Boolean(options.showProfiles) ||
1293
+ Boolean(options.preset) ||
1294
+ Boolean(options.profile);
1295
+ if (needsProfileLoader) {
1296
+ const loader = new profiles_1.ProfileLoader();
1297
+ const allToolNames = registryManager.getAllToolDefinitionsUnfiltered().map(t => t.name);
1298
+ if (options.showPresets) {
1299
+ await printPresetsList(loader, allToolNames, options.format === "json" ? "json" : "markdown");
1300
+ return;
1301
+ }
1302
+ if (options.showProfiles) {
1303
+ await printProfilesList(loader, options.format === "json" ? "json" : "markdown");
1304
+ return;
1305
+ }
1306
+ if (options.preset && options.compare) {
1307
+ await comparePresets(loader, options.preset, options.compare, allToolNames, options.format === "json" ? "json" : "markdown");
1308
+ return;
1309
+ }
1310
+ if (options.preset) {
1311
+ await printPresetDetails(loader, options.preset, allToolNames, options.format === "json" ? "json" : "markdown", options.validate ?? false);
1312
+ return;
1313
+ }
1314
+ if (options.profile) {
1315
+ await printProfileDetails(loader, options.profile, options.format === "json" ? "json" : "markdown", options.validate ?? false);
1316
+ return;
1317
+ }
1318
+ }
1319
+ const toolDefinitions = options.format === "export"
1320
+ ? registryManager.getAllToolDefinitionsUnfiltered()
1321
+ : registryManager.getAllToolDefinitionsTierless();
1322
+ const tools = toolDefinitions.map(def => ({
1323
+ name: def.name,
1324
+ description: def.description,
1325
+ inputSchema: def.inputSchema,
1326
+ }));
1327
+ let filteredTools = tools;
1328
+ if (options.entity) {
1329
+ const grouped = groupToolsByEntity(tools);
1330
+ const entityKey = Array.from(grouped.keys()).find(k => k.toLowerCase().replace(/ /g, "") === options.entity.toLowerCase().replace(/ /g, ""));
1331
+ filteredTools = entityKey ? (grouped.get(entityKey) ?? []) : [];
1332
+ if (filteredTools.length === 0) {
1333
+ console.error(`No tools found for entity: ${options.entity}`);
1334
+ process.exit(1);
1335
+ }
1336
+ }
1337
+ if (options.tool) {
1338
+ filteredTools = filteredTools.filter(t => t.name === options.tool);
1339
+ if (filteredTools.length === 0) {
1340
+ console.error(`Tool not found: ${options.tool}`);
1341
+ process.exit(1);
1342
+ }
1343
+ }
1344
+ switch (options.format) {
1345
+ case "json":
1346
+ const output = filteredTools.map(tool => ({
1347
+ name: tool.name,
1348
+ description: tool.description,
1349
+ tier: ToolAvailability_1.ToolAvailability.getToolRequirement(tool.name)?.requiredTier ?? "unknown",
1350
+ minVersion: ToolAvailability_1.ToolAvailability.getToolRequirement(tool.name)?.minVersion,
1351
+ parameters: tool.inputSchema,
1352
+ }));
1353
+ console.log(JSON.stringify(output, null, 2));
1354
+ break;
1355
+ case "simple":
1356
+ filteredTools.forEach(tool => {
1357
+ console.log(tool.name);
1358
+ });
1359
+ break;
1360
+ case "export":
1361
+ const markdown = generateExportMarkdown(filteredTools, {
1362
+ noExamples: options.noExamples,
1363
+ toc: options.toc,
1364
+ });
1365
+ console.log(markdown);
1366
+ break;
1367
+ case "markdown":
1368
+ default:
1369
+ if (!options.entity && !options.tool) {
1370
+ console.log("# GitLab MCP Tools\n");
1371
+ console.log(`Total tools available: ${filteredTools.length}\n`);
1372
+ const grouped = groupToolsByEntity(filteredTools);
1373
+ console.log("## Categories\n");
1374
+ for (const [entity, entityTools] of grouped) {
1375
+ console.log(`- **${entity}**: ${entityTools.length} tools`);
1376
+ }
1377
+ console.log();
1378
+ for (const [entity, entityTools] of grouped) {
1379
+ console.log(`## ${entity}\n`);
1380
+ for (const tool of entityTools) {
1381
+ const tierInfo = getToolTierInfo(tool.name);
1382
+ const tierDisplay = tierInfo ? ` ${tierInfo}` : "";
1383
+ console.log(`### ${tool.name}${tierDisplay}`);
1384
+ console.log(`**Description**: ${tool.description}\n`);
1385
+ if ((options.verbose || options.detail) && tool.inputSchema) {
1386
+ console.log("**Parameters**:");
1387
+ const params = getParameterDescription(tool.inputSchema);
1388
+ if (params.length > 0) {
1389
+ params.forEach(p => console.log(p));
1390
+ }
1391
+ else {
1392
+ console.log(" (no parameters)");
1393
+ }
1394
+ console.log();
1395
+ }
1396
+ }
1397
+ }
1398
+ }
1399
+ else {
1400
+ for (const tool of filteredTools) {
1401
+ const tierInfo = getToolTierInfo(tool.name);
1402
+ const tierDisplay = tierInfo ? ` ${tierInfo}` : "";
1403
+ console.log(`## ${tool.name}${tierDisplay}\n`);
1404
+ console.log(`**Description**: ${tool.description}\n`);
1405
+ if (tool.inputSchema) {
1406
+ console.log("**Parameters**:\n");
1407
+ const params = getParameterDescription(tool.inputSchema);
1408
+ if (params.length > 0) {
1409
+ params.forEach(p => console.log(p));
1410
+ }
1411
+ else {
1412
+ console.log("(no parameters)");
1413
+ }
1414
+ }
1415
+ console.log();
1416
+ }
1417
+ }
1418
+ break;
1419
+ }
1420
+ if (options.showEnv && options.format === "markdown") {
1421
+ console.log("\n---\n");
1422
+ console.log("*Note: Tool availability may be affected by environment variables shown above.*");
1423
+ }
1424
+ }
1425
+ if (!process.env.NODE_ENV || process.env.NODE_ENV !== "test") {
1426
+ main().catch(error => {
1427
+ console.error("Error:", error);
1428
+ process.exit(1);
1429
+ });
1430
+ }
1431
+ //# sourceMappingURL=list-tools.js.map