@structured-world/gitlab-mcp 5.7.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/README.md +251 -1
  2. package/dist/generated/prisma/client.d.ts +13 -0
  3. package/dist/generated/prisma/client.js +46 -0
  4. package/dist/generated/prisma/client.js.map +1 -0
  5. package/dist/generated/prisma/commonInputTypes.d.ts +245 -0
  6. package/dist/generated/prisma/commonInputTypes.js +3 -0
  7. package/dist/generated/prisma/commonInputTypes.js.map +1 -0
  8. package/dist/generated/prisma/enums.d.ts +1 -0
  9. package/dist/generated/prisma/enums.js +3 -0
  10. package/dist/generated/prisma/enums.js.map +1 -0
  11. package/dist/generated/prisma/internal/class.d.ts +47 -0
  12. package/dist/generated/prisma/internal/class.js +66 -0
  13. package/dist/generated/prisma/internal/class.js.map +1 -0
  14. package/dist/generated/prisma/internal/prismaNamespace.d.ts +712 -0
  15. package/dist/generated/prisma/internal/prismaNamespace.js +139 -0
  16. package/dist/generated/prisma/internal/prismaNamespace.js.map +1 -0
  17. package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +513 -0
  18. package/dist/generated/prisma/models/AuthCodeFlowState.js +3 -0
  19. package/dist/generated/prisma/models/AuthCodeFlowState.js.map +1 -0
  20. package/dist/generated/prisma/models/AuthorizationCode.d.ts +641 -0
  21. package/dist/generated/prisma/models/AuthorizationCode.js +3 -0
  22. package/dist/generated/prisma/models/AuthorizationCode.js.map +1 -0
  23. package/dist/generated/prisma/models/DeviceFlowState.d.ts +606 -0
  24. package/dist/generated/prisma/models/DeviceFlowState.js +3 -0
  25. package/dist/generated/prisma/models/DeviceFlowState.js.map +1 -0
  26. package/dist/generated/prisma/models/McpSessionMapping.d.ts +438 -0
  27. package/dist/generated/prisma/models/McpSessionMapping.js +3 -0
  28. package/dist/generated/prisma/models/McpSessionMapping.js.map +1 -0
  29. package/dist/generated/prisma/models/OAuthSession.d.ts +962 -0
  30. package/dist/generated/prisma/models/OAuthSession.js +3 -0
  31. package/dist/generated/prisma/models/OAuthSession.js.map +1 -0
  32. package/dist/generated/prisma/models.d.ts +6 -0
  33. package/dist/generated/prisma/models.js +3 -0
  34. package/dist/generated/prisma/models.js.map +1 -0
  35. package/dist/{config.d.ts → src/config.d.ts} +11 -0
  36. package/dist/{config.js → src/config.js} +12 -1
  37. package/dist/src/config.js.map +1 -0
  38. package/dist/src/entities/core/index.js.map +1 -0
  39. package/dist/src/entities/core/registry.js +745 -0
  40. package/dist/src/entities/core/registry.js.map +1 -0
  41. package/dist/src/entities/core/schema-readonly.d.ts +290 -0
  42. package/dist/src/entities/core/schema-readonly.js +296 -0
  43. package/dist/src/entities/core/schema-readonly.js.map +1 -0
  44. package/dist/src/entities/core/schema.d.ts +71 -0
  45. package/dist/src/entities/core/schema.js +93 -0
  46. package/dist/src/entities/core/schema.js.map +1 -0
  47. package/dist/src/entities/files/index.js.map +1 -0
  48. package/dist/src/entities/files/registry.js +165 -0
  49. package/dist/src/entities/files/registry.js.map +1 -0
  50. package/dist/src/entities/files/schema-readonly.d.ts +93 -0
  51. package/dist/{entities → src/entities}/files/schema-readonly.js +20 -1
  52. package/dist/src/entities/files/schema-readonly.js.map +1 -0
  53. package/dist/src/entities/files/schema.d.ts +82 -0
  54. package/dist/src/entities/files/schema.js +79 -0
  55. package/dist/src/entities/files/schema.js.map +1 -0
  56. package/dist/src/entities/index.js.map +1 -0
  57. package/dist/src/entities/labels/index.js.map +1 -0
  58. package/dist/src/entities/labels/registry.js +139 -0
  59. package/dist/src/entities/labels/registry.js.map +1 -0
  60. package/dist/src/entities/labels/schema-readonly.d.ts +14 -0
  61. package/dist/src/entities/labels/schema-readonly.js.map +1 -0
  62. package/dist/src/entities/labels/schema.d.ts +23 -0
  63. package/dist/src/entities/labels/schema.js.map +1 -0
  64. package/dist/src/entities/milestones/index.js.map +1 -0
  65. package/dist/src/entities/milestones/registry.js +197 -0
  66. package/dist/src/entities/milestones/registry.js.map +1 -0
  67. package/dist/src/entities/milestones/schema-readonly.d.ts +58 -0
  68. package/dist/src/entities/milestones/schema-readonly.js.map +1 -0
  69. package/dist/src/entities/milestones/schema.d.ts +32 -0
  70. package/dist/src/entities/milestones/schema.js.map +1 -0
  71. package/dist/src/entities/mrs/index.js.map +1 -0
  72. package/dist/{entities → src/entities}/mrs/registry.js +64 -81
  73. package/dist/src/entities/mrs/registry.js.map +1 -0
  74. package/dist/src/entities/mrs/schema-readonly.d.ts +127 -0
  75. package/dist/src/entities/mrs/schema-readonly.js.map +1 -0
  76. package/dist/src/entities/mrs/schema.d.ts +285 -0
  77. package/dist/src/entities/mrs/schema.js.map +1 -0
  78. package/dist/src/entities/pipelines/index.js.map +1 -0
  79. package/dist/{entities → src/entities}/pipelines/registry.js +72 -200
  80. package/dist/src/entities/pipelines/registry.js.map +1 -0
  81. package/dist/src/entities/pipelines/schema-readonly.d.ts +238 -0
  82. package/dist/src/entities/pipelines/schema-readonly.js.map +1 -0
  83. package/dist/src/entities/pipelines/schema.d.ts +49 -0
  84. package/dist/src/entities/pipelines/schema.js.map +1 -0
  85. package/dist/src/entities/shared.d.ts +291 -0
  86. package/dist/src/entities/shared.js.map +1 -0
  87. package/dist/src/entities/utils.d.ts +3 -0
  88. package/dist/src/entities/utils.js.map +1 -0
  89. package/dist/src/entities/variables/index.js.map +1 -0
  90. package/dist/src/entities/variables/registry.js +153 -0
  91. package/dist/src/entities/variables/registry.js.map +1 -0
  92. package/dist/src/entities/variables/schema-readonly.d.ts +15 -0
  93. package/dist/src/entities/variables/schema-readonly.js.map +1 -0
  94. package/dist/src/entities/variables/schema.d.ts +42 -0
  95. package/dist/src/entities/variables/schema.js.map +1 -0
  96. package/dist/src/entities/wiki/index.js.map +1 -0
  97. package/dist/src/entities/wiki/registry.js +136 -0
  98. package/dist/src/entities/wiki/registry.js.map +1 -0
  99. package/dist/src/entities/wiki/schema-readonly.d.ts +22 -0
  100. package/dist/src/entities/wiki/schema-readonly.js.map +1 -0
  101. package/dist/{entities → src/entities}/wiki/schema.d.ts +3 -31
  102. package/dist/src/entities/wiki/schema.js.map +1 -0
  103. package/dist/src/entities/workitems/index.js.map +1 -0
  104. package/dist/{entities → src/entities}/workitems/registry.js +40 -7
  105. package/dist/src/entities/workitems/registry.js.map +1 -0
  106. package/dist/src/entities/workitems/schema-readonly.d.ts +52 -0
  107. package/dist/{entities → src/entities}/workitems/schema-readonly.js +1 -1
  108. package/dist/src/entities/workitems/schema-readonly.js.map +1 -0
  109. package/dist/src/entities/workitems/schema.d.ts +37 -0
  110. package/dist/src/entities/workitems/schema.js.map +1 -0
  111. package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -0
  112. package/dist/src/graphql/client.js.map +1 -0
  113. package/dist/src/graphql/index.js.map +1 -0
  114. package/dist/src/graphql/workItems.js.map +1 -0
  115. package/dist/{handlers.js → src/handlers.js} +15 -0
  116. package/dist/src/handlers.js.map +1 -0
  117. package/dist/{http-client.js → src/http-client.js} +0 -4
  118. package/dist/src/http-client.js.map +1 -0
  119. package/dist/src/logger.js.map +1 -0
  120. package/dist/src/main.js.map +1 -0
  121. package/dist/src/middleware/index.d.ts +2 -0
  122. package/dist/src/middleware/index.js +12 -0
  123. package/dist/src/middleware/index.js.map +1 -0
  124. package/dist/src/middleware/oauth-auth.d.ts +4 -0
  125. package/dist/src/middleware/oauth-auth.js +119 -0
  126. package/dist/src/middleware/oauth-auth.js.map +1 -0
  127. package/dist/src/middleware/rate-limiter.d.ts +11 -0
  128. package/dist/src/middleware/rate-limiter.js +145 -0
  129. package/dist/src/middleware/rate-limiter.js.map +1 -0
  130. package/dist/src/oauth/config.d.ts +19 -0
  131. package/dist/src/oauth/config.js +70 -0
  132. package/dist/src/oauth/config.js.map +1 -0
  133. package/dist/src/oauth/endpoints/authorize.d.ts +3 -0
  134. package/dist/src/oauth/endpoints/authorize.js +454 -0
  135. package/dist/src/oauth/endpoints/authorize.js.map +1 -0
  136. package/dist/src/oauth/endpoints/callback.d.ts +2 -0
  137. package/dist/src/oauth/endpoints/callback.js +129 -0
  138. package/dist/src/oauth/endpoints/callback.js.map +1 -0
  139. package/dist/src/oauth/endpoints/index.d.ts +5 -0
  140. package/dist/src/oauth/endpoints/index.js +20 -0
  141. package/dist/src/oauth/endpoints/index.js.map +1 -0
  142. package/dist/src/oauth/endpoints/metadata.d.ts +5 -0
  143. package/dist/src/oauth/endpoints/metadata.js +48 -0
  144. package/dist/src/oauth/endpoints/metadata.js.map +1 -0
  145. package/dist/src/oauth/endpoints/register.d.ts +15 -0
  146. package/dist/src/oauth/endpoints/register.js +85 -0
  147. package/dist/src/oauth/endpoints/register.js.map +1 -0
  148. package/dist/src/oauth/endpoints/token.d.ts +2 -0
  149. package/dist/src/oauth/endpoints/token.js +159 -0
  150. package/dist/src/oauth/endpoints/token.js.map +1 -0
  151. package/dist/src/oauth/gitlab-device-flow.d.ts +10 -0
  152. package/dist/src/oauth/gitlab-device-flow.js +215 -0
  153. package/dist/src/oauth/gitlab-device-flow.js.map +1 -0
  154. package/dist/src/oauth/index.d.ts +10 -0
  155. package/dist/src/oauth/index.js +65 -0
  156. package/dist/src/oauth/index.js.map +1 -0
  157. package/dist/src/oauth/session-store.d.ts +54 -0
  158. package/dist/src/oauth/session-store.js +302 -0
  159. package/dist/src/oauth/session-store.js.map +1 -0
  160. package/dist/src/oauth/storage/factory.d.ts +4 -0
  161. package/dist/src/oauth/storage/factory.js +75 -0
  162. package/dist/src/oauth/storage/factory.js.map +1 -0
  163. package/dist/src/oauth/storage/file.d.ts +50 -0
  164. package/dist/src/oauth/storage/file.js +287 -0
  165. package/dist/src/oauth/storage/file.js.map +1 -0
  166. package/dist/src/oauth/storage/index.d.ts +5 -0
  167. package/dist/src/oauth/storage/index.js +22 -0
  168. package/dist/src/oauth/storage/index.js.map +1 -0
  169. package/dist/src/oauth/storage/memory.d.ts +76 -0
  170. package/dist/src/oauth/storage/memory.js +277 -0
  171. package/dist/src/oauth/storage/memory.js.map +1 -0
  172. package/dist/src/oauth/storage/postgresql.d.ts +41 -0
  173. package/dist/src/oauth/storage/postgresql.js +435 -0
  174. package/dist/src/oauth/storage/postgresql.js.map +1 -0
  175. package/dist/src/oauth/storage/types.d.ts +67 -0
  176. package/dist/src/oauth/storage/types.js +5 -0
  177. package/dist/src/oauth/storage/types.js.map +1 -0
  178. package/dist/src/oauth/token-context.d.ts +8 -0
  179. package/dist/src/oauth/token-context.js +40 -0
  180. package/dist/src/oauth/token-context.js.map +1 -0
  181. package/dist/src/oauth/token-utils.d.ts +14 -0
  182. package/dist/src/oauth/token-utils.js +148 -0
  183. package/dist/src/oauth/token-utils.js.map +1 -0
  184. package/dist/src/oauth/types.d.ts +104 -0
  185. package/dist/src/oauth/types.js +3 -0
  186. package/dist/src/oauth/types.js.map +1 -0
  187. package/dist/src/registry-manager.js.map +1 -0
  188. package/dist/{server.d.ts → src/server.d.ts} +11 -0
  189. package/dist/src/server.js +444 -0
  190. package/dist/src/server.js.map +1 -0
  191. package/dist/{services → src/services}/ConnectionManager.d.ts +2 -0
  192. package/dist/{services → src/services}/ConnectionManager.js +99 -7
  193. package/dist/src/services/ConnectionManager.js.map +1 -0
  194. package/dist/src/services/GitLabVersionDetector.js.map +1 -0
  195. package/dist/src/services/SchemaIntrospector.js.map +1 -0
  196. package/dist/{services → src/services}/ToolAvailability.js +3 -4
  197. package/dist/src/services/ToolAvailability.js.map +1 -0
  198. package/dist/src/services/WidgetAvailability.js.map +1 -0
  199. package/dist/src/types.js.map +1 -0
  200. package/dist/src/utils/fetch.d.ts +5 -0
  201. package/dist/{utils → src/utils}/fetch.js +89 -52
  202. package/dist/src/utils/fetch.js.map +1 -0
  203. package/dist/src/utils/gitlab-api.d.ts +21 -0
  204. package/dist/src/utils/gitlab-api.js +132 -0
  205. package/dist/src/utils/gitlab-api.js.map +1 -0
  206. package/dist/src/utils/idConversion.js.map +1 -0
  207. package/dist/{utils → src/utils}/namespace.js +1 -5
  208. package/dist/src/utils/namespace.js.map +1 -0
  209. package/dist/src/utils/projectIdentifier.js.map +1 -0
  210. package/dist/{utils → src/utils}/smart-user-search.js +1 -5
  211. package/dist/src/utils/smart-user-search.js.map +1 -0
  212. package/dist/src/utils/workItemTypes.js.map +1 -0
  213. package/dist/structured-world-gitlab-mcp-6.0.0.tgz +0 -0
  214. package/dist/tsconfig.build.tsbuildinfo +1 -1
  215. package/package.json +34 -31
  216. package/dist/config.js.map +0 -1
  217. package/dist/entities/core/index.js.map +0 -1
  218. package/dist/entities/core/registry.js +0 -778
  219. package/dist/entities/core/registry.js.map +0 -1
  220. package/dist/entities/core/schema-readonly.d.ts +0 -547
  221. package/dist/entities/core/schema-readonly.js +0 -471
  222. package/dist/entities/core/schema-readonly.js.map +0 -1
  223. package/dist/entities/core/schema.d.ts +0 -210
  224. package/dist/entities/core/schema.js +0 -230
  225. package/dist/entities/core/schema.js.map +0 -1
  226. package/dist/entities/files/index.js.map +0 -1
  227. package/dist/entities/files/registry.js +0 -207
  228. package/dist/entities/files/registry.js.map +0 -1
  229. package/dist/entities/files/schema-readonly.d.ts +0 -178
  230. package/dist/entities/files/schema-readonly.js.map +0 -1
  231. package/dist/entities/files/schema.d.ts +0 -107
  232. package/dist/entities/files/schema.js +0 -38
  233. package/dist/entities/files/schema.js.map +0 -1
  234. package/dist/entities/index.js.map +0 -1
  235. package/dist/entities/labels/index.js.map +0 -1
  236. package/dist/entities/labels/registry.js +0 -176
  237. package/dist/entities/labels/registry.js.map +0 -1
  238. package/dist/entities/labels/schema-readonly.d.ts +0 -32
  239. package/dist/entities/labels/schema-readonly.js.map +0 -1
  240. package/dist/entities/labels/schema.d.ts +0 -55
  241. package/dist/entities/labels/schema.js.map +0 -1
  242. package/dist/entities/milestones/index.js.map +0 -1
  243. package/dist/entities/milestones/registry.js +0 -300
  244. package/dist/entities/milestones/registry.js.map +0 -1
  245. package/dist/entities/milestones/schema-readonly.d.ts +0 -138
  246. package/dist/entities/milestones/schema-readonly.js.map +0 -1
  247. package/dist/entities/milestones/schema.d.ts +0 -69
  248. package/dist/entities/milestones/schema.js.map +0 -1
  249. package/dist/entities/mrs/index.js.map +0 -1
  250. package/dist/entities/mrs/registry.js.map +0 -1
  251. package/dist/entities/mrs/schema-readonly.d.ts +0 -302
  252. package/dist/entities/mrs/schema-readonly.js.map +0 -1
  253. package/dist/entities/mrs/schema.d.ts +0 -1028
  254. package/dist/entities/mrs/schema.js.map +0 -1
  255. package/dist/entities/pipelines/index.js.map +0 -1
  256. package/dist/entities/pipelines/registry.js.map +0 -1
  257. package/dist/entities/pipelines/schema-readonly.d.ts +0 -648
  258. package/dist/entities/pipelines/schema-readonly.js.map +0 -1
  259. package/dist/entities/pipelines/schema.d.ts +0 -123
  260. package/dist/entities/pipelines/schema.js.map +0 -1
  261. package/dist/entities/shared.d.ts +0 -968
  262. package/dist/entities/shared.js.map +0 -1
  263. package/dist/entities/utils.d.ts +0 -3
  264. package/dist/entities/utils.js.map +0 -1
  265. package/dist/entities/variables/index.js.map +0 -1
  266. package/dist/entities/variables/registry.js +0 -308
  267. package/dist/entities/variables/registry.js.map +0 -1
  268. package/dist/entities/variables/schema-readonly.d.ts +0 -40
  269. package/dist/entities/variables/schema-readonly.js.map +0 -1
  270. package/dist/entities/variables/schema.d.ts +0 -102
  271. package/dist/entities/variables/schema.js.map +0 -1
  272. package/dist/entities/wiki/index.js.map +0 -1
  273. package/dist/entities/wiki/registry.js +0 -173
  274. package/dist/entities/wiki/registry.js.map +0 -1
  275. package/dist/entities/wiki/schema-readonly.d.ts +0 -53
  276. package/dist/entities/wiki/schema-readonly.js.map +0 -1
  277. package/dist/entities/wiki/schema.js.map +0 -1
  278. package/dist/entities/workitems/index.js.map +0 -1
  279. package/dist/entities/workitems/registry.js.map +0 -1
  280. package/dist/entities/workitems/schema-readonly.d.ts +0 -49
  281. package/dist/entities/workitems/schema-readonly.js.map +0 -1
  282. package/dist/entities/workitems/schema.d.ts +0 -61
  283. package/dist/entities/workitems/schema.js.map +0 -1
  284. package/dist/graphql/DynamicWorkItemsQuery.js.map +0 -1
  285. package/dist/graphql/client.js.map +0 -1
  286. package/dist/graphql/index.js.map +0 -1
  287. package/dist/graphql/workItems.js.map +0 -1
  288. package/dist/handlers.js.map +0 -1
  289. package/dist/http-client.js.map +0 -1
  290. package/dist/logger.js.map +0 -1
  291. package/dist/main.js.map +0 -1
  292. package/dist/registry-manager.js.map +0 -1
  293. package/dist/server.js +0 -202
  294. package/dist/server.js.map +0 -1
  295. package/dist/services/ConnectionManager.js.map +0 -1
  296. package/dist/services/GitLabVersionDetector.js.map +0 -1
  297. package/dist/services/SchemaIntrospector.js.map +0 -1
  298. package/dist/services/ToolAvailability.js.map +0 -1
  299. package/dist/services/WidgetAvailability.js.map +0 -1
  300. package/dist/structured-world-gitlab-mcp-5.7.0.tgz +0 -0
  301. package/dist/types.js.map +0 -1
  302. package/dist/utils/fetch.d.ts +0 -9
  303. package/dist/utils/fetch.js.map +0 -1
  304. package/dist/utils/idConversion.js.map +0 -1
  305. package/dist/utils/namespace.js.map +0 -1
  306. package/dist/utils/projectIdentifier.js.map +0 -1
  307. package/dist/utils/smart-user-search.js.map +0 -1
  308. package/dist/utils/workItemTypes.js.map +0 -1
  309. /package/dist/{entities → src/entities}/core/index.d.ts +0 -0
  310. /package/dist/{entities → src/entities}/core/index.js +0 -0
  311. /package/dist/{entities → src/entities}/core/registry.d.ts +0 -0
  312. /package/dist/{entities → src/entities}/files/index.d.ts +0 -0
  313. /package/dist/{entities → src/entities}/files/index.js +0 -0
  314. /package/dist/{entities → src/entities}/files/registry.d.ts +0 -0
  315. /package/dist/{entities → src/entities}/index.d.ts +0 -0
  316. /package/dist/{entities → src/entities}/index.js +0 -0
  317. /package/dist/{entities → src/entities}/labels/index.d.ts +0 -0
  318. /package/dist/{entities → src/entities}/labels/index.js +0 -0
  319. /package/dist/{entities → src/entities}/labels/registry.d.ts +0 -0
  320. /package/dist/{entities → src/entities}/labels/schema-readonly.js +0 -0
  321. /package/dist/{entities → src/entities}/labels/schema.js +0 -0
  322. /package/dist/{entities → src/entities}/milestones/index.d.ts +0 -0
  323. /package/dist/{entities → src/entities}/milestones/index.js +0 -0
  324. /package/dist/{entities → src/entities}/milestones/registry.d.ts +0 -0
  325. /package/dist/{entities → src/entities}/milestones/schema-readonly.js +0 -0
  326. /package/dist/{entities → src/entities}/milestones/schema.js +0 -0
  327. /package/dist/{entities → src/entities}/mrs/index.d.ts +0 -0
  328. /package/dist/{entities → src/entities}/mrs/index.js +0 -0
  329. /package/dist/{entities → src/entities}/mrs/registry.d.ts +0 -0
  330. /package/dist/{entities → src/entities}/mrs/schema-readonly.js +0 -0
  331. /package/dist/{entities → src/entities}/mrs/schema.js +0 -0
  332. /package/dist/{entities → src/entities}/pipelines/index.d.ts +0 -0
  333. /package/dist/{entities → src/entities}/pipelines/index.js +0 -0
  334. /package/dist/{entities → src/entities}/pipelines/registry.d.ts +0 -0
  335. /package/dist/{entities → src/entities}/pipelines/schema-readonly.js +0 -0
  336. /package/dist/{entities → src/entities}/pipelines/schema.js +0 -0
  337. /package/dist/{entities → src/entities}/shared.js +0 -0
  338. /package/dist/{entities → src/entities}/utils.js +0 -0
  339. /package/dist/{entities → src/entities}/variables/index.d.ts +0 -0
  340. /package/dist/{entities → src/entities}/variables/index.js +0 -0
  341. /package/dist/{entities → src/entities}/variables/registry.d.ts +0 -0
  342. /package/dist/{entities → src/entities}/variables/schema-readonly.js +0 -0
  343. /package/dist/{entities → src/entities}/variables/schema.js +0 -0
  344. /package/dist/{entities → src/entities}/wiki/index.d.ts +0 -0
  345. /package/dist/{entities → src/entities}/wiki/index.js +0 -0
  346. /package/dist/{entities → src/entities}/wiki/registry.d.ts +0 -0
  347. /package/dist/{entities → src/entities}/wiki/schema-readonly.js +0 -0
  348. /package/dist/{entities → src/entities}/wiki/schema.js +0 -0
  349. /package/dist/{entities → src/entities}/workitems/index.d.ts +0 -0
  350. /package/dist/{entities → src/entities}/workitems/index.js +0 -0
  351. /package/dist/{entities → src/entities}/workitems/registry.d.ts +0 -0
  352. /package/dist/{entities → src/entities}/workitems/schema.js +0 -0
  353. /package/dist/{graphql → src/graphql}/DynamicWorkItemsQuery.d.ts +0 -0
  354. /package/dist/{graphql → src/graphql}/DynamicWorkItemsQuery.js +0 -0
  355. /package/dist/{graphql → src/graphql}/client.d.ts +0 -0
  356. /package/dist/{graphql → src/graphql}/client.js +0 -0
  357. /package/dist/{graphql → src/graphql}/index.d.ts +0 -0
  358. /package/dist/{graphql → src/graphql}/index.js +0 -0
  359. /package/dist/{graphql → src/graphql}/workItems.d.ts +0 -0
  360. /package/dist/{graphql → src/graphql}/workItems.js +0 -0
  361. /package/dist/{handlers.d.ts → src/handlers.d.ts} +0 -0
  362. /package/dist/{http-client.d.ts → src/http-client.d.ts} +0 -0
  363. /package/dist/{logger.d.ts → src/logger.d.ts} +0 -0
  364. /package/dist/{logger.js → src/logger.js} +0 -0
  365. /package/dist/{main.d.ts → src/main.d.ts} +0 -0
  366. /package/dist/{main.js → src/main.js} +0 -0
  367. /package/dist/{registry-manager.d.ts → src/registry-manager.d.ts} +0 -0
  368. /package/dist/{registry-manager.js → src/registry-manager.js} +0 -0
  369. /package/dist/{services → src/services}/GitLabVersionDetector.d.ts +0 -0
  370. /package/dist/{services → src/services}/GitLabVersionDetector.js +0 -0
  371. /package/dist/{services → src/services}/SchemaIntrospector.d.ts +0 -0
  372. /package/dist/{services → src/services}/SchemaIntrospector.js +0 -0
  373. /package/dist/{services → src/services}/ToolAvailability.d.ts +0 -0
  374. /package/dist/{services → src/services}/WidgetAvailability.d.ts +0 -0
  375. /package/dist/{services → src/services}/WidgetAvailability.js +0 -0
  376. /package/dist/{types.d.ts → src/types.d.ts} +0 -0
  377. /package/dist/{types.js → src/types.js} +0 -0
  378. /package/dist/{utils → src/utils}/idConversion.d.ts +0 -0
  379. /package/dist/{utils → src/utils}/idConversion.js +0 -0
  380. /package/dist/{utils → src/utils}/namespace.d.ts +0 -0
  381. /package/dist/{utils → src/utils}/projectIdentifier.d.ts +0 -0
  382. /package/dist/{utils → src/utils}/projectIdentifier.js +0 -0
  383. /package/dist/{utils → src/utils}/smart-user-search.d.ts +0 -0
  384. /package/dist/{utils → src/utils}/workItemTypes.d.ts +0 -0
  385. /package/dist/{utils → src/utils}/workItemTypes.js +0 -0
@@ -0,0 +1,745 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.coreToolRegistry = void 0;
37
+ exports.getCoreReadOnlyToolNames = getCoreReadOnlyToolNames;
38
+ exports.getCoreToolDefinitions = getCoreToolDefinitions;
39
+ exports.getFilteredCoreTools = getFilteredCoreTools;
40
+ const z = __importStar(require("zod"));
41
+ const schema_readonly_1 = require("./schema-readonly");
42
+ const schema_1 = require("./schema");
43
+ const fetch_1 = require("../../utils/fetch");
44
+ const projectIdentifier_1 = require("../../utils/projectIdentifier");
45
+ const smart_user_search_1 = require("../../utils/smart-user-search");
46
+ const idConversion_1 = require("../../utils/idConversion");
47
+ exports.coreToolRegistry = new Map([
48
+ [
49
+ "browse_projects",
50
+ {
51
+ name: "browse_projects",
52
+ description: "PROJECT DISCOVERY: Find, browse, or inspect GitLab projects. Use 'search' to find projects by name/topic across all GitLab. Use 'list' to browse your accessible projects or projects within a specific group. Use 'get' with project_id to retrieve full details of a known project. Filter by visibility, language, or ownership.",
53
+ inputSchema: z.toJSONSchema(schema_readonly_1.BrowseProjectsSchema),
54
+ handler: async (args) => {
55
+ const options = schema_readonly_1.BrowseProjectsSchema.parse(args);
56
+ switch (options.action) {
57
+ case "search": {
58
+ const { q, with_programming_language, visibility, order_by, sort, per_page, page } = options;
59
+ const queryParams = new URLSearchParams();
60
+ if (q) {
61
+ let finalSearchTerms = q;
62
+ const topicMatches = q.match(/topic:(\w+)/g);
63
+ if (topicMatches) {
64
+ const topics = topicMatches.map(match => match.replace("topic:", ""));
65
+ queryParams.set("topic", topics.join(","));
66
+ finalSearchTerms = finalSearchTerms.replace(/topic:\w+/g, "").trim();
67
+ }
68
+ if (finalSearchTerms) {
69
+ queryParams.set("search", finalSearchTerms);
70
+ }
71
+ }
72
+ if (with_programming_language)
73
+ queryParams.set("with_programming_language", with_programming_language);
74
+ if (visibility)
75
+ queryParams.set("visibility", visibility);
76
+ if (order_by)
77
+ queryParams.set("order_by", order_by);
78
+ if (sort)
79
+ queryParams.set("sort", sort);
80
+ if (per_page)
81
+ queryParams.set("per_page", String(per_page));
82
+ if (page)
83
+ queryParams.set("page", String(page));
84
+ queryParams.set("active", "true");
85
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects?${queryParams}`;
86
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
87
+ if (!response.ok) {
88
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
89
+ }
90
+ const projects = await response.json();
91
+ return (0, idConversion_1.cleanGidsFromObject)(projects);
92
+ }
93
+ case "list": {
94
+ const { group_id, search, owned, starred, membership, simple, with_programming_language, include_subgroups, with_shared, visibility, archived, order_by, sort, per_page, page, } = options;
95
+ const queryParams = new URLSearchParams();
96
+ if (visibility)
97
+ queryParams.set("visibility", visibility);
98
+ if (archived !== undefined)
99
+ queryParams.set("archived", String(archived));
100
+ if (owned !== undefined)
101
+ queryParams.set("owned", String(owned));
102
+ if (starred !== undefined)
103
+ queryParams.set("starred", String(starred));
104
+ if (membership !== undefined)
105
+ queryParams.set("membership", String(membership));
106
+ if (search)
107
+ queryParams.set("search", search);
108
+ if (simple !== undefined)
109
+ queryParams.set("simple", String(simple));
110
+ if (order_by)
111
+ queryParams.set("order_by", order_by);
112
+ if (sort)
113
+ queryParams.set("sort", sort);
114
+ if (per_page)
115
+ queryParams.set("per_page", String(per_page));
116
+ if (page)
117
+ queryParams.set("page", String(page));
118
+ if (include_subgroups !== undefined)
119
+ queryParams.set("include_subgroups", String(include_subgroups));
120
+ if (with_shared !== undefined)
121
+ queryParams.set("with_shared", String(with_shared));
122
+ if (with_programming_language)
123
+ queryParams.set("with_programming_language", with_programming_language);
124
+ if (!queryParams.has("order_by"))
125
+ queryParams.set("order_by", "created_at");
126
+ if (!queryParams.has("sort"))
127
+ queryParams.set("sort", "desc");
128
+ if (!queryParams.has("simple"))
129
+ queryParams.set("simple", "true");
130
+ if (!queryParams.has("per_page"))
131
+ queryParams.set("per_page", "20");
132
+ let apiUrl;
133
+ if (group_id) {
134
+ apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups/${encodeURIComponent(group_id)}/projects?${queryParams}`;
135
+ }
136
+ else {
137
+ queryParams.set("active", "true");
138
+ apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects?${queryParams}`;
139
+ }
140
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
141
+ if (!response.ok) {
142
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
143
+ }
144
+ const projects = await response.json();
145
+ return (0, idConversion_1.cleanGidsFromObject)(projects);
146
+ }
147
+ case "get": {
148
+ const { project_id, statistics, license } = options;
149
+ const queryParams = new URLSearchParams();
150
+ if (statistics)
151
+ queryParams.set("statistics", "true");
152
+ if (license)
153
+ queryParams.set("license", "true");
154
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}?${queryParams}`;
155
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
156
+ if (!response.ok) {
157
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
158
+ }
159
+ const project = await response.json();
160
+ return (0, idConversion_1.cleanGidsFromObject)(project);
161
+ }
162
+ default: {
163
+ const _exhaustive = options;
164
+ throw new Error(`Unknown action: ${_exhaustive.action}`);
165
+ }
166
+ }
167
+ },
168
+ },
169
+ ],
170
+ [
171
+ "browse_namespaces",
172
+ {
173
+ name: "browse_namespaces",
174
+ description: "NAMESPACE OPERATIONS: Explore GitLab groups and user namespaces. Use 'list' to discover available namespaces for project creation. Use 'get' with namespace_id to retrieve full details including storage stats. Use 'verify' to check if a namespace path exists before creating projects or groups.",
175
+ inputSchema: z.toJSONSchema(schema_readonly_1.BrowseNamespacesSchema),
176
+ handler: async (args) => {
177
+ const options = schema_readonly_1.BrowseNamespacesSchema.parse(args);
178
+ switch (options.action) {
179
+ case "list": {
180
+ const { search, owned_only, top_level_only, with_statistics, min_access_level, per_page, page, } = options;
181
+ const queryParams = new URLSearchParams();
182
+ if (search)
183
+ queryParams.set("search", search);
184
+ if (owned_only !== undefined)
185
+ queryParams.set("owned_only", String(owned_only));
186
+ if (top_level_only !== undefined)
187
+ queryParams.set("top_level_only", String(top_level_only));
188
+ if (with_statistics !== undefined)
189
+ queryParams.set("with_statistics", String(with_statistics));
190
+ if (min_access_level !== undefined)
191
+ queryParams.set("min_access_level", String(min_access_level));
192
+ if (per_page)
193
+ queryParams.set("per_page", String(per_page));
194
+ if (page)
195
+ queryParams.set("page", String(page));
196
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces?${queryParams}`;
197
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
198
+ if (!response.ok) {
199
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
200
+ }
201
+ const namespaces = await response.json();
202
+ return (0, idConversion_1.cleanGidsFromObject)(namespaces);
203
+ }
204
+ case "get": {
205
+ const { namespace_id } = options;
206
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces/${encodeURIComponent(namespace_id)}`;
207
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
208
+ if (!response.ok) {
209
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
210
+ }
211
+ const namespace = await response.json();
212
+ return (0, idConversion_1.cleanGidsFromObject)(namespace);
213
+ }
214
+ case "verify": {
215
+ const { namespace_id } = options;
216
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces/${encodeURIComponent(namespace_id)}`;
217
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
218
+ return {
219
+ exists: response.ok,
220
+ status: response.status,
221
+ namespace: namespace_id,
222
+ data: response.ok ? await response.json() : null,
223
+ };
224
+ }
225
+ default: {
226
+ const _exhaustive = options;
227
+ throw new Error(`Unknown action: ${_exhaustive.action}`);
228
+ }
229
+ }
230
+ },
231
+ },
232
+ ],
233
+ [
234
+ "browse_commits",
235
+ {
236
+ name: "browse_commits",
237
+ description: "COMMIT HISTORY: Explore repository commit history. Use 'list' to browse commits with optional date range, author, or file path filters. Use 'get' with sha to retrieve commit metadata and stats. Use 'diff' to see actual code changes in a commit. Essential for code review and change tracking.",
238
+ inputSchema: z.toJSONSchema(schema_readonly_1.BrowseCommitsSchema),
239
+ handler: async (args) => {
240
+ const options = schema_readonly_1.BrowseCommitsSchema.parse(args);
241
+ switch (options.action) {
242
+ case "list": {
243
+ const { project_id, ref_name, since, until, path, author, all, with_stats, first_parent, order, trailers, per_page, page, } = options;
244
+ const queryParams = new URLSearchParams();
245
+ if (ref_name)
246
+ queryParams.set("ref_name", ref_name);
247
+ if (since)
248
+ queryParams.set("since", since);
249
+ if (until)
250
+ queryParams.set("until", until);
251
+ if (path)
252
+ queryParams.set("path", path);
253
+ if (author)
254
+ queryParams.set("author", author);
255
+ if (all !== undefined)
256
+ queryParams.set("all", String(all));
257
+ if (with_stats !== undefined)
258
+ queryParams.set("with_stats", String(with_stats));
259
+ if (first_parent !== undefined)
260
+ queryParams.set("first_parent", String(first_parent));
261
+ if (order)
262
+ queryParams.set("order", order);
263
+ if (trailers !== undefined)
264
+ queryParams.set("trailers", String(trailers));
265
+ if (per_page)
266
+ queryParams.set("per_page", String(per_page));
267
+ if (page)
268
+ queryParams.set("page", String(page));
269
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/repository/commits?${queryParams}`;
270
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
271
+ if (!response.ok) {
272
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
273
+ }
274
+ return await response.json();
275
+ }
276
+ case "get": {
277
+ const { project_id, sha, stats } = options;
278
+ const queryParams = new URLSearchParams();
279
+ if (stats)
280
+ queryParams.set("stats", "true");
281
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/repository/commits/${encodeURIComponent(sha)}?${queryParams}`;
282
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
283
+ if (!response.ok) {
284
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
285
+ }
286
+ return await response.json();
287
+ }
288
+ case "diff": {
289
+ const { project_id, sha, unidiff } = options;
290
+ const queryParams = new URLSearchParams();
291
+ if (unidiff)
292
+ queryParams.set("unidiff", "true");
293
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/repository/commits/${encodeURIComponent(sha)}/diff?${queryParams}`;
294
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
295
+ if (!response.ok) {
296
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
297
+ }
298
+ return await response.json();
299
+ }
300
+ default: {
301
+ const _exhaustive = options;
302
+ throw new Error(`Unknown action: ${_exhaustive.action}`);
303
+ }
304
+ }
305
+ },
306
+ },
307
+ ],
308
+ [
309
+ "browse_events",
310
+ {
311
+ name: "browse_events",
312
+ description: "ACTIVITY FEED: Track GitLab activity and events. Use 'user' to see YOUR recent activity across all projects (commits, issues, MRs). Use 'project' with project_id to monitor a specific project's activity feed. Filter by date range or action type (pushed, commented, merged, etc.).",
313
+ inputSchema: z.toJSONSchema(schema_readonly_1.BrowseEventsSchema),
314
+ handler: async (args) => {
315
+ const options = schema_readonly_1.BrowseEventsSchema.parse(args);
316
+ const buildQueryParams = (opts) => {
317
+ const queryParams = new URLSearchParams();
318
+ if (opts.target_type)
319
+ queryParams.set("target_type", opts.target_type);
320
+ if (opts.event_action)
321
+ queryParams.set("action", opts.event_action);
322
+ if (opts.before)
323
+ queryParams.set("before", opts.before);
324
+ if (opts.after)
325
+ queryParams.set("after", opts.after);
326
+ if (opts.sort)
327
+ queryParams.set("sort", opts.sort);
328
+ if (opts.per_page)
329
+ queryParams.set("per_page", String(opts.per_page));
330
+ if (opts.page)
331
+ queryParams.set("page", String(opts.page));
332
+ return queryParams;
333
+ };
334
+ switch (options.action) {
335
+ case "user": {
336
+ const queryParams = buildQueryParams(options);
337
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/events?${queryParams}`;
338
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
339
+ if (!response.ok) {
340
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
341
+ }
342
+ return await response.json();
343
+ }
344
+ case "project": {
345
+ const { project_id } = options;
346
+ const queryParams = buildQueryParams(options);
347
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/events?${queryParams}`;
348
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
349
+ if (!response.ok) {
350
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
351
+ }
352
+ return await response.json();
353
+ }
354
+ default: {
355
+ const _exhaustive = options;
356
+ throw new Error(`Unknown action: ${_exhaustive.action}`);
357
+ }
358
+ }
359
+ },
360
+ },
361
+ ],
362
+ [
363
+ "manage_repository",
364
+ {
365
+ name: "manage_repository",
366
+ description: "REPOSITORY MANAGEMENT: Create or fork GitLab projects. Use 'create' to start a new project with custom settings (visibility, features, namespace). Use 'fork' with project_id to create your own copy of an existing project for independent development or contribution back via MRs.",
367
+ inputSchema: z.toJSONSchema(schema_1.ManageRepositorySchema),
368
+ handler: async (args) => {
369
+ const options = schema_1.ManageRepositorySchema.parse(args);
370
+ switch (options.action) {
371
+ case "create": {
372
+ const { name, namespace, description, visibility, initialize_with_readme, issues_enabled, merge_requests_enabled, jobs_enabled, wiki_enabled, snippets_enabled, lfs_enabled, request_access_enabled, only_allow_merge_if_pipeline_succeeds, only_allow_merge_if_all_discussions_are_resolved, } = options;
373
+ let namespaceId;
374
+ let resolvedNamespace = null;
375
+ if (namespace) {
376
+ const namespaceApiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces/${encodeURIComponent(namespace)}`;
377
+ const namespaceResponse = await (0, fetch_1.enhancedFetch)(namespaceApiUrl);
378
+ if (namespaceResponse.ok) {
379
+ resolvedNamespace = (await namespaceResponse.json());
380
+ namespaceId = String(resolvedNamespace.id);
381
+ }
382
+ else {
383
+ throw new Error(`Namespace '${namespace}' not found or not accessible`);
384
+ }
385
+ }
386
+ const targetNamespacePath = resolvedNamespace
387
+ ? resolvedNamespace.full_path
388
+ : "current-user";
389
+ const projectPath = `${targetNamespacePath}/${name}`;
390
+ const checkProjectUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(projectPath)}`;
391
+ const checkResponse = await (0, fetch_1.enhancedFetch)(checkProjectUrl);
392
+ if (checkResponse.ok) {
393
+ const existingProject = (await checkResponse.json());
394
+ throw new Error(`Project '${projectPath}' already exists (ID: ${existingProject.id}).`);
395
+ }
396
+ const body = new URLSearchParams();
397
+ body.set("name", name);
398
+ const generatedPath = name
399
+ .toLowerCase()
400
+ .replace(/[^a-z0-9-]/g, "-")
401
+ .replace(/-+/g, "-")
402
+ .replace(/^-|-$/g, "");
403
+ body.set("path", generatedPath);
404
+ if (namespaceId)
405
+ body.set("namespace_id", namespaceId);
406
+ if (description)
407
+ body.set("description", description);
408
+ if (visibility)
409
+ body.set("visibility", visibility);
410
+ if (initialize_with_readme)
411
+ body.set("initialize_with_readme", "true");
412
+ if (issues_enabled !== undefined)
413
+ body.set("issues_enabled", String(issues_enabled));
414
+ if (merge_requests_enabled !== undefined)
415
+ body.set("merge_requests_enabled", String(merge_requests_enabled));
416
+ if (jobs_enabled !== undefined)
417
+ body.set("jobs_enabled", String(jobs_enabled));
418
+ if (wiki_enabled !== undefined)
419
+ body.set("wiki_enabled", String(wiki_enabled));
420
+ if (snippets_enabled !== undefined)
421
+ body.set("snippets_enabled", String(snippets_enabled));
422
+ if (lfs_enabled !== undefined)
423
+ body.set("lfs_enabled", String(lfs_enabled));
424
+ if (request_access_enabled !== undefined)
425
+ body.set("request_access_enabled", String(request_access_enabled));
426
+ if (only_allow_merge_if_pipeline_succeeds !== undefined)
427
+ body.set("only_allow_merge_if_pipeline_succeeds", String(only_allow_merge_if_pipeline_succeeds));
428
+ if (only_allow_merge_if_all_discussions_are_resolved !== undefined)
429
+ body.set("only_allow_merge_if_all_discussions_are_resolved", String(only_allow_merge_if_all_discussions_are_resolved));
430
+ const createApiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects`;
431
+ const createResponse = await (0, fetch_1.enhancedFetch)(createApiUrl, {
432
+ method: "POST",
433
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
434
+ body: body.toString(),
435
+ });
436
+ if (!createResponse.ok) {
437
+ throw new Error(`GitLab API error: ${createResponse.status} ${createResponse.statusText}`);
438
+ }
439
+ const project = await createResponse.json();
440
+ return {
441
+ ...project,
442
+ validation: {
443
+ namespace_resolved: namespace ? `${namespace} -> ${namespaceId}` : "current-user",
444
+ generated_path: generatedPath,
445
+ },
446
+ };
447
+ }
448
+ case "fork": {
449
+ const { project_id, namespace, namespace_path, fork_name, fork_path } = options;
450
+ const body = new URLSearchParams();
451
+ if (namespace)
452
+ body.set("namespace", namespace);
453
+ if (namespace_path)
454
+ body.set("namespace_path", namespace_path);
455
+ if (fork_name)
456
+ body.set("name", fork_name);
457
+ if (fork_path)
458
+ body.set("path", fork_path);
459
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/fork`;
460
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
461
+ method: "POST",
462
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
463
+ body: body.toString(),
464
+ });
465
+ if (!response.ok) {
466
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
467
+ }
468
+ return await response.json();
469
+ }
470
+ default: {
471
+ const _exhaustive = options;
472
+ throw new Error(`Unknown action: ${_exhaustive.action}`);
473
+ }
474
+ }
475
+ },
476
+ },
477
+ ],
478
+ [
479
+ "get_users",
480
+ {
481
+ name: "get_users",
482
+ description: "FIND USERS: Search GitLab users with smart pattern detection. Auto-detects emails, usernames, or names. Supports transliteration and multi-phase fallback search.",
483
+ inputSchema: z.toJSONSchema(schema_readonly_1.GetUsersSchema),
484
+ handler: async (args) => {
485
+ const options = schema_readonly_1.GetUsersSchema.parse(args);
486
+ const { smart_search, search, username, public_email, ...otherParams } = options;
487
+ const hasUsernameOrEmail = Boolean(username) || Boolean(public_email);
488
+ const hasOnlySearch = Boolean(search) && !hasUsernameOrEmail;
489
+ const shouldUseSmartSearch = smart_search === false ? false : smart_search === true || hasOnlySearch;
490
+ if (shouldUseSmartSearch && (search || username || public_email)) {
491
+ const query = search ?? username ?? public_email ?? "";
492
+ const additionalParams = {};
493
+ Object.entries(otherParams).forEach(([key, value]) => {
494
+ if (value !== undefined && key !== "smart_search") {
495
+ additionalParams[key] = value;
496
+ }
497
+ });
498
+ return await (0, smart_user_search_1.smartUserSearch)(query, additionalParams);
499
+ }
500
+ else {
501
+ const queryParams = new URLSearchParams();
502
+ Object.entries(options).forEach(([key, value]) => {
503
+ if (value !== undefined && key !== "smart_search") {
504
+ queryParams.set(key, String(value));
505
+ }
506
+ });
507
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/users?${queryParams}`;
508
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
509
+ if (!response.ok) {
510
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
511
+ }
512
+ const users = await response.json();
513
+ return (0, idConversion_1.cleanGidsFromObject)(users);
514
+ }
515
+ },
516
+ },
517
+ ],
518
+ [
519
+ "list_project_members",
520
+ {
521
+ name: "list_project_members",
522
+ description: "TEAM MEMBERS: List project members with access levels. Shows: 10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner.",
523
+ inputSchema: z.toJSONSchema(schema_readonly_1.ListProjectMembersSchema),
524
+ handler: async (args) => {
525
+ const options = schema_readonly_1.ListProjectMembersSchema.parse(args);
526
+ const { project_id } = options;
527
+ const queryParams = new URLSearchParams();
528
+ Object.entries(options).forEach(([key, value]) => {
529
+ if (value !== undefined && key !== "project_id") {
530
+ queryParams.set(key, String(value));
531
+ }
532
+ });
533
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/members?${queryParams}`;
534
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
535
+ if (!response.ok) {
536
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
537
+ }
538
+ const members = await response.json();
539
+ return (0, idConversion_1.cleanGidsFromObject)(members);
540
+ },
541
+ },
542
+ ],
543
+ [
544
+ "list_group_iterations",
545
+ {
546
+ name: "list_group_iterations",
547
+ description: "SPRINTS: List iterations/sprints for agile planning. Filter by state: current, upcoming, closed. Requires GitLab Premium.",
548
+ inputSchema: z.toJSONSchema(schema_readonly_1.ListGroupIterationsSchema),
549
+ handler: async (args) => {
550
+ const options = schema_readonly_1.ListGroupIterationsSchema.parse(args);
551
+ const { group_id } = options;
552
+ const queryParams = new URLSearchParams();
553
+ Object.entries(options).forEach(([key, value]) => {
554
+ if (value !== undefined && key !== "group_id") {
555
+ queryParams.set(key, String(value));
556
+ }
557
+ });
558
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups/${encodeURIComponent(group_id)}/iterations?${queryParams}`;
559
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
560
+ if (!response.ok) {
561
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
562
+ }
563
+ return await response.json();
564
+ },
565
+ },
566
+ ],
567
+ [
568
+ "download_attachment",
569
+ {
570
+ name: "download_attachment",
571
+ description: "DOWNLOAD: Retrieve file attachments from issues/MRs. Requires secret token and filename from attachment URL.",
572
+ inputSchema: z.toJSONSchema(schema_readonly_1.DownloadAttachmentSchema),
573
+ handler: async (args) => {
574
+ const options = schema_readonly_1.DownloadAttachmentSchema.parse(args);
575
+ const { project_id, secret, filename } = options;
576
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/uploads/${secret}/${filename}`;
577
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
578
+ if (!response.ok) {
579
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
580
+ }
581
+ const attachment = await response.arrayBuffer();
582
+ return {
583
+ filename,
584
+ content: Buffer.from(attachment).toString("base64"),
585
+ contentType: response.headers.get("content-type") ?? "application/octet-stream",
586
+ };
587
+ },
588
+ },
589
+ ],
590
+ [
591
+ "create_branch",
592
+ {
593
+ name: "create_branch",
594
+ description: "NEW BRANCH: Create a Git branch from existing ref. Required before creating MRs. Ref can be branch name, tag, or commit SHA.",
595
+ inputSchema: z.toJSONSchema(schema_1.CreateBranchSchema),
596
+ handler: async (args) => {
597
+ const options = schema_1.CreateBranchSchema.parse(args);
598
+ const body = new URLSearchParams();
599
+ body.set("branch", options.branch);
600
+ body.set("ref", options.ref);
601
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/repository/branches`;
602
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
603
+ method: "POST",
604
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
605
+ body: body.toString(),
606
+ });
607
+ if (!response.ok) {
608
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
609
+ }
610
+ return await response.json();
611
+ },
612
+ },
613
+ ],
614
+ [
615
+ "create_group",
616
+ {
617
+ name: "create_group",
618
+ description: "CREATE GROUP: Create a new GitLab group/namespace. Groups organize projects and teams. Can create subgroups with parent_id.",
619
+ inputSchema: z.toJSONSchema(schema_1.CreateGroupSchema),
620
+ handler: async (args) => {
621
+ const options = schema_1.CreateGroupSchema.parse(args);
622
+ const body = new URLSearchParams();
623
+ body.set("name", options.name);
624
+ body.set("path", options.path);
625
+ if (options.description)
626
+ body.set("description", options.description);
627
+ if (options.visibility)
628
+ body.set("visibility", options.visibility);
629
+ if (options.parent_id !== undefined)
630
+ body.set("parent_id", String(options.parent_id));
631
+ if (options.lfs_enabled !== undefined)
632
+ body.set("lfs_enabled", String(options.lfs_enabled));
633
+ if (options.request_access_enabled !== undefined)
634
+ body.set("request_access_enabled", String(options.request_access_enabled));
635
+ if (options.default_branch_protection !== undefined)
636
+ body.set("default_branch_protection", String(options.default_branch_protection));
637
+ if (options.avatar)
638
+ body.set("avatar", options.avatar);
639
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups`;
640
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
641
+ method: "POST",
642
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
643
+ body: body.toString(),
644
+ });
645
+ if (!response.ok) {
646
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
647
+ }
648
+ return await response.json();
649
+ },
650
+ },
651
+ ],
652
+ [
653
+ "list_todos",
654
+ {
655
+ name: "list_todos",
656
+ description: "TASK QUEUE: View your GitLab todos (notifications requiring action). Todos are auto-created when you're assigned to issues/MRs, @mentioned, requested as reviewer, or CI pipelines fail. Filter by state (pending/done), action type (assigned, mentioned, review_requested), or target type (Issue, MergeRequest).",
657
+ inputSchema: z.toJSONSchema(schema_readonly_1.ListTodosSchema),
658
+ handler: async (args) => {
659
+ const options = schema_readonly_1.ListTodosSchema.parse(args);
660
+ const queryParams = new URLSearchParams();
661
+ Object.entries(options).forEach(([key, value]) => {
662
+ if (value !== undefined) {
663
+ queryParams.set(key, String(value));
664
+ }
665
+ });
666
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos?${queryParams}`;
667
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl);
668
+ if (!response.ok) {
669
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
670
+ }
671
+ const todos = await response.json();
672
+ return (0, idConversion_1.cleanGidsFromObject)(todos);
673
+ },
674
+ },
675
+ ],
676
+ [
677
+ "manage_todos",
678
+ {
679
+ name: "manage_todos",
680
+ description: "TODO ACTIONS: Manage your GitLab todo items. Use 'mark_done' with id to complete a single todo (returns the updated todo object). Use 'mark_all_done' to clear your entire todo queue (returns success status). Use 'restore' with id to undo a completed todo (returns the restored todo object).",
681
+ inputSchema: z.toJSONSchema(schema_1.ManageTodosSchema),
682
+ handler: async (args) => {
683
+ const options = schema_1.ManageTodosSchema.parse(args);
684
+ switch (options.action) {
685
+ case "mark_done": {
686
+ const { id } = options;
687
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos/${id}/mark_as_done`;
688
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
689
+ if (!response.ok) {
690
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
691
+ }
692
+ const todo = await response.json();
693
+ return (0, idConversion_1.cleanGidsFromObject)(todo);
694
+ }
695
+ case "mark_all_done": {
696
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos/mark_all_as_done`;
697
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
698
+ if (!response.ok) {
699
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
700
+ }
701
+ return { success: true, message: "All todos marked as done" };
702
+ }
703
+ case "restore": {
704
+ const { id } = options;
705
+ const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos/${id}/mark_as_pending`;
706
+ const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
707
+ if (!response.ok) {
708
+ throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
709
+ }
710
+ const todo = await response.json();
711
+ return (0, idConversion_1.cleanGidsFromObject)(todo);
712
+ }
713
+ default: {
714
+ const _exhaustive = options;
715
+ throw new Error(`Unknown action: ${_exhaustive.action}`);
716
+ }
717
+ }
718
+ },
719
+ },
720
+ ],
721
+ ]);
722
+ function getCoreReadOnlyToolNames() {
723
+ return [
724
+ "browse_projects",
725
+ "browse_namespaces",
726
+ "browse_commits",
727
+ "browse_events",
728
+ "get_users",
729
+ "list_project_members",
730
+ "list_group_iterations",
731
+ "download_attachment",
732
+ "list_todos",
733
+ ];
734
+ }
735
+ function getCoreToolDefinitions() {
736
+ return Array.from(exports.coreToolRegistry.values());
737
+ }
738
+ function getFilteredCoreTools(readOnlyMode = false) {
739
+ if (readOnlyMode) {
740
+ const readOnlyNames = getCoreReadOnlyToolNames();
741
+ return Array.from(exports.coreToolRegistry.values()).filter(tool => readOnlyNames.includes(tool.name));
742
+ }
743
+ return getCoreToolDefinitions();
744
+ }
745
+ //# sourceMappingURL=registry.js.map