@structured-world/gitlab-mcp 10.1.0 → 12.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 (387) hide show
  1. package/README.md +8 -8
  2. package/README.md.in +2 -2
  3. package/dist/src/accounts/chat-accounts.d.ts +17 -0
  4. package/dist/src/accounts/chat-accounts.js +245 -0
  5. package/dist/src/accounts/chat-accounts.js.map +1 -0
  6. package/dist/src/accounts/instance-tokens.d.ts +2 -0
  7. package/dist/src/accounts/instance-tokens.js +43 -0
  8. package/dist/src/accounts/instance-tokens.js.map +1 -0
  9. package/dist/src/accounts/link.d.ts +16 -0
  10. package/dist/src/accounts/link.js +469 -0
  11. package/dist/src/accounts/link.js.map +1 -0
  12. package/dist/src/accounts/token-account.d.ts +6 -0
  13. package/dist/src/accounts/token-account.js +13 -0
  14. package/dist/src/accounts/token-account.js.map +1 -0
  15. package/dist/src/channel-gateway/format.js +7 -1
  16. package/dist/src/channel-gateway/format.js.map +1 -1
  17. package/dist/src/channel-gateway/forwarding.d.ts +3 -0
  18. package/dist/src/channel-gateway/forwarding.js +8 -1
  19. package/dist/src/channel-gateway/forwarding.js.map +1 -1
  20. package/dist/src/channel-gateway/gateway.d.ts +7 -0
  21. package/dist/src/channel-gateway/gateway.js +80 -16
  22. package/dist/src/channel-gateway/gateway.js.map +1 -1
  23. package/dist/src/cli/docker/container-runtime.d.ts +1 -0
  24. package/dist/src/cli/docker/container-runtime.js +37 -5
  25. package/dist/src/cli/docker/container-runtime.js.map +1 -1
  26. package/dist/src/cli/docker/docker-command.js +11 -2
  27. package/dist/src/cli/docker/docker-command.js.map +1 -1
  28. package/dist/src/cli/docker/docker-utils.d.ts +1 -0
  29. package/dist/src/cli/docker/docker-utils.js +137 -27
  30. package/dist/src/cli/docker/docker-utils.js.map +1 -1
  31. package/dist/src/cli/docker/oauth-issuer-prompt.d.ts +2 -0
  32. package/dist/src/cli/docker/oauth-issuer-prompt.js +47 -0
  33. package/dist/src/cli/docker/oauth-issuer-prompt.js.map +1 -0
  34. package/dist/src/cli/docker/types.d.ts +18 -4
  35. package/dist/src/cli/docker/types.js.map +1 -1
  36. package/dist/src/cli/init/config-generator.d.ts +3 -2
  37. package/dist/src/cli/init/config-generator.js +15 -0
  38. package/dist/src/cli/init/config-generator.js.map +1 -1
  39. package/dist/src/cli/init/types.d.ts +7 -2
  40. package/dist/src/cli/init/types.js +9 -0
  41. package/dist/src/cli/init/types.js.map +1 -1
  42. package/dist/src/cli/init/wizard.js +31 -1
  43. package/dist/src/cli/init/wizard.js.map +1 -1
  44. package/dist/src/cli/install/codex.d.ts +25 -0
  45. package/dist/src/cli/install/codex.js +261 -0
  46. package/dist/src/cli/install/codex.js.map +1 -0
  47. package/dist/src/cli/install/detector.js +22 -0
  48. package/dist/src/cli/install/detector.js.map +1 -1
  49. package/dist/src/cli/install/index.d.ts +2 -1
  50. package/dist/src/cli/install/index.js +3 -1
  51. package/dist/src/cli/install/index.js.map +1 -1
  52. package/dist/src/cli/install/install-command.d.ts +5 -2
  53. package/dist/src/cli/install/install-command.js +52 -8
  54. package/dist/src/cli/install/install-command.js.map +1 -1
  55. package/dist/src/cli/install/installers.d.ts +8 -8
  56. package/dist/src/cli/install/installers.js +18 -3
  57. package/dist/src/cli/install/installers.js.map +1 -1
  58. package/dist/src/cli/install/notes.d.ts +2 -0
  59. package/dist/src/cli/install/notes.js +8 -0
  60. package/dist/src/cli/install/notes.js.map +1 -0
  61. package/dist/src/cli/install/types.d.ts +1 -0
  62. package/dist/src/cli/install/types.js +12 -0
  63. package/dist/src/cli/install/types.js.map +1 -1
  64. package/dist/src/cli/list-tools.js +14 -35
  65. package/dist/src/cli/list-tools.js.map +1 -1
  66. package/dist/src/cli/plugin/build.d.ts +23 -0
  67. package/dist/src/cli/plugin/build.js +165 -0
  68. package/dist/src/cli/plugin/build.js.map +1 -0
  69. package/dist/src/cli/plugin/command.d.ts +4 -0
  70. package/dist/src/cli/plugin/command.js +89 -0
  71. package/dist/src/cli/plugin/command.js.map +1 -0
  72. package/dist/src/cli/plugin/index.d.ts +5 -0
  73. package/dist/src/cli/plugin/index.js +15 -0
  74. package/dist/src/cli/plugin/index.js.map +1 -0
  75. package/dist/src/cli/plugin/listing.d.ts +21 -0
  76. package/dist/src/cli/plugin/listing.js +44 -0
  77. package/dist/src/cli/plugin/listing.js.map +1 -0
  78. package/dist/src/cli/plugin/validate.d.ts +21 -0
  79. package/dist/src/cli/plugin/validate.js +496 -0
  80. package/dist/src/cli/plugin/validate.js.map +1 -0
  81. package/dist/src/cli/plugin/zip.d.ts +6 -0
  82. package/dist/src/cli/plugin/zip.js +83 -0
  83. package/dist/src/cli/plugin/zip.js.map +1 -0
  84. package/dist/src/cli/setup/flows/configure-existing.js +5 -0
  85. package/dist/src/cli/setup/flows/configure-existing.js.map +1 -1
  86. package/dist/src/cli/setup/flows/local-setup.js +3 -0
  87. package/dist/src/cli/setup/flows/local-setup.js.map +1 -1
  88. package/dist/src/cli/setup/flows/server-setup.js +15 -0
  89. package/dist/src/cli/setup/flows/server-setup.js.map +1 -1
  90. package/dist/src/cli-utils.d.ts +2 -0
  91. package/dist/src/cli-utils.js +6 -0
  92. package/dist/src/cli-utils.js.map +1 -1
  93. package/dist/src/config/instances-loader.js +17 -3
  94. package/dist/src/config/instances-loader.js.map +1 -1
  95. package/dist/src/config/instances-schema.d.ts +8 -3
  96. package/dist/src/config/instances-schema.js +12 -6
  97. package/dist/src/config/instances-schema.js.map +1 -1
  98. package/dist/src/config.js.map +1 -1
  99. package/dist/src/configuration/caller.d.ts +10 -0
  100. package/dist/src/configuration/caller.js +39 -0
  101. package/dist/src/configuration/caller.js.map +1 -0
  102. package/dist/src/configuration/composed-feeds.d.ts +31 -0
  103. package/dist/src/configuration/composed-feeds.js +698 -0
  104. package/dist/src/configuration/composed-feeds.js.map +1 -0
  105. package/dist/src/configuration/composed-listings.d.ts +14 -0
  106. package/dist/src/configuration/composed-listings.js +157 -0
  107. package/dist/src/configuration/composed-listings.js.map +1 -0
  108. package/dist/src/configuration/groups.d.ts +8 -0
  109. package/dist/src/configuration/groups.js +39 -0
  110. package/dist/src/configuration/groups.js.map +1 -0
  111. package/dist/src/configuration/index.d.ts +6 -0
  112. package/dist/src/configuration/index.js +87 -0
  113. package/dist/src/configuration/index.js.map +1 -0
  114. package/dist/src/configuration/policy.d.ts +34 -0
  115. package/dist/src/configuration/policy.js +122 -0
  116. package/dist/src/configuration/policy.js.map +1 -0
  117. package/dist/src/configuration/scope-ids.d.ts +7 -0
  118. package/dist/src/configuration/scope-ids.js +78 -0
  119. package/dist/src/configuration/scope-ids.js.map +1 -0
  120. package/dist/src/configuration/scope-projects.d.ts +5 -0
  121. package/dist/src/configuration/scope-projects.js +76 -0
  122. package/dist/src/configuration/scope-projects.js.map +1 -0
  123. package/dist/src/configuration/scope-targets.d.ts +26 -0
  124. package/dist/src/configuration/scope-targets.js +307 -0
  125. package/dist/src/configuration/scope-targets.js.map +1 -0
  126. package/dist/src/configuration/scoped-execution.d.ts +6 -0
  127. package/dist/src/configuration/scoped-execution.js +577 -0
  128. package/dist/src/configuration/scoped-execution.js.map +1 -0
  129. package/dist/src/configuration/scoped-feeds.d.ts +22 -0
  130. package/dist/src/configuration/scoped-feeds.js +136 -0
  131. package/dist/src/configuration/scoped-feeds.js.map +1 -0
  132. package/dist/src/configuration/service.d.ts +52 -0
  133. package/dist/src/configuration/service.js +169 -0
  134. package/dist/src/configuration/service.js.map +1 -0
  135. package/dist/src/configuration/settings-store.d.ts +20 -0
  136. package/dist/src/configuration/settings-store.js +228 -0
  137. package/dist/src/configuration/settings-store.js.map +1 -0
  138. package/dist/src/configuration/types.d.ts +30 -0
  139. package/dist/src/configuration/types.js +20 -0
  140. package/dist/src/configuration/types.js.map +1 -0
  141. package/dist/src/contracts/storage.d.ts +3 -2
  142. package/dist/src/dashboard/html-template.js +8 -15
  143. package/dist/src/dashboard/html-template.js.map +1 -1
  144. package/dist/src/dashboard/metrics.d.ts +1 -1
  145. package/dist/src/entities/context/accounts.d.ts +19 -0
  146. package/dist/src/entities/context/accounts.js +115 -0
  147. package/dist/src/entities/context/accounts.js.map +1 -0
  148. package/dist/src/entities/context/connection-check.d.ts +64 -0
  149. package/dist/src/entities/context/connection-check.js +117 -0
  150. package/dist/src/entities/context/connection-check.js.map +1 -0
  151. package/dist/src/entities/context/context-manager.d.ts +10 -23
  152. package/dist/src/entities/context/context-manager.js +101 -282
  153. package/dist/src/entities/context/context-manager.js.map +1 -1
  154. package/dist/src/entities/context/handlers.d.ts +5 -5
  155. package/dist/src/entities/context/handlers.js +11 -14
  156. package/dist/src/entities/context/handlers.js.map +1 -1
  157. package/dist/src/entities/context/output-schema.d.ts +320 -0
  158. package/dist/src/entities/context/output-schema.js +210 -0
  159. package/dist/src/entities/context/output-schema.js.map +1 -0
  160. package/dist/src/entities/context/profile.d.ts +29 -0
  161. package/dist/src/entities/context/profile.js +72 -0
  162. package/dist/src/entities/context/profile.js.map +1 -0
  163. package/dist/src/entities/context/registry.js +140 -3
  164. package/dist/src/entities/context/registry.js.map +1 -1
  165. package/dist/src/entities/context/schema.d.ts +32 -14
  166. package/dist/src/entities/context/schema.js +36 -13
  167. package/dist/src/entities/context/schema.js.map +1 -1
  168. package/dist/src/entities/context/scope-search.d.ts +49 -0
  169. package/dist/src/entities/context/scope-search.js +71 -0
  170. package/dist/src/entities/context/scope-search.js.map +1 -0
  171. package/dist/src/entities/context/settings-panel.d.ts +13 -0
  172. package/dist/src/entities/context/settings-panel.js +508 -0
  173. package/dist/src/entities/context/settings-panel.js.map +1 -0
  174. package/dist/src/entities/context/settings.d.ts +78 -0
  175. package/dist/src/entities/context/settings.js +239 -0
  176. package/dist/src/entities/context/settings.js.map +1 -0
  177. package/dist/src/entities/context/types.d.ts +3 -4
  178. package/dist/src/entities/context/whoami.js +39 -31
  179. package/dist/src/entities/context/whoami.js.map +1 -1
  180. package/dist/src/entities/core/registry.js +34 -33
  181. package/dist/src/entities/core/registry.js.map +1 -1
  182. package/dist/src/entities/core/schema-readonly.d.ts +4 -4
  183. package/dist/src/entities/environments/schema-readonly.d.ts +4 -4
  184. package/dist/src/entities/files/registry.js +3 -2
  185. package/dist/src/entities/files/registry.js.map +1 -1
  186. package/dist/src/entities/iterations/registry.js +3 -2
  187. package/dist/src/entities/iterations/registry.js.map +1 -1
  188. package/dist/src/entities/mrs/registry.js +6 -4
  189. package/dist/src/entities/mrs/registry.js.map +1 -1
  190. package/dist/src/entities/mrs/schema-readonly.d.ts +2 -2
  191. package/dist/src/entities/mrs/schema-readonly.js +19 -2
  192. package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
  193. package/dist/src/entities/mrs/schema.d.ts +1 -1
  194. package/dist/src/entities/pipelines/registry.js +23 -31
  195. package/dist/src/entities/pipelines/registry.js.map +1 -1
  196. package/dist/src/entities/pipelines/schema-readonly.d.ts +11 -11
  197. package/dist/src/entities/pipelines/schema-readonly.js +5 -2
  198. package/dist/src/entities/pipelines/schema-readonly.js.map +1 -1
  199. package/dist/src/entities/pipelines/trace.d.ts +20 -0
  200. package/dist/src/entities/pipelines/trace.js +156 -0
  201. package/dist/src/entities/pipelines/trace.js.map +1 -0
  202. package/dist/src/entities/runners/project-access.d.ts +14 -0
  203. package/dist/src/entities/runners/project-access.js +64 -0
  204. package/dist/src/entities/runners/project-access.js.map +1 -0
  205. package/dist/src/entities/runners/registry.js +54 -26
  206. package/dist/src/entities/runners/registry.js.map +1 -1
  207. package/dist/src/entities/search/schema-readonly.d.ts +28 -28
  208. package/dist/src/graphql/runners.d.ts +26 -1
  209. package/dist/src/graphql/runners.js +43 -6
  210. package/dist/src/graphql/runners.js.map +1 -1
  211. package/dist/src/graphql/vulnerabilities.d.ts +3 -0
  212. package/dist/src/graphql/vulnerabilities.js +1 -0
  213. package/dist/src/graphql/vulnerabilities.js.map +1 -1
  214. package/dist/src/handlers.js +351 -190
  215. package/dist/src/handlers.js.map +1 -1
  216. package/dist/src/main.js +23 -5
  217. package/dist/src/main.js.map +1 -1
  218. package/dist/src/mcp-apps.d.ts +6 -0
  219. package/dist/src/mcp-apps.js +8 -0
  220. package/dist/src/mcp-apps.js.map +1 -0
  221. package/dist/src/mcp-server-context.d.ts +3 -0
  222. package/dist/src/mcp-server-context.js +13 -0
  223. package/dist/src/mcp-server-context.js.map +1 -0
  224. package/dist/src/middleware/mcp-auth-routes.d.ts +3 -0
  225. package/dist/src/middleware/mcp-auth-routes.js +9 -0
  226. package/dist/src/middleware/mcp-auth-routes.js.map +1 -0
  227. package/dist/src/middleware/oauth-auth.js +87 -24
  228. package/dist/src/middleware/oauth-auth.js.map +1 -1
  229. package/dist/src/middleware/rate-limiter.js +11 -10
  230. package/dist/src/middleware/rate-limiter.js.map +1 -1
  231. package/dist/src/oauth/authorization-response.d.ts +1 -0
  232. package/dist/src/oauth/authorization-response.js +14 -0
  233. package/dist/src/oauth/authorization-response.js.map +1 -0
  234. package/dist/src/oauth/client-auth.d.ts +16 -0
  235. package/dist/src/oauth/client-auth.js +73 -0
  236. package/dist/src/oauth/client-auth.js.map +1 -0
  237. package/dist/src/oauth/code-exchange.d.ts +7 -0
  238. package/dist/src/oauth/code-exchange.js +38 -0
  239. package/dist/src/oauth/code-exchange.js.map +1 -0
  240. package/dist/src/oauth/config.d.ts +2 -0
  241. package/dist/src/oauth/config.js +37 -0
  242. package/dist/src/oauth/config.js.map +1 -1
  243. package/dist/src/oauth/endpoints/authorize.d.ts +1 -0
  244. package/dist/src/oauth/endpoints/authorize.js +361 -102
  245. package/dist/src/oauth/endpoints/authorize.js.map +1 -1
  246. package/dist/src/oauth/endpoints/callback.js +76 -41
  247. package/dist/src/oauth/endpoints/callback.js.map +1 -1
  248. package/dist/src/oauth/endpoints/index.d.ts +1 -0
  249. package/dist/src/oauth/endpoints/index.js +3 -1
  250. package/dist/src/oauth/endpoints/index.js.map +1 -1
  251. package/dist/src/oauth/endpoints/metadata.d.ts +1 -1
  252. package/dist/src/oauth/endpoints/metadata.js +23 -8
  253. package/dist/src/oauth/endpoints/metadata.js.map +1 -1
  254. package/dist/src/oauth/endpoints/register.d.ts +3 -2
  255. package/dist/src/oauth/endpoints/register.js +70 -19
  256. package/dist/src/oauth/endpoints/register.js.map +1 -1
  257. package/dist/src/oauth/endpoints/revoke.d.ts +2 -0
  258. package/dist/src/oauth/endpoints/revoke.js +78 -0
  259. package/dist/src/oauth/endpoints/revoke.js.map +1 -0
  260. package/dist/src/oauth/endpoints/token.js +136 -62
  261. package/dist/src/oauth/endpoints/token.js.map +1 -1
  262. package/dist/src/oauth/gitlab-device-flow.d.ts +27 -8
  263. package/dist/src/oauth/gitlab-device-flow.js +119 -57
  264. package/dist/src/oauth/gitlab-device-flow.js.map +1 -1
  265. package/dist/src/oauth/gitlab-request-bound.d.ts +1 -0
  266. package/dist/src/oauth/gitlab-request-bound.js +6 -0
  267. package/dist/src/oauth/gitlab-request-bound.js.map +1 -0
  268. package/dist/src/oauth/gitlab-token-refresh.d.ts +7 -0
  269. package/dist/src/oauth/gitlab-token-refresh.js +147 -0
  270. package/dist/src/oauth/gitlab-token-refresh.js.map +1 -0
  271. package/dist/src/oauth/grant-revocation.d.ts +10 -0
  272. package/dist/src/oauth/grant-revocation.js +179 -0
  273. package/dist/src/oauth/grant-revocation.js.map +1 -0
  274. package/dist/src/oauth/granted-scopes.d.ts +1 -0
  275. package/dist/src/oauth/granted-scopes.js +7 -0
  276. package/dist/src/oauth/granted-scopes.js.map +1 -0
  277. package/dist/src/oauth/index.d.ts +2 -2
  278. package/dist/src/oauth/index.js +4 -2
  279. package/dist/src/oauth/index.js.map +1 -1
  280. package/dist/src/oauth/instance-app.d.ts +4 -0
  281. package/dist/src/oauth/instance-app.js +45 -0
  282. package/dist/src/oauth/instance-app.js.map +1 -0
  283. package/dist/src/oauth/issued-tokens.d.ts +1 -0
  284. package/dist/src/oauth/issued-tokens.js +24 -0
  285. package/dist/src/oauth/issued-tokens.js.map +1 -0
  286. package/dist/src/oauth/oauth-app.d.ts +9 -0
  287. package/dist/src/oauth/oauth-app.js +14 -0
  288. package/dist/src/oauth/oauth-app.js.map +1 -0
  289. package/dist/src/oauth/request-params.d.ts +1 -0
  290. package/dist/src/oauth/request-params.js +17 -0
  291. package/dist/src/oauth/request-params.js.map +1 -0
  292. package/dist/src/oauth/resource.d.ts +12 -0
  293. package/dist/src/oauth/resource.js +66 -0
  294. package/dist/src/oauth/resource.js.map +1 -0
  295. package/dist/src/oauth/routes.d.ts +2 -0
  296. package/dist/src/oauth/routes.js +31 -0
  297. package/dist/src/oauth/routes.js.map +1 -0
  298. package/dist/src/oauth/session-store.d.ts +51 -36
  299. package/dist/src/oauth/session-store.js +156 -251
  300. package/dist/src/oauth/session-store.js.map +1 -1
  301. package/dist/src/oauth/storage/factory.js +1 -1
  302. package/dist/src/oauth/storage/factory.js.map +1 -1
  303. package/dist/src/oauth/storage/file.d.ts +29 -2
  304. package/dist/src/oauth/storage/file.js +194 -42
  305. package/dist/src/oauth/storage/file.js.map +1 -1
  306. package/dist/src/oauth/storage/memory.d.ts +35 -2
  307. package/dist/src/oauth/storage/memory.js +327 -32
  308. package/dist/src/oauth/storage/memory.js.map +1 -1
  309. package/dist/src/oauth/storage/types.d.ts +37 -1
  310. package/dist/src/oauth/storage/types.js +6 -1
  311. package/dist/src/oauth/storage/types.js.map +1 -1
  312. package/dist/src/oauth/tool-auth.d.ts +12 -0
  313. package/dist/src/oauth/tool-auth.js +108 -0
  314. package/dist/src/oauth/tool-auth.js.map +1 -0
  315. package/dist/src/oauth/types.d.ts +41 -0
  316. package/dist/src/profiles/scope-enforcer.d.ts +8 -0
  317. package/dist/src/profiles/scope-enforcer.js +86 -24
  318. package/dist/src/profiles/scope-enforcer.js.map +1 -1
  319. package/dist/src/profiles/types.js +4 -1
  320. package/dist/src/profiles/types.js.map +1 -1
  321. package/dist/src/registry-manager.d.ts +16 -4
  322. package/dist/src/registry-manager.js +122 -33
  323. package/dist/src/registry-manager.js.map +1 -1
  324. package/dist/src/server.js +82 -50
  325. package/dist/src/server.js.map +1 -1
  326. package/dist/src/services/AdminDetector.d.ts +1 -1
  327. package/dist/src/services/AdminDetector.js +4 -4
  328. package/dist/src/services/AdminDetector.js.map +1 -1
  329. package/dist/src/services/ConnectionManager.d.ts +2 -2
  330. package/dist/src/services/ConnectionManager.js +43 -70
  331. package/dist/src/services/ConnectionManager.js.map +1 -1
  332. package/dist/src/services/HealthMonitor.js +4 -2
  333. package/dist/src/services/HealthMonitor.js.map +1 -1
  334. package/dist/src/services/NamespaceTierDetector.js +26 -27
  335. package/dist/src/services/NamespaceTierDetector.js.map +1 -1
  336. package/dist/src/services/TokenScopeDetector.d.ts +6 -2
  337. package/dist/src/services/TokenScopeDetector.js +22 -3
  338. package/dist/src/services/TokenScopeDetector.js.map +1 -1
  339. package/dist/src/session-manager.d.ts +3 -1
  340. package/dist/src/session-manager.js +43 -10
  341. package/dist/src/session-manager.js.map +1 -1
  342. package/dist/src/types.d.ts +3 -2
  343. package/dist/src/types.js.map +1 -1
  344. package/dist/src/utils/bounded-map.d.ts +1 -0
  345. package/dist/src/utils/bounded-map.js +23 -0
  346. package/dist/src/utils/bounded-map.js.map +1 -0
  347. package/dist/src/utils/fetch.d.ts +1 -2
  348. package/dist/src/utils/fetch.js +12 -17
  349. package/dist/src/utils/fetch.js.map +1 -1
  350. package/dist/src/utils/gitlab-api.js +2 -1
  351. package/dist/src/utils/gitlab-api.js.map +1 -1
  352. package/dist/src/utils/gitlab-base-url.d.ts +2 -0
  353. package/dist/src/utils/gitlab-base-url.js +34 -0
  354. package/dist/src/utils/gitlab-base-url.js.map +1 -0
  355. package/dist/src/utils/html.d.ts +1 -0
  356. package/dist/src/utils/html.js +12 -0
  357. package/dist/src/utils/html.js.map +1 -0
  358. package/dist/src/utils/namespace.d.ts +1 -0
  359. package/dist/src/utils/namespace.js +72 -24
  360. package/dist/src/utils/namespace.js.map +1 -1
  361. package/dist/src/utils/schema-utils.d.ts +5 -3
  362. package/dist/src/utils/schema-utils.js +50 -22
  363. package/dist/src/utils/schema-utils.js.map +1 -1
  364. package/dist/src/utils/smart-user-search.js +2 -1
  365. package/dist/src/utils/smart-user-search.js.map +1 -1
  366. package/dist/src/utils/sync-directory.d.ts +1 -0
  367. package/dist/src/utils/sync-directory.js +49 -0
  368. package/dist/src/utils/sync-directory.js.map +1 -0
  369. package/dist/src/utils/tool-result.d.ts +4 -0
  370. package/dist/src/utils/tool-result.js +41 -0
  371. package/dist/src/utils/tool-result.js.map +1 -0
  372. package/dist/tsconfig.build.tsbuildinfo +1 -1
  373. package/package.json +74 -21
  374. package/plugin/assets/composer-icon-dark.png +0 -0
  375. package/plugin/assets/composer-icon-dark.svg +17 -0
  376. package/plugin/assets/composer-icon.png +0 -0
  377. package/plugin/assets/composer-icon.svg +17 -0
  378. package/plugin/assets/logo.png +0 -0
  379. package/plugin/assets/screenshot-1.png +0 -0
  380. package/plugin/assets/screenshot-2.png +0 -0
  381. package/plugin/schemas/mcp.schema.json +120 -0
  382. package/plugin/schemas/plugin.schema.json +65 -0
  383. package/skills/gitlab-ci/SKILL.md +16 -0
  384. package/skills/gitlab-discovery/SKILL.md +15 -0
  385. package/skills/gitlab-review/SKILL.md +16 -0
  386. package/skills/gitlab-setup/SKILL.md +16 -0
  387. package/skills/gitlab-work-items/SKILL.md +16 -0
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@structured-world/gitlab-mcp)](https://www.npmjs.com/package/@structured-world/gitlab-mcp) [![npm downloads](https://img.shields.io/npm/dm/@structured-world/gitlab-mcp)](https://www.npmjs.com/package/@structured-world/gitlab-mcp) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/structured-world/gitlab-mcp/blob/HEAD/LICENSE) [![Release](https://github.com/structured-world/gitlab-mcp/workflows/Release/badge.svg)](https://github.com/structured-world/gitlab-mcp/actions) [![Coverage](https://codecov.io/gh/structured-world/gitlab-mcp/graph/badge.svg)](https://codecov.io/gh/structured-world/gitlab-mcp) [![Coverage Report](https://img.shields.io/badge/Coverage-Live%20Report-brightgreen?logo=github)](https://gitlab-mcp.sw.foundation/coverage/)
4
4
 
5
- Advanced GitLab MCP server — 58 CQRS tools exposing 231 GitLab operations across 26 entity types. The tool catalog and parameters are filtered to each instance's GitLab version, tier, and token scopes, so the agent sees only what the connected instance actually supports.
5
+ Advanced GitLab MCP server — 64 CQRS tools exposing 234 GitLab operations across 26 entity types. The tool catalog and parameters are filtered to each instance's GitLab version, tier, and token scopes, so the agent sees only what the connected instance actually supports.
6
6
 
7
- [![Install in Claude Desktop](https://img.shields.io/badge/Claude_Desktop-Install_Extension-F97316?style=for-the-badge)](https://gitlab-mcp.sw.foundation/downloads/gitlab-mcp-10.1.0.mcpb)
7
+ [![Install in Claude Desktop](https://img.shields.io/badge/Claude_Desktop-Install_Extension-F97316?style=for-the-badge)](https://gitlab-mcp.sw.foundation/downloads/gitlab-mcp-12.0.0.mcpb)
8
8
  [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP_Server-007ACC?style=for-the-badge&logo=visualstudiocode&logoColor=white)](vscode:mcp/install?%7B%22name%22%3A%22gitlab-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40structured-world%2Fgitlab-mcp%22%5D%7D)
9
9
  [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_MCP_Server-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](vscode-insiders:mcp/install?%7B%22name%22%3A%22gitlab-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40structured-world%2Fgitlab-mcp%22%5D%7D)
10
10
 
@@ -36,10 +36,10 @@ This is a monorepo with two npm packages:
36
36
 
37
37
  ## Highlights
38
38
 
39
- - **58 tools** across 26 entity types — projects, merge requests, pipelines, work items, wiki, and more
39
+ - **64 tools** across 26 entity types — projects, merge requests, pipelines, work items, wiki, and more
40
40
  - **CQRS architecture** — `browse_*` for queries, `manage_*` for commands
41
41
  - **Connection resilience** — Bounded startup, auto-reconnect with exponential backoff, disconnected mode when GitLab is unreachable
42
- - **Multi-instance support** — Connect to GitLab.com, self-managed, and self-hosted instances with per-instance OAuth and rate limiting
42
+ - **Multi-instance support** — Connect to GitLab.com, self-managed, and self-hosted instances with per-instance OAuth and rate limiting; one connection can link several accounts, such as a company GitLab and a personal GitLab.com account, and each chat switches between them
43
43
  - **Multiple transports** — stdio, SSE, StreamableHTTP
44
44
  - **OAuth 2.1** — Per-user authentication via Claude Custom Connector
45
45
  - **Read-only mode** — Safe operation for production environments
@@ -51,8 +51,8 @@ This is a monorepo with two npm packages:
51
51
 
52
52
  GitLab exposes hundreds of API operations. Giving each its own MCP tool floods an
53
53
  agent's context; a thin API wrapper pushes that complexity back onto the agent. This
54
- server takes a third path: 58 CQRS tools, each holding several typed
55
- actions, expose 231 operations across 26 entity types.
54
+ server takes a third path: 64 CQRS tools, each holding several typed
55
+ actions, expose 234 operations across 26 entity types.
56
56
 
57
57
  - `browse_*` tools are read-only queries; `manage_*` tools are writes.
58
58
  - Sub-resources fold into actions rather than new tools — `browse_pipelines` covers
@@ -77,7 +77,7 @@ Full documentation is available at **[gitlab-mcp.sw.foundation](https://gitlab-m
77
77
  | [Installation](https://gitlab-mcp.sw.foundation/guide/installation/npm) | npm, Docker, VS Code, Codex |
78
78
  | [Configuration](https://gitlab-mcp.sw.foundation/guide/configuration) | Environment variables, feature flags |
79
79
  | [Multi-Instance](https://gitlab-mcp.sw.foundation/guide/multi-instance) | Connect to multiple GitLab instances |
80
- | [Tool Reference](https://gitlab-mcp.sw.foundation/tools/) | All 58 tools with parameters |
80
+ | [Tool Reference](https://gitlab-mcp.sw.foundation/tools/) | All 64 tools with parameters |
81
81
  | [OAuth Setup](https://gitlab-mcp.sw.foundation/security/oauth) | Team authentication with Claude |
82
82
  | [TLS/HTTPS](https://gitlab-mcp.sw.foundation/advanced/tls) | Production deployment with SSL |
83
83
  | [Customization](https://gitlab-mcp.sw.foundation/advanced/customization) | Tool descriptions, action filtering |
@@ -114,7 +114,7 @@ docker run -i --rm -e GITLAB_TOKEN=your_token \
114
114
  The server handles GitLab connectivity issues gracefully:
115
115
 
116
116
  - **Bounded startup** — Server starts within `GITLAB_INIT_TIMEOUT_MS` (default 5s) regardless of GitLab availability
117
- - **Disconnected mode** — When GitLab is unreachable (`disconnected`/`failed` state), only the `manage_context` tool is exposed, with local actions such as `whoami`, `switch_profile`, and `set_scope` for diagnostics. During active reconnect (`connecting` state), the full tool list remains available so MCP clients don't lose their tool catalog during brief outages. MCP clients are notified of tool availability changes via `tools/list_changed`
117
+ - **Disconnected mode** — When GitLab is unreachable (`disconnected`/`failed` state), only the `manage_context` tool is exposed, with local actions such as `whoami`, `switch_preset`, and `set_scope` for diagnostics. During active reconnect (`connecting` state), the full tool list remains available so MCP clients don't lose their tool catalog during brief outages. MCP clients are notified of tool availability changes via `tools/list_changed`
118
118
  - **Auto-reconnect** — Exponential backoff reconnection (5s → 60s) with ±10% jitter
119
119
  - **Error classification** — Transient errors (network, 5xx, timeouts) trigger auto-reconnect. Auth/config errors at startup transition to `failed` state (no auto-reconnect). Mid-session token revocation is detected via an authenticated `HEAD /api/v4/user` check that runs alongside each periodic health check (static token mode only; skipped in OAuth mode). A 401 or 403 on this check transitions the instance to `failed` state immediately.
120
120
  - **Instance health monitor** — Each monitored instance URL has its own XState state machine. Untracked OAuth URLs currently pass through as reachable.
package/README.md.in CHANGED
@@ -39,7 +39,7 @@ This is a monorepo with two npm packages:
39
39
  - **__TOOL_COUNT__ tools** across __ENTITY_COUNT__ entity types — projects, merge requests, pipelines, work items, wiki, and more
40
40
  - **CQRS architecture** — `browse_*` for queries, `manage_*` for commands
41
41
  - **Connection resilience** — Bounded startup, auto-reconnect with exponential backoff, disconnected mode when GitLab is unreachable
42
- - **Multi-instance support** — Connect to GitLab.com, self-managed, and self-hosted instances with per-instance OAuth and rate limiting
42
+ - **Multi-instance support** — Connect to GitLab.com, self-managed, and self-hosted instances with per-instance OAuth and rate limiting; one connection can link several accounts, such as a company GitLab and a personal GitLab.com account, and each chat switches between them
43
43
  - **Multiple transports** — stdio, SSE, StreamableHTTP
44
44
  - **OAuth 2.1** — Per-user authentication via Claude Custom Connector
45
45
  - **Read-only mode** — Safe operation for production environments
@@ -114,7 +114,7 @@ docker run -i --rm -e GITLAB_TOKEN=your_token \
114
114
  The server handles GitLab connectivity issues gracefully:
115
115
 
116
116
  - **Bounded startup** — Server starts within `GITLAB_INIT_TIMEOUT_MS` (default 5s) regardless of GitLab availability
117
- - **Disconnected mode** — When GitLab is unreachable (`disconnected`/`failed` state), only the `manage_context` tool is exposed, with local actions such as `whoami`, `switch_profile`, and `set_scope` for diagnostics. During active reconnect (`connecting` state), the full tool list remains available so MCP clients don't lose their tool catalog during brief outages. MCP clients are notified of tool availability changes via `tools/list_changed`
117
+ - **Disconnected mode** — When GitLab is unreachable (`disconnected`/`failed` state), only the `manage_context` tool is exposed, with local actions such as `whoami`, `switch_preset`, and `set_scope` for diagnostics. During active reconnect (`connecting` state), the full tool list remains available so MCP clients don't lose their tool catalog during brief outages. MCP clients are notified of tool availability changes via `tools/list_changed`
118
118
  - **Auto-reconnect** — Exponential backoff reconnection (5s → 60s) with ±10% jitter
119
119
  - **Error classification** — Transient errors (network, 5xx, timeouts) trigger auto-reconnect. Auth/config errors at startup transition to `failed` state (no auto-reconnect). Mid-session token revocation is detected via an authenticated `HEAD /api/v4/user` check that runs alongside each periodic health check (static token mode only; skipped in OAuth mode). A 401 or 403 on this check transitions the instance to `failed` state immediately.
120
120
  - **Instance health monitor** — Each monitored instance URL has its own XState state machine. Untracked OAuth URLs currently pass through as reachable.
@@ -0,0 +1,17 @@
1
+ export interface ChatAccount {
2
+ id: string;
3
+ label: string;
4
+ instanceUrl: string;
5
+ username?: string;
6
+ primary: boolean;
7
+ active: boolean;
8
+ }
9
+ export declare class AccountUnavailableError extends Error {
10
+ constructor(message: string);
11
+ }
12
+ export declare function listChatAccounts(sessionId: string | undefined): Promise<ChatAccount[]>;
13
+ export declare function switchChatAccount(sessionId: string | undefined, accountId: string): Promise<ChatAccount>;
14
+ export declare function unlinkChatAccount(sessionId: string | undefined, accountId: string): Promise<ChatAccount>;
15
+ export declare function forgetChat(sessionId: string): void;
16
+ export declare function withChatAccount<T>(sessionId: string | undefined, fn: () => Promise<T>): Promise<T>;
17
+ export declare function resetChatAccounts(): void;
@@ -0,0 +1,245 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountUnavailableError = void 0;
4
+ exports.listChatAccounts = listChatAccounts;
5
+ exports.switchChatAccount = switchChatAccount;
6
+ exports.unlinkChatAccount = unlinkChatAccount;
7
+ exports.forgetChat = forgetChat;
8
+ exports.withChatAccount = withChatAccount;
9
+ exports.resetChatAccounts = resetChatAccounts;
10
+ const config_1 = require("../config");
11
+ const token_account_1 = require("./token-account");
12
+ const instance_tokens_1 = require("./instance-tokens");
13
+ const InstanceRegistry_1 = require("../services/InstanceRegistry");
14
+ const config_2 = require("../oauth/config");
15
+ const session_store_1 = require("../oauth/session-store");
16
+ const token_context_1 = require("../oauth/token-context");
17
+ const gitlab_token_refresh_1 = require("../oauth/gitlab-token-refresh");
18
+ const grant_revocation_1 = require("../oauth/grant-revocation");
19
+ const profile_1 = require("../entities/context/profile");
20
+ const url_1 = require("../utils/url");
21
+ class AccountUnavailableError extends Error {
22
+ constructor(message) {
23
+ super(message);
24
+ this.name = 'AccountUnavailableError';
25
+ }
26
+ }
27
+ exports.AccountUnavailableError = AccountUnavailableError;
28
+ const SESSIONLESS = 'stdio';
29
+ const selections = new Map();
30
+ const UNLINK_ATTEMPTS = 20;
31
+ const UNLINK_RETRY_MS = 100;
32
+ const UNLINK_LEASE_MS = 15_000;
33
+ function chatKey(sessionId) {
34
+ return sessionId ?? SESSIONLESS;
35
+ }
36
+ function instanceName(instanceUrl, label) {
37
+ if (label)
38
+ return label;
39
+ try {
40
+ return new URL(instanceUrl).host;
41
+ }
42
+ catch {
43
+ return instanceUrl;
44
+ }
45
+ }
46
+ function sessionInstance(session) {
47
+ return (0, url_1.normalizeInstanceUrl)(session.gitlabApiUrl ?? config_1.GITLAB_BASE_URL);
48
+ }
49
+ function oauthAccountId(session) {
50
+ return (0, profile_1.accountProfileId)(sessionInstance(session), session.gitlabUserId);
51
+ }
52
+ function oauthAccount(session, primary, activeId) {
53
+ const instanceUrl = sessionInstance(session);
54
+ const id = oauthAccountId(session);
55
+ return {
56
+ id,
57
+ label: `${session.gitlabUsername} @ ${instanceName(instanceUrl, session.instanceLabel)}`,
58
+ instanceUrl,
59
+ username: session.gitlabUsername,
60
+ primary,
61
+ active: id === activeId,
62
+ };
63
+ }
64
+ async function signedInSession() {
65
+ const context = (0, token_context_1.getTokenContext)();
66
+ const session = context ? await session_store_1.sessionStore.getSession(context.sessionId) : undefined;
67
+ if (!session) {
68
+ throw new AccountUnavailableError('This connection is not signed in to GitLab.');
69
+ }
70
+ return session;
71
+ }
72
+ function tokenAccounts() {
73
+ const primaryUrl = (0, url_1.normalizeInstanceUrl)(config_1.GITLAB_BASE_URL);
74
+ const registry = InstanceRegistry_1.InstanceRegistry.getInstance();
75
+ const accounts = [];
76
+ if (config_1.GITLAB_TOKEN) {
77
+ const primaryLabel = registry.isInitialized()
78
+ ? registry.getConfig(primaryUrl)?.label
79
+ : undefined;
80
+ accounts.push({
81
+ id: primaryUrl,
82
+ instanceUrl: primaryUrl,
83
+ label: instanceName(primaryUrl, primaryLabel),
84
+ token: config_1.GITLAB_TOKEN,
85
+ });
86
+ }
87
+ if (!registry.isInitialized())
88
+ return accounts;
89
+ for (const url of registry.getUrls()) {
90
+ const config = registry.getConfig(url);
91
+ const instanceUrl = (0, url_1.normalizeInstanceUrl)(url);
92
+ const token = (0, instance_tokens_1.configuredInstanceToken)(instanceUrl);
93
+ if (!token || accounts.some((account) => account.instanceUrl === instanceUrl))
94
+ continue;
95
+ accounts.push({
96
+ id: instanceUrl,
97
+ instanceUrl,
98
+ label: instanceName(instanceUrl, config?.label),
99
+ token,
100
+ });
101
+ }
102
+ return accounts;
103
+ }
104
+ async function listChatAccounts(sessionId) {
105
+ const selected = selections.get(chatKey(sessionId));
106
+ if ((0, config_2.isOAuthEnabled)()) {
107
+ const session = await signedInSession();
108
+ const activeId = selected ?? oauthAccountId(session);
109
+ const linked = session_store_1.sessionStore.linksAccounts()
110
+ ? await session_store_1.sessionStore.getLinkedSessions(session.id)
111
+ : [];
112
+ return [
113
+ oauthAccount(session, true, activeId),
114
+ ...linked.map((row) => oauthAccount(row, false, activeId)),
115
+ ];
116
+ }
117
+ const accounts = tokenAccounts();
118
+ const activeId = selected ?? accounts[0]?.id;
119
+ return accounts.map((account, index) => ({
120
+ id: account.id,
121
+ label: account.label,
122
+ instanceUrl: account.instanceUrl,
123
+ primary: index === 0,
124
+ active: account.id === activeId,
125
+ }));
126
+ }
127
+ async function switchChatAccount(sessionId, accountId) {
128
+ const accounts = await listChatAccounts(sessionId);
129
+ const account = accounts.find((candidate) => candidate.id === accountId);
130
+ if (!account) {
131
+ throw new AccountUnavailableError(`No account "${accountId}" in this connection; list them with manage_context list_accounts.`);
132
+ }
133
+ if (account.primary)
134
+ selections.delete(chatKey(sessionId));
135
+ else
136
+ selections.set(chatKey(sessionId), account.id);
137
+ return { ...account, active: true };
138
+ }
139
+ async function unlinkChatAccount(sessionId, accountId) {
140
+ const config = (0, config_2.loadOAuthConfig)();
141
+ if (!(0, config_2.isOAuthEnabled)() || !config) {
142
+ throw new AccountUnavailableError('A server with a static token has no linked accounts; its instances are configured.');
143
+ }
144
+ if (!session_store_1.sessionStore.linksAccounts()) {
145
+ throw new AccountUnavailableError('The session storage of this server cannot keep linked accounts; update the database package.');
146
+ }
147
+ const session = await signedInSession();
148
+ const linked = await session_store_1.sessionStore.getLinkedSessions(session.id);
149
+ const row = linked.find((candidate) => oauthAccountId(candidate) === accountId);
150
+ if (!row) {
151
+ throw new AccountUnavailableError(`No linked account "${accountId}"; the account this connection signed in with cannot be unlinked.`);
152
+ }
153
+ if (selections.get(chatKey(sessionId)) === accountId) {
154
+ throw new AccountUnavailableError('This chat works with that account now; switch to another account first.');
155
+ }
156
+ const accessToken = await removeLinkedRow(row.id, config);
157
+ if (accessToken)
158
+ await (0, grant_revocation_1.revokeGitLabGrant)(row, accessToken, config);
159
+ return oauthAccount(row, false, '');
160
+ }
161
+ async function removeLinkedRow(rowId, config, attempt = 1) {
162
+ const stored = await session_store_1.sessionStore.getSession(rowId);
163
+ if (!stored)
164
+ return undefined;
165
+ const accessToken = await (0, grant_revocation_1.liveGitLabAccessToken)(stored, config);
166
+ const current = await session_store_1.sessionStore.getSession(rowId);
167
+ if (!current)
168
+ return undefined;
169
+ if (current.gitlabAccessToken === accessToken) {
170
+ const now = Date.now();
171
+ const leaseUntil = now + UNLINK_LEASE_MS;
172
+ const refreshToken = current.gitlabRefreshToken;
173
+ if (await session_store_1.sessionStore.claimGitLabRefresh(rowId, refreshToken, now, leaseUntil)) {
174
+ try {
175
+ await session_store_1.sessionStore.deleteSession(rowId);
176
+ return accessToken;
177
+ }
178
+ finally {
179
+ await session_store_1.sessionStore.releaseGitLabRefresh(rowId, leaseUntil).catch(() => undefined);
180
+ }
181
+ }
182
+ }
183
+ if (attempt >= UNLINK_ATTEMPTS) {
184
+ throw new AccountUnavailableError('The account is being changed elsewhere (a sign-in or a token refresh); try again.');
185
+ }
186
+ await new Promise((resolve) => setTimeout(resolve, UNLINK_RETRY_MS));
187
+ return removeLinkedRow(rowId, config, attempt + 1);
188
+ }
189
+ function forgetChat(sessionId) {
190
+ selections.delete(sessionId);
191
+ }
192
+ async function linkedAccountContext(context, accountId) {
193
+ const config = (0, config_2.loadOAuthConfig)();
194
+ const row = (await session_store_1.sessionStore.getLinkedSessions(context.sessionId)).find((candidate) => oauthAccountId(candidate) === accountId);
195
+ if (!row || !config) {
196
+ throw new AccountUnavailableError('The account this chat switched to is no longer linked; switch to another account or link it again.');
197
+ }
198
+ let fresh;
199
+ try {
200
+ fresh = await (0, gitlab_token_refresh_1.withFreshGitLabToken)(row, config);
201
+ }
202
+ catch (error) {
203
+ if (error instanceof gitlab_token_refresh_1.GitLabGrantRevokedError) {
204
+ throw new AccountUnavailableError(`GitLab no longer accepts the sign-in of ${row.gitlabUsername}; link the account again with manage_context link_account.`);
205
+ }
206
+ const reason = error instanceof Error ? error.message : String(error);
207
+ throw new AccountUnavailableError(`The sign-in of ${row.gitlabUsername} could not be refreshed now (${reason}); try again.`);
208
+ }
209
+ if (!fresh) {
210
+ throw new AccountUnavailableError('The account this chat switched to is no longer linked; switch to another account or link it again.');
211
+ }
212
+ return {
213
+ ...context,
214
+ gitlabToken: fresh.gitlabAccessToken,
215
+ gitlabUserId: fresh.gitlabUserId,
216
+ gitlabUsername: fresh.gitlabUsername,
217
+ gitlabScopes: fresh.gitlabScopes,
218
+ apiUrl: sessionInstance(fresh),
219
+ instanceLabel: fresh.instanceLabel,
220
+ };
221
+ }
222
+ async function withChatAccount(sessionId, fn) {
223
+ const selected = selections.get(chatKey(sessionId));
224
+ if (!selected)
225
+ return fn();
226
+ if ((0, config_2.isOAuthEnabled)()) {
227
+ const context = (0, token_context_1.getTokenContext)();
228
+ if (!context)
229
+ return fn();
230
+ if (selected === (0, profile_1.accountProfileId)((0, url_1.normalizeInstanceUrl)(context.apiUrl), context.gitlabUserId)) {
231
+ return fn();
232
+ }
233
+ const accountContext = await linkedAccountContext(context, selected);
234
+ return (0, token_context_1.runWithTokenContext)(accountContext, fn);
235
+ }
236
+ const account = tokenAccounts().find((candidate) => candidate.id === selected);
237
+ if (!account) {
238
+ throw new AccountUnavailableError('The instance this chat switched to is no longer configured with a token; switch to another account.');
239
+ }
240
+ return (0, token_account_1.runWithTokenAccount)({ instanceUrl: account.instanceUrl, token: account.token }, fn);
241
+ }
242
+ function resetChatAccounts() {
243
+ selections.clear();
244
+ }
245
+ //# sourceMappingURL=chat-accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-accounts.js","source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AAC,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function configuredInstanceToken(instanceUrl: string): string | undefined;
2
+ export declare function configuredInstanceFor(requestUrl: string): string | undefined;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configuredInstanceToken = configuredInstanceToken;
4
+ exports.configuredInstanceFor = configuredInstanceFor;
5
+ const config_1 = require("../config");
6
+ const InstanceRegistry_1 = require("../services/InstanceRegistry");
7
+ const url_1 = require("../utils/url");
8
+ function configuredInstanceToken(instanceUrl) {
9
+ const url = (0, url_1.normalizeInstanceUrl)(instanceUrl);
10
+ if (url === serverInstance())
11
+ return config_1.GITLAB_TOKEN;
12
+ const registry = InstanceRegistry_1.InstanceRegistry.getInstance();
13
+ if (!registry.isInitialized())
14
+ return undefined;
15
+ const tokenEnv = registry.getConfig(url)?.tokenEnv;
16
+ const token = tokenEnv ? process.env[tokenEnv] : undefined;
17
+ return token === '' ? undefined : token;
18
+ }
19
+ function configuredInstanceFor(requestUrl) {
20
+ let match = belongsTo(requestUrl, serverInstance()) ? serverInstance() : undefined;
21
+ const registry = InstanceRegistry_1.InstanceRegistry.getInstance();
22
+ if (!registry.isInitialized())
23
+ return match;
24
+ for (const base of registry.getUrls()) {
25
+ if (belongsTo(requestUrl, base) && (!match || base.length > match.length))
26
+ match = base;
27
+ }
28
+ return match;
29
+ }
30
+ function belongsTo(requestUrl, base) {
31
+ if (!base || !requestUrl.startsWith(base))
32
+ return false;
33
+ const next = requestUrl.charAt(base.length);
34
+ return next === '' || next === '/' || next === '?' || next === '#';
35
+ }
36
+ let normalizedServerInstance;
37
+ function serverInstance() {
38
+ if (normalizedServerInstance === undefined && config_1.GITLAB_BASE_URL) {
39
+ normalizedServerInstance = (0, url_1.normalizeInstanceUrl)(config_1.GITLAB_BASE_URL);
40
+ }
41
+ return normalizedServerInstance;
42
+ }
43
+ //# sourceMappingURL=instance-tokens.js.map
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;YAAE,KAAK,GAAG,IAAI,CAAC;IAC1F,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,SAAS,SAAS,CAAC,UAAkB,EAAE,IAAwB;IAC7D,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC;AACrE,CAAC;AAED,IAAI,wBAA4C,CAAC;AAGjD,SAAS,cAAc;IACrB,IAAI,wBAAwB,KAAK,SAAS,IAAI,wBAAe,EAAE,CAAC;QAC9D,wBAAwB,GAAG,IAAA,0BAAoB,EAAC,wBAAe,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Response } from 'express';
2
+ import type { OAuthConfig } from '../oauth/config';
3
+ import type { AuthCodeFlowState } from '../oauth/types';
4
+ export interface LinkElicitation {
5
+ mcpSessionId: string;
6
+ elicitationId: string;
7
+ }
8
+ export interface AccountLinkStart {
9
+ url: string;
10
+ instanceUrl: string;
11
+ instanceLabel?: string;
12
+ expiresAt: number;
13
+ }
14
+ export declare function startAccountLink(instance: string | undefined, elicitation?: LinkElicitation): Promise<AccountLinkStart>;
15
+ export declare function failAccountLink(res: Response, message: string): void;
16
+ export declare function completeAccountLink(res: Response, state: string, flow: AuthCodeFlowState, code: string, config: OAuthConfig): Promise<void>;