gitlab-mcp-test 6.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/LICENSE +202 -0
  2. package/LICENSE.MIT +21 -0
  3. package/README.md +122 -0
  4. package/README.md.in +122 -0
  5. package/dist/generated/prisma/client.d.ts +13 -0
  6. package/dist/generated/prisma/client.js +46 -0
  7. package/dist/generated/prisma/client.js.map +1 -0
  8. package/dist/generated/prisma/commonInputTypes.d.ts +245 -0
  9. package/dist/generated/prisma/commonInputTypes.js +3 -0
  10. package/dist/generated/prisma/commonInputTypes.js.map +1 -0
  11. package/dist/generated/prisma/enums.d.ts +1 -0
  12. package/dist/generated/prisma/enums.js +3 -0
  13. package/dist/generated/prisma/enums.js.map +1 -0
  14. package/dist/generated/prisma/internal/class.d.ts +47 -0
  15. package/dist/generated/prisma/internal/class.js +75 -0
  16. package/dist/generated/prisma/internal/class.js.map +1 -0
  17. package/dist/generated/prisma/internal/prismaNamespace.d.ts +714 -0
  18. package/dist/generated/prisma/internal/prismaNamespace.js +141 -0
  19. package/dist/generated/prisma/internal/prismaNamespace.js.map +1 -0
  20. package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +513 -0
  21. package/dist/generated/prisma/models/AuthCodeFlowState.js +3 -0
  22. package/dist/generated/prisma/models/AuthCodeFlowState.js.map +1 -0
  23. package/dist/generated/prisma/models/AuthorizationCode.d.ts +641 -0
  24. package/dist/generated/prisma/models/AuthorizationCode.js +3 -0
  25. package/dist/generated/prisma/models/AuthorizationCode.js.map +1 -0
  26. package/dist/generated/prisma/models/DeviceFlowState.d.ts +603 -0
  27. package/dist/generated/prisma/models/DeviceFlowState.js +3 -0
  28. package/dist/generated/prisma/models/DeviceFlowState.js.map +1 -0
  29. package/dist/generated/prisma/models/McpSessionMapping.d.ts +438 -0
  30. package/dist/generated/prisma/models/McpSessionMapping.js +3 -0
  31. package/dist/generated/prisma/models/McpSessionMapping.js.map +1 -0
  32. package/dist/generated/prisma/models/OAuthSession.d.ts +1037 -0
  33. package/dist/generated/prisma/models/OAuthSession.js +3 -0
  34. package/dist/generated/prisma/models/OAuthSession.js.map +1 -0
  35. package/dist/generated/prisma/models.d.ts +6 -0
  36. package/dist/generated/prisma/models.js +3 -0
  37. package/dist/generated/prisma/models.js.map +1 -0
  38. package/dist/src/cli/docker/container-runtime.d.ts +4 -0
  39. package/dist/src/cli/docker/container-runtime.js +85 -0
  40. package/dist/src/cli/docker/container-runtime.js.map +1 -0
  41. package/dist/src/cli/docker/docker-command.d.ts +15 -0
  42. package/dist/src/cli/docker/docker-command.js +421 -0
  43. package/dist/src/cli/docker/docker-command.js.map +1 -0
  44. package/dist/src/cli/docker/docker-utils.d.ts +25 -0
  45. package/dist/src/cli/docker/docker-utils.js +386 -0
  46. package/dist/src/cli/docker/docker-utils.js.map +1 -0
  47. package/dist/src/cli/docker/index.d.ts +4 -0
  48. package/dist/src/cli/docker/index.js +24 -0
  49. package/dist/src/cli/docker/index.js.map +1 -0
  50. package/dist/src/cli/docker/types.d.ts +83 -0
  51. package/dist/src/cli/docker/types.js +21 -0
  52. package/dist/src/cli/docker/types.js.map +1 -0
  53. package/dist/src/cli/init/browser.d.ts +7 -0
  54. package/dist/src/cli/init/browser.js +27 -0
  55. package/dist/src/cli/init/browser.js.map +1 -0
  56. package/dist/src/cli/init/config-generator.d.ts +11 -0
  57. package/dist/src/cli/init/config-generator.js +87 -0
  58. package/dist/src/cli/init/config-generator.js.map +1 -0
  59. package/dist/src/cli/init/connection.d.ts +8 -0
  60. package/dist/src/cli/init/connection.js +118 -0
  61. package/dist/src/cli/init/connection.js.map +1 -0
  62. package/dist/src/cli/init/index.d.ts +4 -0
  63. package/dist/src/cli/init/index.js +32 -0
  64. package/dist/src/cli/init/index.js.map +1 -0
  65. package/dist/src/cli/init/types.d.ts +31 -0
  66. package/dist/src/cli/init/types.js +66 -0
  67. package/dist/src/cli/init/types.js.map +1 -0
  68. package/dist/src/cli/init/wizard.d.ts +1 -0
  69. package/dist/src/cli/init/wizard.js +283 -0
  70. package/dist/src/cli/init/wizard.js.map +1 -0
  71. package/dist/src/cli/inject-tool-refs.d.ts +35 -0
  72. package/dist/src/cli/inject-tool-refs.js +261 -0
  73. package/dist/src/cli/inject-tool-refs.js.map +1 -0
  74. package/dist/src/cli/install/backup.d.ts +4 -0
  75. package/dist/src/cli/install/backup.js +63 -0
  76. package/dist/src/cli/install/backup.js.map +1 -0
  77. package/dist/src/cli/install/detector.d.ts +10 -0
  78. package/dist/src/cli/install/detector.js +133 -0
  79. package/dist/src/cli/install/detector.js.map +1 -0
  80. package/dist/src/cli/install/index.d.ts +5 -0
  81. package/dist/src/cli/install/index.js +27 -0
  82. package/dist/src/cli/install/index.js.map +1 -0
  83. package/dist/src/cli/install/install-command.d.ts +19 -0
  84. package/dist/src/cli/install/install-command.js +300 -0
  85. package/dist/src/cli/install/install-command.js.map +1 -0
  86. package/dist/src/cli/install/installers.d.ts +12 -0
  87. package/dist/src/cli/install/installers.js +439 -0
  88. package/dist/src/cli/install/installers.js.map +1 -0
  89. package/dist/src/cli/install/types.d.ts +52 -0
  90. package/dist/src/cli/install/types.js +87 -0
  91. package/dist/src/cli/install/types.js.map +1 -0
  92. package/dist/src/cli/instances/index.d.ts +2 -0
  93. package/dist/src/cli/instances/index.js +7 -0
  94. package/dist/src/cli/instances/index.js.map +1 -0
  95. package/dist/src/cli/instances/instances-command.d.ts +6 -0
  96. package/dist/src/cli/instances/instances-command.js +351 -0
  97. package/dist/src/cli/instances/instances-command.js.map +1 -0
  98. package/dist/src/cli/list-tools.d.ts +2 -0
  99. package/dist/src/cli/list-tools.js +1431 -0
  100. package/dist/src/cli/list-tools.js.map +1 -0
  101. package/dist/src/cli/setup/discovery.d.ts +3 -0
  102. package/dist/src/cli/setup/discovery.js +71 -0
  103. package/dist/src/cli/setup/discovery.js.map +1 -0
  104. package/dist/src/cli/setup/flows/configure-existing.d.ts +2 -0
  105. package/dist/src/cli/setup/flows/configure-existing.js +211 -0
  106. package/dist/src/cli/setup/flows/configure-existing.js.map +1 -0
  107. package/dist/src/cli/setup/flows/local-setup.d.ts +2 -0
  108. package/dist/src/cli/setup/flows/local-setup.js +206 -0
  109. package/dist/src/cli/setup/flows/local-setup.js.map +1 -0
  110. package/dist/src/cli/setup/flows/server-setup.d.ts +2 -0
  111. package/dist/src/cli/setup/flows/server-setup.js +185 -0
  112. package/dist/src/cli/setup/flows/server-setup.js.map +1 -0
  113. package/dist/src/cli/setup/flows/tool-selection.d.ts +3 -0
  114. package/dist/src/cli/setup/flows/tool-selection.js +275 -0
  115. package/dist/src/cli/setup/flows/tool-selection.js.map +1 -0
  116. package/dist/src/cli/setup/index.d.ts +4 -0
  117. package/dist/src/cli/setup/index.js +29 -0
  118. package/dist/src/cli/setup/index.js.map +1 -0
  119. package/dist/src/cli/setup/presets.d.ts +7 -0
  120. package/dist/src/cli/setup/presets.js +261 -0
  121. package/dist/src/cli/setup/presets.js.map +1 -0
  122. package/dist/src/cli/setup/types.d.ts +68 -0
  123. package/dist/src/cli/setup/types.js +3 -0
  124. package/dist/src/cli/setup/types.js.map +1 -0
  125. package/dist/src/cli/setup/wizard.d.ts +4 -0
  126. package/dist/src/cli/setup/wizard.js +128 -0
  127. package/dist/src/cli/setup/wizard.js.map +1 -0
  128. package/dist/src/cli/utils/index.d.ts +1 -0
  129. package/dist/src/cli/utils/index.js +6 -0
  130. package/dist/src/cli/utils/index.js.map +1 -0
  131. package/dist/src/cli/utils/path-utils.d.ts +1 -0
  132. package/dist/src/cli/utils/path-utils.js +18 -0
  133. package/dist/src/cli/utils/path-utils.js.map +1 -0
  134. package/dist/src/cli-utils.d.ts +19 -0
  135. package/dist/src/cli-utils.js +183 -0
  136. package/dist/src/cli-utils.js.map +1 -0
  137. package/dist/src/config/index.d.ts +4 -0
  138. package/dist/src/config/index.js +19 -0
  139. package/dist/src/config/index.js.map +1 -0
  140. package/dist/src/config/instances-loader.d.ts +10 -0
  141. package/dist/src/config/instances-loader.js +294 -0
  142. package/dist/src/config/instances-loader.js.map +1 -0
  143. package/dist/src/config/instances-schema.d.ts +89 -0
  144. package/dist/src/config/instances-schema.js +196 -0
  145. package/dist/src/config/instances-schema.js.map +1 -0
  146. package/dist/src/config.d.ts +82 -0
  147. package/dist/src/config.js +379 -0
  148. package/dist/src/config.js.map +1 -0
  149. package/dist/src/dashboard/handler.d.ts +4 -0
  150. package/dist/src/dashboard/handler.js +37 -0
  151. package/dist/src/dashboard/handler.js.map +1 -0
  152. package/dist/src/dashboard/html-template.d.ts +2 -0
  153. package/dist/src/dashboard/html-template.js +443 -0
  154. package/dist/src/dashboard/html-template.js.map +1 -0
  155. package/dist/src/dashboard/index.d.ts +4 -0
  156. package/dist/src/dashboard/index.js +15 -0
  157. package/dist/src/dashboard/index.js.map +1 -0
  158. package/dist/src/dashboard/metrics.d.ts +79 -0
  159. package/dist/src/dashboard/metrics.js +194 -0
  160. package/dist/src/dashboard/metrics.js.map +1 -0
  161. package/dist/src/discovery/auto.d.ts +22 -0
  162. package/dist/src/discovery/auto.js +170 -0
  163. package/dist/src/discovery/auto.js.map +1 -0
  164. package/dist/src/discovery/git-remote.d.ts +19 -0
  165. package/dist/src/discovery/git-remote.js +197 -0
  166. package/dist/src/discovery/git-remote.js.map +1 -0
  167. package/dist/src/discovery/index.d.ts +3 -0
  168. package/dist/src/discovery/index.js +16 -0
  169. package/dist/src/discovery/index.js.map +1 -0
  170. package/dist/src/discovery/profile-matcher.d.ts +8 -0
  171. package/dist/src/discovery/profile-matcher.js +48 -0
  172. package/dist/src/discovery/profile-matcher.js.map +1 -0
  173. package/dist/src/entities/context/context-manager.d.ts +31 -0
  174. package/dist/src/entities/context/context-manager.js +352 -0
  175. package/dist/src/entities/context/context-manager.js.map +1 -0
  176. package/dist/src/entities/context/handlers.d.ts +11 -0
  177. package/dist/src/entities/context/handlers.js +67 -0
  178. package/dist/src/entities/context/handlers.js.map +1 -0
  179. package/dist/src/entities/context/index.d.ts +11 -0
  180. package/dist/src/entities/context/index.js +34 -0
  181. package/dist/src/entities/context/index.js.map +1 -0
  182. package/dist/src/entities/context/registry.d.ts +5 -0
  183. package/dist/src/entities/context/registry.js +66 -0
  184. package/dist/src/entities/context/registry.js.map +1 -0
  185. package/dist/src/entities/context/schema.d.ts +60 -0
  186. package/dist/src/entities/context/schema.js +61 -0
  187. package/dist/src/entities/context/schema.js.map +1 -0
  188. package/dist/src/entities/context/types.d.ts +112 -0
  189. package/dist/src/entities/context/types.js +3 -0
  190. package/dist/src/entities/context/types.js.map +1 -0
  191. package/dist/src/entities/context/whoami.d.ts +2 -0
  192. package/dist/src/entities/context/whoami.js +267 -0
  193. package/dist/src/entities/context/whoami.js.map +1 -0
  194. package/dist/src/entities/core/index.d.ts +7 -0
  195. package/dist/src/entities/core/index.js +31 -0
  196. package/dist/src/entities/core/index.js.map +1 -0
  197. package/dist/src/entities/core/registry.d.ts +5 -0
  198. package/dist/src/entities/core/registry.js +784 -0
  199. package/dist/src/entities/core/registry.js.map +1 -0
  200. package/dist/src/entities/core/schema-readonly.d.ts +268 -0
  201. package/dist/src/entities/core/schema-readonly.js +289 -0
  202. package/dist/src/entities/core/schema-readonly.js.map +1 -0
  203. package/dist/src/entities/core/schema.d.ts +116 -0
  204. package/dist/src/entities/core/schema.js +173 -0
  205. package/dist/src/entities/core/schema.js.map +1 -0
  206. package/dist/src/entities/files/index.d.ts +7 -0
  207. package/dist/src/entities/files/index.js +31 -0
  208. package/dist/src/entities/files/index.js.map +1 -0
  209. package/dist/src/entities/files/registry.d.ts +5 -0
  210. package/dist/src/entities/files/registry.js +267 -0
  211. package/dist/src/entities/files/registry.js.map +1 -0
  212. package/dist/src/entities/files/schema-readonly.d.ts +83 -0
  213. package/dist/src/entities/files/schema-readonly.js +64 -0
  214. package/dist/src/entities/files/schema-readonly.js.map +1 -0
  215. package/dist/src/entities/files/schema.d.ts +43 -0
  216. package/dist/src/entities/files/schema.js +54 -0
  217. package/dist/src/entities/files/schema.js.map +1 -0
  218. package/dist/src/entities/index.d.ts +17 -0
  219. package/dist/src/entities/index.js +34 -0
  220. package/dist/src/entities/index.js.map +1 -0
  221. package/dist/src/entities/integrations/index.d.ts +4 -0
  222. package/dist/src/entities/integrations/index.js +21 -0
  223. package/dist/src/entities/integrations/index.js.map +1 -0
  224. package/dist/src/entities/integrations/registry.d.ts +5 -0
  225. package/dist/src/entities/integrations/registry.js +127 -0
  226. package/dist/src/entities/integrations/registry.js.map +1 -0
  227. package/dist/src/entities/integrations/schema-readonly.d.ts +63 -0
  228. package/dist/src/entities/integrations/schema-readonly.js +22 -0
  229. package/dist/src/entities/integrations/schema-readonly.js.map +1 -0
  230. package/dist/src/entities/integrations/schema.d.ts +180 -0
  231. package/dist/src/entities/integrations/schema.js +106 -0
  232. package/dist/src/entities/integrations/schema.js.map +1 -0
  233. package/dist/src/entities/iterations/index.d.ts +2 -0
  234. package/dist/src/entities/iterations/index.js +19 -0
  235. package/dist/src/entities/iterations/index.js.map +1 -0
  236. package/dist/src/entities/iterations/registry.d.ts +5 -0
  237. package/dist/src/entities/iterations/registry.js +106 -0
  238. package/dist/src/entities/iterations/registry.js.map +1 -0
  239. package/dist/src/entities/iterations/schema-readonly.d.ts +21 -0
  240. package/dist/src/entities/iterations/schema-readonly.js +28 -0
  241. package/dist/src/entities/iterations/schema-readonly.js.map +1 -0
  242. package/dist/src/entities/labels/index.d.ts +7 -0
  243. package/dist/src/entities/labels/index.js +31 -0
  244. package/dist/src/entities/labels/index.js.map +1 -0
  245. package/dist/src/entities/labels/registry.d.ts +5 -0
  246. package/dist/src/entities/labels/registry.js +131 -0
  247. package/dist/src/entities/labels/registry.js.map +1 -0
  248. package/dist/src/entities/labels/schema-readonly.d.ts +16 -0
  249. package/dist/src/entities/labels/schema-readonly.js +28 -0
  250. package/dist/src/entities/labels/schema-readonly.js.map +1 -0
  251. package/dist/src/entities/labels/schema.d.ts +23 -0
  252. package/dist/src/entities/labels/schema.js +46 -0
  253. package/dist/src/entities/labels/schema.js.map +1 -0
  254. package/dist/src/entities/members/index.d.ts +3 -0
  255. package/dist/src/entities/members/index.js +25 -0
  256. package/dist/src/entities/members/index.js.map +1 -0
  257. package/dist/src/entities/members/registry.d.ts +5 -0
  258. package/dist/src/entities/members/registry.js +224 -0
  259. package/dist/src/entities/members/registry.js.map +1 -0
  260. package/dist/src/entities/members/schema-readonly.d.ts +53 -0
  261. package/dist/src/entities/members/schema-readonly.js +79 -0
  262. package/dist/src/entities/members/schema-readonly.js.map +1 -0
  263. package/dist/src/entities/members/schema.d.ts +40 -0
  264. package/dist/src/entities/members/schema.js +80 -0
  265. package/dist/src/entities/members/schema.js.map +1 -0
  266. package/dist/src/entities/milestones/index.d.ts +7 -0
  267. package/dist/src/entities/milestones/index.js +31 -0
  268. package/dist/src/entities/milestones/index.js.map +1 -0
  269. package/dist/src/entities/milestones/registry.d.ts +5 -0
  270. package/dist/src/entities/milestones/registry.js +150 -0
  271. package/dist/src/entities/milestones/registry.js.map +1 -0
  272. package/dist/src/entities/milestones/schema-readonly.d.ts +57 -0
  273. package/dist/src/entities/milestones/schema-readonly.js +81 -0
  274. package/dist/src/entities/milestones/schema-readonly.js.map +1 -0
  275. package/dist/src/entities/milestones/schema.d.ts +30 -0
  276. package/dist/src/entities/milestones/schema.js +47 -0
  277. package/dist/src/entities/milestones/schema.js.map +1 -0
  278. package/dist/src/entities/mrs/index.d.ts +7 -0
  279. package/dist/src/entities/mrs/index.js +31 -0
  280. package/dist/src/entities/mrs/index.js.map +1 -0
  281. package/dist/src/entities/mrs/registry.d.ts +22 -0
  282. package/dist/src/entities/mrs/registry.js +495 -0
  283. package/dist/src/entities/mrs/registry.js.map +1 -0
  284. package/dist/src/entities/mrs/schema-readonly.d.ts +135 -0
  285. package/dist/src/entities/mrs/schema-readonly.js +326 -0
  286. package/dist/src/entities/mrs/schema-readonly.js.map +1 -0
  287. package/dist/src/entities/mrs/schema.d.ts +339 -0
  288. package/dist/src/entities/mrs/schema.js +259 -0
  289. package/dist/src/entities/mrs/schema.js.map +1 -0
  290. package/dist/src/entities/pipelines/index.d.ts +7 -0
  291. package/dist/src/entities/pipelines/index.js +31 -0
  292. package/dist/src/entities/pipelines/index.js.map +1 -0
  293. package/dist/src/entities/pipelines/registry.d.ts +5 -0
  294. package/dist/src/entities/pipelines/registry.js +323 -0
  295. package/dist/src/entities/pipelines/registry.js.map +1 -0
  296. package/dist/src/entities/pipelines/schema-readonly.d.ts +239 -0
  297. package/dist/src/entities/pipelines/schema-readonly.js +278 -0
  298. package/dist/src/entities/pipelines/schema-readonly.js.map +1 -0
  299. package/dist/src/entities/pipelines/schema.d.ts +47 -0
  300. package/dist/src/entities/pipelines/schema.js +73 -0
  301. package/dist/src/entities/pipelines/schema.js.map +1 -0
  302. package/dist/src/entities/refs/index.d.ts +3 -0
  303. package/dist/src/entities/refs/index.js +25 -0
  304. package/dist/src/entities/refs/index.js.map +1 -0
  305. package/dist/src/entities/refs/registry.d.ts +5 -0
  306. package/dist/src/entities/refs/registry.js +233 -0
  307. package/dist/src/entities/refs/registry.js.map +1 -0
  308. package/dist/src/entities/refs/schema-readonly.d.ts +48 -0
  309. package/dist/src/entities/refs/schema-readonly.js +76 -0
  310. package/dist/src/entities/refs/schema-readonly.js.map +1 -0
  311. package/dist/src/entities/refs/schema.d.ts +85 -0
  312. package/dist/src/entities/refs/schema.js +149 -0
  313. package/dist/src/entities/refs/schema.js.map +1 -0
  314. package/dist/src/entities/releases/index.d.ts +3 -0
  315. package/dist/src/entities/releases/index.js +13 -0
  316. package/dist/src/entities/releases/index.js.map +1 -0
  317. package/dist/src/entities/releases/registry.d.ts +5 -0
  318. package/dist/src/entities/releases/registry.js +183 -0
  319. package/dist/src/entities/releases/registry.js.map +1 -0
  320. package/dist/src/entities/releases/schema-readonly.d.ts +28 -0
  321. package/dist/src/entities/releases/schema-readonly.js +56 -0
  322. package/dist/src/entities/releases/schema-readonly.js.map +1 -0
  323. package/dist/src/entities/releases/schema.d.ts +56 -0
  324. package/dist/src/entities/releases/schema.js +97 -0
  325. package/dist/src/entities/releases/schema.js.map +1 -0
  326. package/dist/src/entities/search/index.d.ts +2 -0
  327. package/dist/src/entities/search/index.js +24 -0
  328. package/dist/src/entities/search/index.js.map +1 -0
  329. package/dist/src/entities/search/registry.d.ts +5 -0
  330. package/dist/src/entities/search/registry.js +113 -0
  331. package/dist/src/entities/search/registry.js.map +1 -0
  332. package/dist/src/entities/search/schema-readonly.d.ts +228 -0
  333. package/dist/src/entities/search/schema-readonly.js +64 -0
  334. package/dist/src/entities/search/schema-readonly.js.map +1 -0
  335. package/dist/src/entities/shared.d.ts +291 -0
  336. package/dist/src/entities/shared.js +269 -0
  337. package/dist/src/entities/shared.js.map +1 -0
  338. package/dist/src/entities/snippets/index.d.ts +7 -0
  339. package/dist/src/entities/snippets/index.js +31 -0
  340. package/dist/src/entities/snippets/index.js.map +1 -0
  341. package/dist/src/entities/snippets/registry.d.ts +5 -0
  342. package/dist/src/entities/snippets/registry.js +200 -0
  343. package/dist/src/entities/snippets/registry.js.map +1 -0
  344. package/dist/src/entities/snippets/schema-readonly.d.ts +25 -0
  345. package/dist/src/entities/snippets/schema-readonly.js +45 -0
  346. package/dist/src/entities/snippets/schema-readonly.js.map +1 -0
  347. package/dist/src/entities/snippets/schema.d.ts +56 -0
  348. package/dist/src/entities/snippets/schema.js +89 -0
  349. package/dist/src/entities/snippets/schema.js.map +1 -0
  350. package/dist/src/entities/utils.d.ts +16 -0
  351. package/dist/src/entities/utils.js +57 -0
  352. package/dist/src/entities/utils.js.map +1 -0
  353. package/dist/src/entities/variables/index.d.ts +7 -0
  354. package/dist/src/entities/variables/index.js +31 -0
  355. package/dist/src/entities/variables/index.js.map +1 -0
  356. package/dist/src/entities/variables/registry.d.ts +5 -0
  357. package/dist/src/entities/variables/registry.js +140 -0
  358. package/dist/src/entities/variables/registry.js.map +1 -0
  359. package/dist/src/entities/variables/schema-readonly.d.ts +15 -0
  360. package/dist/src/entities/variables/schema-readonly.js +33 -0
  361. package/dist/src/entities/variables/schema-readonly.js.map +1 -0
  362. package/dist/src/entities/variables/schema.d.ts +41 -0
  363. package/dist/src/entities/variables/schema.js +92 -0
  364. package/dist/src/entities/variables/schema.js.map +1 -0
  365. package/dist/src/entities/webhooks/index.d.ts +4 -0
  366. package/dist/src/entities/webhooks/index.js +21 -0
  367. package/dist/src/entities/webhooks/index.js.map +1 -0
  368. package/dist/src/entities/webhooks/registry.d.ts +5 -0
  369. package/dist/src/entities/webhooks/registry.js +162 -0
  370. package/dist/src/entities/webhooks/registry.js.map +1 -0
  371. package/dist/src/entities/webhooks/schema-readonly.d.ts +22 -0
  372. package/dist/src/entities/webhooks/schema-readonly.js +25 -0
  373. package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
  374. package/dist/src/entities/webhooks/schema.d.ts +101 -0
  375. package/dist/src/entities/webhooks/schema.js +101 -0
  376. package/dist/src/entities/webhooks/schema.js.map +1 -0
  377. package/dist/src/entities/wiki/index.d.ts +7 -0
  378. package/dist/src/entities/wiki/index.js +31 -0
  379. package/dist/src/entities/wiki/index.js.map +1 -0
  380. package/dist/src/entities/wiki/registry.d.ts +5 -0
  381. package/dist/src/entities/wiki/registry.js +127 -0
  382. package/dist/src/entities/wiki/registry.js.map +1 -0
  383. package/dist/src/entities/wiki/schema-readonly.d.ts +22 -0
  384. package/dist/src/entities/wiki/schema-readonly.js +27 -0
  385. package/dist/src/entities/wiki/schema-readonly.js.map +1 -0
  386. package/dist/src/entities/wiki/schema.d.ts +30 -0
  387. package/dist/src/entities/wiki/schema.js +38 -0
  388. package/dist/src/entities/wiki/schema.js.map +1 -0
  389. package/dist/src/entities/workitems/index.d.ts +7 -0
  390. package/dist/src/entities/workitems/index.js +31 -0
  391. package/dist/src/entities/workitems/index.js.map +1 -0
  392. package/dist/src/entities/workitems/registry.d.ts +5 -0
  393. package/dist/src/entities/workitems/registry.js +725 -0
  394. package/dist/src/entities/workitems/registry.js.map +1 -0
  395. package/dist/src/entities/workitems/schema-readonly.d.ts +49 -0
  396. package/dist/src/entities/workitems/schema-readonly.js +87 -0
  397. package/dist/src/entities/workitems/schema-readonly.js.map +1 -0
  398. package/dist/src/entities/workitems/schema.d.ts +97 -0
  399. package/dist/src/entities/workitems/schema.js +187 -0
  400. package/dist/src/entities/workitems/schema.js.map +1 -0
  401. package/dist/src/graphql/DynamicWorkItemsQuery.d.ts +56 -0
  402. package/dist/src/graphql/DynamicWorkItemsQuery.js +190 -0
  403. package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -0
  404. package/dist/src/graphql/client.d.ts +17 -0
  405. package/dist/src/graphql/client.js +56 -0
  406. package/dist/src/graphql/client.js.map +1 -0
  407. package/dist/src/graphql/index.d.ts +2 -0
  408. package/dist/src/graphql/index.js +21 -0
  409. package/dist/src/graphql/index.js.map +1 -0
  410. package/dist/src/graphql/workItems.d.ts +659 -0
  411. package/dist/src/graphql/workItems.js +1545 -0
  412. package/dist/src/graphql/workItems.js.map +1 -0
  413. package/dist/src/handlers.d.ts +2 -0
  414. package/dist/src/handlers.js +346 -0
  415. package/dist/src/handlers.js.map +1 -0
  416. package/dist/src/http-client.d.ts +1 -0
  417. package/dist/src/http-client.js +9 -0
  418. package/dist/src/http-client.js.map +1 -0
  419. package/dist/src/logger.d.ts +9 -0
  420. package/dist/src/logger.js +129 -0
  421. package/dist/src/logger.js.map +1 -0
  422. package/dist/src/logging/access-log.d.ts +15 -0
  423. package/dist/src/logging/access-log.js +157 -0
  424. package/dist/src/logging/access-log.js.map +1 -0
  425. package/dist/src/logging/connection-tracker.d.ts +21 -0
  426. package/dist/src/logging/connection-tracker.js +106 -0
  427. package/dist/src/logging/connection-tracker.js.map +1 -0
  428. package/dist/src/logging/index.d.ts +5 -0
  429. package/dist/src/logging/index.js +27 -0
  430. package/dist/src/logging/index.js.map +1 -0
  431. package/dist/src/logging/request-tracker.d.ts +39 -0
  432. package/dist/src/logging/request-tracker.js +208 -0
  433. package/dist/src/logging/request-tracker.js.map +1 -0
  434. package/dist/src/logging/types.d.ts +55 -0
  435. package/dist/src/logging/types.js +5 -0
  436. package/dist/src/logging/types.js.map +1 -0
  437. package/dist/src/main.d.ts +2 -0
  438. package/dist/src/main.js +219 -0
  439. package/dist/src/main.js.map +1 -0
  440. package/dist/src/middleware/index.d.ts +2 -0
  441. package/dist/src/middleware/index.js +12 -0
  442. package/dist/src/middleware/index.js.map +1 -0
  443. package/dist/src/middleware/oauth-auth.d.ts +4 -0
  444. package/dist/src/middleware/oauth-auth.js +137 -0
  445. package/dist/src/middleware/oauth-auth.js.map +1 -0
  446. package/dist/src/middleware/rate-limiter.d.ts +11 -0
  447. package/dist/src/middleware/rate-limiter.js +183 -0
  448. package/dist/src/middleware/rate-limiter.js.map +1 -0
  449. package/dist/src/oauth/config.d.ts +25 -0
  450. package/dist/src/oauth/config.js +109 -0
  451. package/dist/src/oauth/config.js.map +1 -0
  452. package/dist/src/oauth/endpoints/authorize.d.ts +3 -0
  453. package/dist/src/oauth/endpoints/authorize.js +454 -0
  454. package/dist/src/oauth/endpoints/authorize.js.map +1 -0
  455. package/dist/src/oauth/endpoints/callback.d.ts +2 -0
  456. package/dist/src/oauth/endpoints/callback.js +134 -0
  457. package/dist/src/oauth/endpoints/callback.js.map +1 -0
  458. package/dist/src/oauth/endpoints/index.d.ts +5 -0
  459. package/dist/src/oauth/endpoints/index.js +19 -0
  460. package/dist/src/oauth/endpoints/index.js.map +1 -0
  461. package/dist/src/oauth/endpoints/metadata.d.ts +5 -0
  462. package/dist/src/oauth/endpoints/metadata.js +42 -0
  463. package/dist/src/oauth/endpoints/metadata.js.map +1 -0
  464. package/dist/src/oauth/endpoints/register.d.ts +15 -0
  465. package/dist/src/oauth/endpoints/register.js +85 -0
  466. package/dist/src/oauth/endpoints/register.js.map +1 -0
  467. package/dist/src/oauth/endpoints/token.d.ts +2 -0
  468. package/dist/src/oauth/endpoints/token.js +167 -0
  469. package/dist/src/oauth/endpoints/token.js.map +1 -0
  470. package/dist/src/oauth/gitlab-device-flow.d.ts +10 -0
  471. package/dist/src/oauth/gitlab-device-flow.js +215 -0
  472. package/dist/src/oauth/gitlab-device-flow.js.map +1 -0
  473. package/dist/src/oauth/index.d.ts +10 -0
  474. package/dist/src/oauth/index.js +69 -0
  475. package/dist/src/oauth/index.js.map +1 -0
  476. package/dist/src/oauth/session-store.d.ts +54 -0
  477. package/dist/src/oauth/session-store.js +311 -0
  478. package/dist/src/oauth/session-store.js.map +1 -0
  479. package/dist/src/oauth/storage/factory.d.ts +4 -0
  480. package/dist/src/oauth/storage/factory.js +73 -0
  481. package/dist/src/oauth/storage/factory.js.map +1 -0
  482. package/dist/src/oauth/storage/file.d.ts +48 -0
  483. package/dist/src/oauth/storage/file.js +307 -0
  484. package/dist/src/oauth/storage/file.js.map +1 -0
  485. package/dist/src/oauth/storage/index.d.ts +5 -0
  486. package/dist/src/oauth/storage/index.js +22 -0
  487. package/dist/src/oauth/storage/index.js.map +1 -0
  488. package/dist/src/oauth/storage/memory.d.ts +76 -0
  489. package/dist/src/oauth/storage/memory.js +280 -0
  490. package/dist/src/oauth/storage/memory.js.map +1 -0
  491. package/dist/src/oauth/storage/postgresql.d.ts +41 -0
  492. package/dist/src/oauth/storage/postgresql.js +444 -0
  493. package/dist/src/oauth/storage/postgresql.js.map +1 -0
  494. package/dist/src/oauth/storage/types.d.ts +66 -0
  495. package/dist/src/oauth/storage/types.js +5 -0
  496. package/dist/src/oauth/storage/types.js.map +1 -0
  497. package/dist/src/oauth/token-context.d.ts +10 -0
  498. package/dist/src/oauth/token-context.js +50 -0
  499. package/dist/src/oauth/token-context.js.map +1 -0
  500. package/dist/src/oauth/token-utils.d.ts +14 -0
  501. package/dist/src/oauth/token-utils.js +148 -0
  502. package/dist/src/oauth/token-utils.js.map +1 -0
  503. package/dist/src/oauth/types.d.ts +117 -0
  504. package/dist/src/oauth/types.js +3 -0
  505. package/dist/src/oauth/types.js.map +1 -0
  506. package/dist/src/profiles/applicator.d.ts +19 -0
  507. package/dist/src/profiles/applicator.js +256 -0
  508. package/dist/src/profiles/applicator.js.map +1 -0
  509. package/dist/src/profiles/builtin/admin.yaml +30 -0
  510. package/dist/src/profiles/builtin/ci.yaml +35 -0
  511. package/dist/src/profiles/builtin/code-reviewer.yaml +41 -0
  512. package/dist/src/profiles/builtin/developer.yaml +40 -0
  513. package/dist/src/profiles/builtin/devops.yaml +33 -0
  514. package/dist/src/profiles/builtin/full-access.yaml +29 -0
  515. package/dist/src/profiles/builtin/gitlab-com.yaml +40 -0
  516. package/dist/src/profiles/builtin/junior-dev.yaml +35 -0
  517. package/dist/src/profiles/builtin/pm.yaml +36 -0
  518. package/dist/src/profiles/builtin/readonly.yaml +33 -0
  519. package/dist/src/profiles/builtin/senior-dev.yaml +41 -0
  520. package/dist/src/profiles/builtin/team-lead.yaml +42 -0
  521. package/dist/src/profiles/index.d.ts +5 -0
  522. package/dist/src/profiles/index.js +34 -0
  523. package/dist/src/profiles/index.js.map +1 -0
  524. package/dist/src/profiles/loader.d.ts +32 -0
  525. package/dist/src/profiles/loader.js +319 -0
  526. package/dist/src/profiles/loader.js.map +1 -0
  527. package/dist/src/profiles/project-loader.d.ts +12 -0
  528. package/dist/src/profiles/project-loader.js +214 -0
  529. package/dist/src/profiles/project-loader.js.map +1 -0
  530. package/dist/src/profiles/scope-enforcer.d.ts +28 -0
  531. package/dist/src/profiles/scope-enforcer.js +236 -0
  532. package/dist/src/profiles/scope-enforcer.js.map +1 -0
  533. package/dist/src/profiles/types.d.ts +261 -0
  534. package/dist/src/profiles/types.js +153 -0
  535. package/dist/src/profiles/types.js.map +1 -0
  536. package/dist/src/registry-manager.d.ts +37 -0
  537. package/dist/src/registry-manager.js +488 -0
  538. package/dist/src/registry-manager.js.map +1 -0
  539. package/dist/src/server.d.ts +2 -0
  540. package/dist/src/server.js +624 -0
  541. package/dist/src/server.js.map +1 -0
  542. package/dist/src/services/ConnectionManager.d.ts +41 -0
  543. package/dist/src/services/ConnectionManager.js +438 -0
  544. package/dist/src/services/ConnectionManager.js.map +1 -0
  545. package/dist/src/services/GitLabVersionDetector.d.ts +52 -0
  546. package/dist/src/services/GitLabVersionDetector.js +215 -0
  547. package/dist/src/services/GitLabVersionDetector.js.map +1 -0
  548. package/dist/src/services/InstanceConnectionPool.d.ts +54 -0
  549. package/dist/src/services/InstanceConnectionPool.js +180 -0
  550. package/dist/src/services/InstanceConnectionPool.js.map +1 -0
  551. package/dist/src/services/InstanceRateLimiter.d.ts +35 -0
  552. package/dist/src/services/InstanceRateLimiter.js +131 -0
  553. package/dist/src/services/InstanceRateLimiter.js.map +1 -0
  554. package/dist/src/services/InstanceRegistry.d.ts +61 -0
  555. package/dist/src/services/InstanceRegistry.js +250 -0
  556. package/dist/src/services/InstanceRegistry.js.map +1 -0
  557. package/dist/src/services/NamespaceTierDetector.d.ts +9 -0
  558. package/dist/src/services/NamespaceTierDetector.js +249 -0
  559. package/dist/src/services/NamespaceTierDetector.js.map +1 -0
  560. package/dist/src/services/SchemaIntrospector.d.ts +39 -0
  561. package/dist/src/services/SchemaIntrospector.js +190 -0
  562. package/dist/src/services/SchemaIntrospector.js.map +1 -0
  563. package/dist/src/services/TokenScopeDetector.d.ts +35 -0
  564. package/dist/src/services/TokenScopeDetector.js +232 -0
  565. package/dist/src/services/TokenScopeDetector.js.map +1 -0
  566. package/dist/src/services/ToolAvailability.d.ts +32 -0
  567. package/dist/src/services/ToolAvailability.js +410 -0
  568. package/dist/src/services/ToolAvailability.js.map +1 -0
  569. package/dist/src/services/WidgetAvailability.d.ts +23 -0
  570. package/dist/src/services/WidgetAvailability.js +158 -0
  571. package/dist/src/services/WidgetAvailability.js.map +1 -0
  572. package/dist/src/session-manager.d.ts +19 -0
  573. package/dist/src/session-manager.js +131 -0
  574. package/dist/src/session-manager.js.map +1 -0
  575. package/dist/src/types.d.ts +28 -0
  576. package/dist/src/types.js +11 -0
  577. package/dist/src/types.js.map +1 -0
  578. package/dist/src/utils/description-utils.d.ts +2 -0
  579. package/dist/src/utils/description-utils.js +25 -0
  580. package/dist/src/utils/description-utils.js.map +1 -0
  581. package/dist/src/utils/error-handler.d.ts +93 -0
  582. package/dist/src/utils/error-handler.js +597 -0
  583. package/dist/src/utils/error-handler.js.map +1 -0
  584. package/dist/src/utils/fetch.d.ts +13 -0
  585. package/dist/src/utils/fetch.js +539 -0
  586. package/dist/src/utils/fetch.js.map +1 -0
  587. package/dist/src/utils/gitlab-api.d.ts +24 -0
  588. package/dist/src/utils/gitlab-api.js +139 -0
  589. package/dist/src/utils/gitlab-api.js.map +1 -0
  590. package/dist/src/utils/idConversion.d.ts +81 -0
  591. package/dist/src/utils/idConversion.js +193 -0
  592. package/dist/src/utils/idConversion.js.map +1 -0
  593. package/dist/src/utils/namespace.d.ts +7 -0
  594. package/dist/src/utils/namespace.js +59 -0
  595. package/dist/src/utils/namespace.js.map +1 -0
  596. package/dist/src/utils/projectIdentifier.d.ts +9 -0
  597. package/dist/src/utils/projectIdentifier.js +59 -0
  598. package/dist/src/utils/projectIdentifier.js.map +1 -0
  599. package/dist/src/utils/request-logger.d.ts +24 -0
  600. package/dist/src/utils/request-logger.js +55 -0
  601. package/dist/src/utils/request-logger.js.map +1 -0
  602. package/dist/src/utils/schema-utils.d.ts +31 -0
  603. package/dist/src/utils/schema-utils.js +288 -0
  604. package/dist/src/utils/schema-utils.js.map +1 -0
  605. package/dist/src/utils/smart-user-search.d.ts +33 -0
  606. package/dist/src/utils/smart-user-search.js +142 -0
  607. package/dist/src/utils/smart-user-search.js.map +1 -0
  608. package/dist/src/utils/version.d.ts +1 -0
  609. package/dist/src/utils/version.js +14 -0
  610. package/dist/src/utils/version.js.map +1 -0
  611. package/dist/src/utils/workItemTypes.d.ts +6 -0
  612. package/dist/src/utils/workItemTypes.js +14 -0
  613. package/dist/src/utils/workItemTypes.js.map +1 -0
  614. package/dist/tsconfig.build.tsbuildinfo +1 -0
  615. package/package.json +511 -0
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScopeEnforcer = exports.ScopeViolationError = void 0;
4
+ exports.isInNamespace = isInNamespace;
5
+ exports.extractProjectsFromArgs = extractProjectsFromArgs;
6
+ exports.extractGroupsFromArgs = extractGroupsFromArgs;
7
+ exports.enforceArgsScope = enforceArgsScope;
8
+ const logger_1 = require("../logger");
9
+ class ScopeViolationError extends Error {
10
+ attemptedTarget;
11
+ allowedScope;
12
+ constructor(attemptedTarget, allowedScope) {
13
+ const scopeDescription = getScopeDescription(allowedScope);
14
+ super(`Operation on '${attemptedTarget}' is outside the allowed scope (${scopeDescription})`);
15
+ this.attemptedTarget = attemptedTarget;
16
+ this.allowedScope = allowedScope;
17
+ this.name = "ScopeViolationError";
18
+ }
19
+ }
20
+ exports.ScopeViolationError = ScopeViolationError;
21
+ function getScopeDescription(scope) {
22
+ const parts = [];
23
+ if (scope.project) {
24
+ parts.push(`project: ${scope.project}`);
25
+ }
26
+ if (scope.group) {
27
+ const subgroupSuffix = scope.includeSubgroups !== false ? "/*" : "";
28
+ parts.push(`group: ${scope.group}${subgroupSuffix}`);
29
+ }
30
+ if (scope.namespace) {
31
+ parts.push(`namespace: ${scope.namespace}/*`);
32
+ }
33
+ if (scope.projects && scope.projects.length > 0) {
34
+ if (scope.projects.length <= 3) {
35
+ parts.push(`projects: ${scope.projects.join(", ")}`);
36
+ }
37
+ else {
38
+ parts.push(`${scope.projects.length} allowed projects`);
39
+ }
40
+ }
41
+ if (scope.groups && scope.groups.length > 0) {
42
+ if (scope.groups.length <= 3) {
43
+ parts.push(`groups: ${scope.groups.join(", ")}`);
44
+ }
45
+ else {
46
+ parts.push(`${scope.groups.length} allowed groups`);
47
+ }
48
+ }
49
+ return parts.length > 0 ? parts.join("; ") : "unrestricted";
50
+ }
51
+ function normalizeProjectPath(path) {
52
+ const trimmed = path.trim().replace(/^\/+|\/+$/g, "");
53
+ if (/^\d+$/.test(trimmed)) {
54
+ return trimmed;
55
+ }
56
+ return trimmed.toLowerCase();
57
+ }
58
+ function isInNamespace(projectPath, namespace) {
59
+ const normalizedProject = normalizeProjectPath(projectPath);
60
+ const normalizedNamespace = normalizeProjectPath(namespace);
61
+ return (normalizedProject === normalizedNamespace ||
62
+ normalizedProject.startsWith(normalizedNamespace + "/"));
63
+ }
64
+ class ScopeEnforcer {
65
+ scope;
66
+ allowedProjectsSet;
67
+ allowedGroupsSet;
68
+ includeSubgroups;
69
+ constructor(scope) {
70
+ this.scope = scope;
71
+ this.includeSubgroups = scope.includeSubgroups !== false;
72
+ this.allowedProjectsSet = new Set((scope.projects ?? []).map(p => normalizeProjectPath(p)));
73
+ if (scope.project) {
74
+ this.allowedProjectsSet.add(normalizeProjectPath(scope.project));
75
+ }
76
+ this.allowedGroupsSet = new Set((scope.groups ?? []).map(g => normalizeProjectPath(g)));
77
+ if (scope.group) {
78
+ this.allowedGroupsSet.add(normalizeProjectPath(scope.group));
79
+ }
80
+ (0, logger_1.logDebug)("ScopeEnforcer initialized", {
81
+ scope: getScopeDescription(scope),
82
+ allowedProjectsCount: this.allowedProjectsSet.size,
83
+ allowedGroupsCount: this.allowedGroupsSet.size,
84
+ includeSubgroups: this.includeSubgroups,
85
+ });
86
+ }
87
+ static fromPreset(preset) {
88
+ if (!preset.scope) {
89
+ return null;
90
+ }
91
+ return new ScopeEnforcer(preset.scope);
92
+ }
93
+ isAllowed(projectPath) {
94
+ if (!this.hasProjectRestrictions()) {
95
+ return true;
96
+ }
97
+ const normalized = normalizeProjectPath(projectPath);
98
+ if (this.allowedProjectsSet.size > 0 && this.allowedProjectsSet.has(normalized)) {
99
+ return true;
100
+ }
101
+ if (this.scope.namespace && isInNamespace(projectPath, this.scope.namespace)) {
102
+ return true;
103
+ }
104
+ if (this.allowedGroupsSet.size > 0) {
105
+ for (const allowedGroup of this.allowedGroupsSet) {
106
+ if (this.includeSubgroups) {
107
+ if (isInNamespace(projectPath, allowedGroup)) {
108
+ return true;
109
+ }
110
+ }
111
+ else {
112
+ const parts = normalized.split("/");
113
+ if (parts.length >= 2) {
114
+ const projectGroup = parts.slice(0, -1).join("/");
115
+ if (projectGroup === allowedGroup) {
116
+ return true;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ if (/^\d+$/.test(normalized)) {
123
+ (0, logger_1.logWarn)("Numeric project ID not in allowed scope - denying access", {
124
+ projectId: normalized,
125
+ });
126
+ return false;
127
+ }
128
+ return false;
129
+ }
130
+ isGroupAllowed(groupPath) {
131
+ if (!this.hasGroupRestrictions()) {
132
+ return true;
133
+ }
134
+ const normalized = normalizeProjectPath(groupPath);
135
+ if (this.allowedGroupsSet.size > 0 && this.allowedGroupsSet.has(normalized)) {
136
+ return true;
137
+ }
138
+ if (this.includeSubgroups && this.allowedGroupsSet.size > 0) {
139
+ for (const allowedGroup of this.allowedGroupsSet) {
140
+ if (isInNamespace(groupPath, allowedGroup)) {
141
+ return true;
142
+ }
143
+ }
144
+ }
145
+ if (this.scope.namespace && isInNamespace(groupPath, this.scope.namespace)) {
146
+ return true;
147
+ }
148
+ if (/^\d+$/.test(normalized)) {
149
+ (0, logger_1.logWarn)("Numeric group ID not in allowed scope - denying access", { groupId: normalized });
150
+ return false;
151
+ }
152
+ return false;
153
+ }
154
+ enforce(projectPath) {
155
+ if (!this.isAllowed(projectPath)) {
156
+ (0, logger_1.logWarn)("Project scope violation attempted", {
157
+ attempted: projectPath,
158
+ scope: getScopeDescription(this.scope),
159
+ });
160
+ throw new ScopeViolationError(projectPath, this.scope);
161
+ }
162
+ }
163
+ enforceGroup(groupPath) {
164
+ if (!this.isGroupAllowed(groupPath)) {
165
+ (0, logger_1.logWarn)("Group scope violation attempted", {
166
+ attempted: groupPath,
167
+ scope: getScopeDescription(this.scope),
168
+ });
169
+ throw new ScopeViolationError(groupPath, this.scope);
170
+ }
171
+ }
172
+ getScope() {
173
+ return this.scope;
174
+ }
175
+ getScopeDescription() {
176
+ return getScopeDescription(this.scope);
177
+ }
178
+ hasProjectRestrictions() {
179
+ const hasProject = Boolean(this.scope.project);
180
+ const hasNamespace = Boolean(this.scope.namespace);
181
+ const hasProjects = Boolean(this.scope.projects && this.scope.projects.length > 0);
182
+ const hasGroup = Boolean(this.scope.group);
183
+ const hasGroups = Boolean(this.scope.groups && this.scope.groups.length > 0);
184
+ return hasProject || hasNamespace || hasProjects || hasGroup || hasGroups;
185
+ }
186
+ hasGroupRestrictions() {
187
+ const hasGroup = Boolean(this.scope.group);
188
+ const hasNamespace = Boolean(this.scope.namespace);
189
+ const hasGroups = Boolean(this.scope.groups && this.scope.groups.length > 0);
190
+ return hasGroup || hasNamespace || hasGroups;
191
+ }
192
+ hasRestrictions() {
193
+ return this.hasProjectRestrictions() || this.hasGroupRestrictions();
194
+ }
195
+ }
196
+ exports.ScopeEnforcer = ScopeEnforcer;
197
+ function extractProjectsFromArgs(args) {
198
+ const projects = [];
199
+ const projectFields = [
200
+ "project_id",
201
+ "projectId",
202
+ "project",
203
+ "namespace",
204
+ "namespacePath",
205
+ "fullPath",
206
+ ];
207
+ for (const field of projectFields) {
208
+ const value = args[field];
209
+ if (typeof value === "string" && value.trim()) {
210
+ projects.push(value.trim());
211
+ }
212
+ }
213
+ return projects;
214
+ }
215
+ function extractGroupsFromArgs(args) {
216
+ const groups = [];
217
+ const groupFields = ["group_id", "groupId", "group"];
218
+ for (const field of groupFields) {
219
+ const value = args[field];
220
+ if (typeof value === "string" && value.trim()) {
221
+ groups.push(value.trim());
222
+ }
223
+ }
224
+ return groups;
225
+ }
226
+ function enforceArgsScope(enforcer, args) {
227
+ const projects = extractProjectsFromArgs(args);
228
+ for (const project of projects) {
229
+ enforcer.enforce(project);
230
+ }
231
+ const groups = extractGroupsFromArgs(args);
232
+ for (const group of groups) {
233
+ enforcer.enforceGroup(group);
234
+ }
235
+ }
236
+ //# sourceMappingURL=scope-enforcer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-enforcer.js","sourceRoot":"","sources":["../../../src/profiles/scope-enforcer.ts"],"names":[],"mappings":";;;AA2FA,sCASC;AAkPD,0D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AM,GAAa,EAAE,CAAC;IAG5B,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAErD,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAC9C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAWD,SAAgB,gBAAgB,CAAC,QAAuB,EAAE,IAA6B;IAErF,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC/C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAGD,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC"}
@@ -0,0 +1,261 @@
1
+ import { z } from "zod";
2
+ declare const PatAuthSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"pat">;
4
+ token_env: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const OAuthAuthSchema: z.ZodObject<{
7
+ type: z.ZodLiteral<"oauth">;
8
+ client_id_env: z.ZodString;
9
+ client_secret_env: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ declare const CookieAuthSchema: z.ZodObject<{
12
+ type: z.ZodLiteral<"cookie">;
13
+ cookie_path: z.ZodString;
14
+ }, z.core.$strip>;
15
+ declare const AuthConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
16
+ type: z.ZodLiteral<"pat">;
17
+ token_env: z.ZodString;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ type: z.ZodLiteral<"oauth">;
20
+ client_id_env: z.ZodString;
21
+ client_secret_env: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ type: z.ZodLiteral<"cookie">;
24
+ cookie_path: z.ZodString;
25
+ }, z.core.$strip>], "type">;
26
+ declare const FeatureFlagsSchema: z.ZodOptional<z.ZodObject<{
27
+ wiki: z.ZodOptional<z.ZodBoolean>;
28
+ milestones: z.ZodOptional<z.ZodBoolean>;
29
+ pipelines: z.ZodOptional<z.ZodBoolean>;
30
+ labels: z.ZodOptional<z.ZodBoolean>;
31
+ mrs: z.ZodOptional<z.ZodBoolean>;
32
+ files: z.ZodOptional<z.ZodBoolean>;
33
+ variables: z.ZodOptional<z.ZodBoolean>;
34
+ workitems: z.ZodOptional<z.ZodBoolean>;
35
+ webhooks: z.ZodOptional<z.ZodBoolean>;
36
+ snippets: z.ZodOptional<z.ZodBoolean>;
37
+ integrations: z.ZodOptional<z.ZodBoolean>;
38
+ releases: z.ZodOptional<z.ZodBoolean>;
39
+ refs: z.ZodOptional<z.ZodBoolean>;
40
+ members: z.ZodOptional<z.ZodBoolean>;
41
+ search: z.ZodOptional<z.ZodBoolean>;
42
+ }, z.core.$strip>>;
43
+ export declare const ProfileSchema: z.ZodObject<{
44
+ host: z.ZodString;
45
+ api_url: z.ZodOptional<z.ZodString>;
46
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
+ type: z.ZodLiteral<"pat">;
48
+ token_env: z.ZodString;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ type: z.ZodLiteral<"oauth">;
51
+ client_id_env: z.ZodString;
52
+ client_secret_env: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ type: z.ZodLiteral<"cookie">;
55
+ cookie_path: z.ZodString;
56
+ }, z.core.$strip>], "type">;
57
+ read_only: z.ZodOptional<z.ZodBoolean>;
58
+ allowed_projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
+ allowed_groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ denied_tools_regex: z.ZodOptional<z.ZodString>;
61
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
+ features: z.ZodOptional<z.ZodObject<{
64
+ wiki: z.ZodOptional<z.ZodBoolean>;
65
+ milestones: z.ZodOptional<z.ZodBoolean>;
66
+ pipelines: z.ZodOptional<z.ZodBoolean>;
67
+ labels: z.ZodOptional<z.ZodBoolean>;
68
+ mrs: z.ZodOptional<z.ZodBoolean>;
69
+ files: z.ZodOptional<z.ZodBoolean>;
70
+ variables: z.ZodOptional<z.ZodBoolean>;
71
+ workitems: z.ZodOptional<z.ZodBoolean>;
72
+ webhooks: z.ZodOptional<z.ZodBoolean>;
73
+ snippets: z.ZodOptional<z.ZodBoolean>;
74
+ integrations: z.ZodOptional<z.ZodBoolean>;
75
+ releases: z.ZodOptional<z.ZodBoolean>;
76
+ refs: z.ZodOptional<z.ZodBoolean>;
77
+ members: z.ZodOptional<z.ZodBoolean>;
78
+ search: z.ZodOptional<z.ZodBoolean>;
79
+ }, z.core.$strip>>;
80
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
81
+ default_project: z.ZodOptional<z.ZodString>;
82
+ default_namespace: z.ZodOptional<z.ZodString>;
83
+ skip_tls_verify: z.ZodOptional<z.ZodBoolean>;
84
+ ssl_cert_path: z.ZodOptional<z.ZodString>;
85
+ ssl_key_path: z.ZodOptional<z.ZodString>;
86
+ ca_cert_path: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>;
88
+ export declare const ScopeConfigSchema: z.ZodObject<{
89
+ project: z.ZodOptional<z.ZodString>;
90
+ group: z.ZodOptional<z.ZodString>;
91
+ namespace: z.ZodOptional<z.ZodString>;
92
+ projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ includeSubgroups: z.ZodOptional<z.ZodBoolean>;
95
+ }, z.core.$strip>;
96
+ export declare const PresetSchema: z.ZodObject<{
97
+ description: z.ZodOptional<z.ZodString>;
98
+ read_only: z.ZodOptional<z.ZodBoolean>;
99
+ denied_tools_regex: z.ZodOptional<z.ZodString>;
100
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
102
+ scope: z.ZodOptional<z.ZodObject<{
103
+ project: z.ZodOptional<z.ZodString>;
104
+ group: z.ZodOptional<z.ZodString>;
105
+ namespace: z.ZodOptional<z.ZodString>;
106
+ projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
107
+ groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
+ includeSubgroups: z.ZodOptional<z.ZodBoolean>;
109
+ }, z.core.$strip>>;
110
+ features: z.ZodOptional<z.ZodObject<{
111
+ wiki: z.ZodOptional<z.ZodBoolean>;
112
+ milestones: z.ZodOptional<z.ZodBoolean>;
113
+ pipelines: z.ZodOptional<z.ZodBoolean>;
114
+ labels: z.ZodOptional<z.ZodBoolean>;
115
+ mrs: z.ZodOptional<z.ZodBoolean>;
116
+ files: z.ZodOptional<z.ZodBoolean>;
117
+ variables: z.ZodOptional<z.ZodBoolean>;
118
+ workitems: z.ZodOptional<z.ZodBoolean>;
119
+ webhooks: z.ZodOptional<z.ZodBoolean>;
120
+ snippets: z.ZodOptional<z.ZodBoolean>;
121
+ integrations: z.ZodOptional<z.ZodBoolean>;
122
+ releases: z.ZodOptional<z.ZodBoolean>;
123
+ refs: z.ZodOptional<z.ZodBoolean>;
124
+ members: z.ZodOptional<z.ZodBoolean>;
125
+ search: z.ZodOptional<z.ZodBoolean>;
126
+ }, z.core.$strip>>;
127
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
128
+ }, z.core.$strict>;
129
+ export declare const ProfilesConfigSchema: z.ZodObject<{
130
+ profiles: z.ZodRecord<z.ZodString, z.ZodObject<{
131
+ host: z.ZodString;
132
+ api_url: z.ZodOptional<z.ZodString>;
133
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
134
+ type: z.ZodLiteral<"pat">;
135
+ token_env: z.ZodString;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ type: z.ZodLiteral<"oauth">;
138
+ client_id_env: z.ZodString;
139
+ client_secret_env: z.ZodOptional<z.ZodString>;
140
+ }, z.core.$strip>, z.ZodObject<{
141
+ type: z.ZodLiteral<"cookie">;
142
+ cookie_path: z.ZodString;
143
+ }, z.core.$strip>], "type">;
144
+ read_only: z.ZodOptional<z.ZodBoolean>;
145
+ allowed_projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
+ allowed_groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
+ denied_tools_regex: z.ZodOptional<z.ZodString>;
148
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
149
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
150
+ features: z.ZodOptional<z.ZodObject<{
151
+ wiki: z.ZodOptional<z.ZodBoolean>;
152
+ milestones: z.ZodOptional<z.ZodBoolean>;
153
+ pipelines: z.ZodOptional<z.ZodBoolean>;
154
+ labels: z.ZodOptional<z.ZodBoolean>;
155
+ mrs: z.ZodOptional<z.ZodBoolean>;
156
+ files: z.ZodOptional<z.ZodBoolean>;
157
+ variables: z.ZodOptional<z.ZodBoolean>;
158
+ workitems: z.ZodOptional<z.ZodBoolean>;
159
+ webhooks: z.ZodOptional<z.ZodBoolean>;
160
+ snippets: z.ZodOptional<z.ZodBoolean>;
161
+ integrations: z.ZodOptional<z.ZodBoolean>;
162
+ releases: z.ZodOptional<z.ZodBoolean>;
163
+ refs: z.ZodOptional<z.ZodBoolean>;
164
+ members: z.ZodOptional<z.ZodBoolean>;
165
+ search: z.ZodOptional<z.ZodBoolean>;
166
+ }, z.core.$strip>>;
167
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
168
+ default_project: z.ZodOptional<z.ZodString>;
169
+ default_namespace: z.ZodOptional<z.ZodString>;
170
+ skip_tls_verify: z.ZodOptional<z.ZodBoolean>;
171
+ ssl_cert_path: z.ZodOptional<z.ZodString>;
172
+ ssl_key_path: z.ZodOptional<z.ZodString>;
173
+ ca_cert_path: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>>;
175
+ default_profile: z.ZodOptional<z.ZodString>;
176
+ }, z.core.$strip>;
177
+ export declare const ProjectPresetSchema: z.ZodObject<{
178
+ description: z.ZodOptional<z.ZodString>;
179
+ scope: z.ZodOptional<z.ZodObject<{
180
+ project: z.ZodOptional<z.ZodString>;
181
+ group: z.ZodOptional<z.ZodString>;
182
+ namespace: z.ZodOptional<z.ZodString>;
183
+ projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
184
+ groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
185
+ includeSubgroups: z.ZodOptional<z.ZodBoolean>;
186
+ }, z.core.$strip>>;
187
+ features: z.ZodOptional<z.ZodObject<{
188
+ wiki: z.ZodOptional<z.ZodBoolean>;
189
+ milestones: z.ZodOptional<z.ZodBoolean>;
190
+ pipelines: z.ZodOptional<z.ZodBoolean>;
191
+ labels: z.ZodOptional<z.ZodBoolean>;
192
+ mrs: z.ZodOptional<z.ZodBoolean>;
193
+ files: z.ZodOptional<z.ZodBoolean>;
194
+ variables: z.ZodOptional<z.ZodBoolean>;
195
+ workitems: z.ZodOptional<z.ZodBoolean>;
196
+ webhooks: z.ZodOptional<z.ZodBoolean>;
197
+ snippets: z.ZodOptional<z.ZodBoolean>;
198
+ integrations: z.ZodOptional<z.ZodBoolean>;
199
+ releases: z.ZodOptional<z.ZodBoolean>;
200
+ refs: z.ZodOptional<z.ZodBoolean>;
201
+ members: z.ZodOptional<z.ZodBoolean>;
202
+ search: z.ZodOptional<z.ZodBoolean>;
203
+ }, z.core.$strip>>;
204
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
205
+ denied_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
206
+ read_only: z.ZodOptional<z.ZodBoolean>;
207
+ }, z.core.$strict>;
208
+ export declare const ProjectProfileSchema: z.ZodObject<{
209
+ description: z.ZodOptional<z.ZodString>;
210
+ extends: z.ZodOptional<z.ZodString>;
211
+ features: z.ZodOptional<z.ZodObject<{
212
+ wiki: z.ZodOptional<z.ZodBoolean>;
213
+ milestones: z.ZodOptional<z.ZodBoolean>;
214
+ pipelines: z.ZodOptional<z.ZodBoolean>;
215
+ labels: z.ZodOptional<z.ZodBoolean>;
216
+ mrs: z.ZodOptional<z.ZodBoolean>;
217
+ files: z.ZodOptional<z.ZodBoolean>;
218
+ variables: z.ZodOptional<z.ZodBoolean>;
219
+ workitems: z.ZodOptional<z.ZodBoolean>;
220
+ webhooks: z.ZodOptional<z.ZodBoolean>;
221
+ snippets: z.ZodOptional<z.ZodBoolean>;
222
+ integrations: z.ZodOptional<z.ZodBoolean>;
223
+ releases: z.ZodOptional<z.ZodBoolean>;
224
+ refs: z.ZodOptional<z.ZodBoolean>;
225
+ members: z.ZodOptional<z.ZodBoolean>;
226
+ search: z.ZodOptional<z.ZodBoolean>;
227
+ }, z.core.$strip>>;
228
+ additional_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
+ denied_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
230
+ }, z.core.$strict>;
231
+ export interface ProjectConfig {
232
+ configPath: string;
233
+ preset?: ProjectPreset;
234
+ profile?: ProjectProfile;
235
+ }
236
+ export type PatAuth = z.infer<typeof PatAuthSchema>;
237
+ export type OAuthAuth = z.infer<typeof OAuthAuthSchema>;
238
+ export type CookieAuth = z.infer<typeof CookieAuthSchema>;
239
+ export type AuthConfig = z.infer<typeof AuthConfigSchema>;
240
+ export type FeatureFlags = z.infer<typeof FeatureFlagsSchema>;
241
+ export type ScopeConfig = z.infer<typeof ScopeConfigSchema>;
242
+ export type Profile = z.infer<typeof ProfileSchema>;
243
+ export type Preset = z.infer<typeof PresetSchema>;
244
+ export type ProfilesConfig = z.infer<typeof ProfilesConfigSchema>;
245
+ export type ProjectPreset = z.infer<typeof ProjectPresetSchema>;
246
+ export type ProjectProfile = z.infer<typeof ProjectProfileSchema>;
247
+ export interface ProfileInfo {
248
+ name: string;
249
+ host?: string;
250
+ authType?: "pat" | "oauth" | "cookie";
251
+ readOnly: boolean;
252
+ isBuiltIn: boolean;
253
+ isPreset: boolean;
254
+ description?: string;
255
+ }
256
+ export interface ProfileValidationResult {
257
+ valid: boolean;
258
+ errors: string[];
259
+ warnings: string[];
260
+ }
261
+ export {};
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectProfileSchema = exports.ProjectPresetSchema = exports.ProfilesConfigSchema = exports.PresetSchema = exports.ScopeConfigSchema = exports.ProfileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const PatAuthSchema = zod_1.z.object({
6
+ type: zod_1.z.literal("pat"),
7
+ token_env: zod_1.z.string().describe("Environment variable containing the PAT token"),
8
+ });
9
+ const OAuthAuthSchema = zod_1.z.object({
10
+ type: zod_1.z.literal("oauth"),
11
+ client_id_env: zod_1.z.string().describe("Environment variable containing OAuth client ID"),
12
+ client_secret_env: zod_1.z
13
+ .string()
14
+ .optional()
15
+ .describe("Environment variable containing OAuth client secret"),
16
+ });
17
+ const CookieAuthSchema = zod_1.z.object({
18
+ type: zod_1.z.literal("cookie"),
19
+ cookie_path: zod_1.z.string().describe("Path to cookie file for authentication"),
20
+ });
21
+ const AuthConfigSchema = zod_1.z.discriminatedUnion("type", [
22
+ PatAuthSchema,
23
+ OAuthAuthSchema,
24
+ CookieAuthSchema,
25
+ ]);
26
+ const FeatureFlagsSchema = zod_1.z
27
+ .object({
28
+ wiki: zod_1.z.boolean().optional(),
29
+ milestones: zod_1.z.boolean().optional(),
30
+ pipelines: zod_1.z.boolean().optional(),
31
+ labels: zod_1.z.boolean().optional(),
32
+ mrs: zod_1.z.boolean().optional(),
33
+ files: zod_1.z.boolean().optional(),
34
+ variables: zod_1.z.boolean().optional(),
35
+ workitems: zod_1.z.boolean().optional(),
36
+ webhooks: zod_1.z.boolean().optional(),
37
+ snippets: zod_1.z.boolean().optional(),
38
+ integrations: zod_1.z.boolean().optional(),
39
+ releases: zod_1.z.boolean().optional(),
40
+ refs: zod_1.z.boolean().optional(),
41
+ members: zod_1.z.boolean().optional(),
42
+ search: zod_1.z.boolean().optional(),
43
+ })
44
+ .optional();
45
+ exports.ProfileSchema = zod_1.z.object({
46
+ host: zod_1.z.string().describe("GitLab hostname (e.g., gitlab.company.com)"),
47
+ api_url: zod_1.z.string().url().optional().describe("Override API URL (default: https://{host})"),
48
+ auth: AuthConfigSchema,
49
+ read_only: zod_1.z.boolean().optional().describe("Enable read-only mode"),
50
+ allowed_projects: zod_1.z
51
+ .array(zod_1.z.string())
52
+ .optional()
53
+ .describe("Project whitelist (empty = all allowed)"),
54
+ allowed_groups: zod_1.z.array(zod_1.z.string()).optional().describe("Group whitelist (empty = all allowed)"),
55
+ denied_tools_regex: zod_1.z.string().optional().describe("Regex pattern to exclude tools"),
56
+ allowed_tools: zod_1.z
57
+ .array(zod_1.z.string())
58
+ .optional()
59
+ .describe("Explicit tool whitelist (overrides denied_tools_regex)"),
60
+ denied_actions: zod_1.z.array(zod_1.z.string()).optional().describe("Denied actions in format 'tool:action'"),
61
+ features: FeatureFlagsSchema,
62
+ timeout_ms: zod_1.z
63
+ .number()
64
+ .int()
65
+ .positive()
66
+ .optional()
67
+ .describe("API headers timeout in milliseconds (maps to GITLAB_API_HEADERS_TIMEOUT_MS)"),
68
+ default_project: zod_1.z.string().optional().describe("Auto-set project context"),
69
+ default_namespace: zod_1.z.string().optional().describe("Auto-set namespace context"),
70
+ skip_tls_verify: zod_1.z.boolean().optional().describe("Skip TLS certificate verification"),
71
+ ssl_cert_path: zod_1.z.string().optional().describe("Path to SSL certificate"),
72
+ ssl_key_path: zod_1.z.string().optional().describe("Path to SSL key"),
73
+ ca_cert_path: zod_1.z.string().optional().describe("Path to CA certificate"),
74
+ });
75
+ exports.ScopeConfigSchema = zod_1.z
76
+ .object({
77
+ project: zod_1.z.string().optional().describe("Single project path (e.g., group/project)"),
78
+ group: zod_1.z.string().optional().describe("Single group path (e.g., my-group or parent/child)"),
79
+ namespace: zod_1.z.string().optional().describe("Namespace/group path"),
80
+ projects: zod_1.z.array(zod_1.z.string()).optional().describe("List of allowed project paths"),
81
+ groups: zod_1.z.array(zod_1.z.string()).optional().describe("List of allowed group paths"),
82
+ includeSubgroups: zod_1.z
83
+ .boolean()
84
+ .optional()
85
+ .describe("Include subgroups when group scope is set (default: true)"),
86
+ })
87
+ .refine(data => {
88
+ const hasProject = data.project !== undefined;
89
+ const hasGroup = data.group !== undefined;
90
+ const hasNamespace = data.namespace !== undefined;
91
+ const hasProjects = data.projects !== undefined && data.projects.length > 0;
92
+ const hasGroups = data.groups !== undefined && data.groups.length > 0;
93
+ return hasProject || hasGroup || hasNamespace || hasProjects || hasGroups;
94
+ }, { message: "Scope must define at least one of: project, group, namespace, projects, or groups" })
95
+ .refine(data => {
96
+ if (data.project && data.projects && data.projects.length > 0) {
97
+ return false;
98
+ }
99
+ return true;
100
+ }, { message: "Cannot combine 'project' with 'projects' - use one or the other" })
101
+ .refine(data => {
102
+ if (data.group && data.groups && data.groups.length > 0) {
103
+ return false;
104
+ }
105
+ return true;
106
+ }, { message: "Cannot combine 'group' with 'groups' - use one or the other" });
107
+ exports.PresetSchema = zod_1.z
108
+ .object({
109
+ description: zod_1.z.string().optional().describe("Human-readable description of the preset"),
110
+ read_only: zod_1.z.boolean().optional().describe("Enable read-only mode"),
111
+ denied_tools_regex: zod_1.z.string().optional().describe("Regex pattern to exclude tools"),
112
+ allowed_tools: zod_1.z.array(zod_1.z.string()).optional().describe("Explicit tool whitelist"),
113
+ denied_actions: zod_1.z
114
+ .array(zod_1.z.string())
115
+ .optional()
116
+ .describe("Denied actions in format 'tool:action'"),
117
+ scope: exports.ScopeConfigSchema.optional().describe("Runtime scope restrictions for projects/groups"),
118
+ features: FeatureFlagsSchema,
119
+ timeout_ms: zod_1.z
120
+ .number()
121
+ .int()
122
+ .positive()
123
+ .optional()
124
+ .describe("API headers timeout in milliseconds (maps to GITLAB_API_HEADERS_TIMEOUT_MS)"),
125
+ })
126
+ .strict();
127
+ exports.ProfilesConfigSchema = zod_1.z.object({
128
+ profiles: zod_1.z.record(zod_1.z.string(), exports.ProfileSchema).describe("Named profiles"),
129
+ default_profile: zod_1.z.string().optional().describe("Default profile when none specified"),
130
+ });
131
+ exports.ProjectPresetSchema = zod_1.z
132
+ .object({
133
+ description: zod_1.z.string().optional().describe("Description of project restrictions"),
134
+ scope: exports.ScopeConfigSchema.optional().describe("Project/namespace scope restrictions"),
135
+ features: FeatureFlagsSchema,
136
+ denied_actions: zod_1.z
137
+ .array(zod_1.z.string())
138
+ .optional()
139
+ .describe("Denied actions in format 'tool:action'"),
140
+ denied_tools: zod_1.z.array(zod_1.z.string()).optional().describe("List of denied tool names"),
141
+ read_only: zod_1.z.boolean().optional().describe("Enable read-only mode"),
142
+ })
143
+ .strict();
144
+ exports.ProjectProfileSchema = zod_1.z
145
+ .object({
146
+ description: zod_1.z.string().optional().describe("Description of project configuration"),
147
+ extends: zod_1.z.string().optional().describe("Built-in preset name to inherit from"),
148
+ features: FeatureFlagsSchema,
149
+ additional_tools: zod_1.z.array(zod_1.z.string()).optional().describe("Additional tools to enable"),
150
+ denied_tools: zod_1.z.array(zod_1.z.string()).optional().describe("Tools to disable"),
151
+ })
152
+ .strict();
153
+ //# sourceMappingURL=types.js.map