@structured-world/gitlab-mcp 6.8.0 → 6.10.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 (112) hide show
  1. package/LICENSE +202 -21
  2. package/LICENSE.MIT +21 -0
  3. package/README.md +169 -1
  4. package/dist/src/cli/list-tools.d.ts +2 -0
  5. package/dist/src/cli/list-tools.js +768 -0
  6. package/dist/src/cli/list-tools.js.map +1 -0
  7. package/dist/src/config.d.ts +7 -0
  8. package/dist/src/config.js +96 -1
  9. package/dist/src/config.js.map +1 -1
  10. package/dist/src/entities/core/registry.js +68 -63
  11. package/dist/src/entities/core/registry.js.map +1 -1
  12. package/dist/src/entities/core/schema-readonly.d.ts +93 -36
  13. package/dist/src/entities/core/schema-readonly.js +146 -121
  14. package/dist/src/entities/core/schema-readonly.js.map +1 -1
  15. package/dist/src/entities/core/schema.d.ts +33 -23
  16. package/dist/src/entities/core/schema.js +65 -60
  17. package/dist/src/entities/core/schema.js.map +1 -1
  18. package/dist/src/entities/files/registry.js +14 -21
  19. package/dist/src/entities/files/registry.js.map +1 -1
  20. package/dist/src/entities/files/schema-readonly.d.ts +8 -7
  21. package/dist/src/entities/files/schema-readonly.js +20 -25
  22. package/dist/src/entities/files/schema-readonly.js.map +1 -1
  23. package/dist/src/entities/files/schema.d.ts +22 -15
  24. package/dist/src/entities/files/schema.js +32 -73
  25. package/dist/src/entities/files/schema.js.map +1 -1
  26. package/dist/src/entities/integrations/registry.js +3 -0
  27. package/dist/src/entities/integrations/registry.js.map +1 -1
  28. package/dist/src/entities/integrations/schema.d.ts +114 -8
  29. package/dist/src/entities/integrations/schema.js +27 -9
  30. package/dist/src/entities/integrations/schema.js.map +1 -1
  31. package/dist/src/entities/labels/registry.js +8 -7
  32. package/dist/src/entities/labels/registry.js.map +1 -1
  33. package/dist/src/entities/labels/schema-readonly.d.ts +8 -7
  34. package/dist/src/entities/labels/schema-readonly.js +20 -18
  35. package/dist/src/entities/labels/schema-readonly.js.map +1 -1
  36. package/dist/src/entities/labels/schema.d.ts +15 -8
  37. package/dist/src/entities/labels/schema.js +36 -27
  38. package/dist/src/entities/labels/schema.js.map +1 -1
  39. package/dist/src/entities/milestones/registry.js +7 -8
  40. package/dist/src/entities/milestones/registry.js.map +1 -1
  41. package/dist/src/entities/milestones/schema-readonly.d.ts +25 -10
  42. package/dist/src/entities/milestones/schema-readonly.js +47 -26
  43. package/dist/src/entities/milestones/schema-readonly.js.map +1 -1
  44. package/dist/src/entities/milestones/schema.d.ts +19 -9
  45. package/dist/src/entities/milestones/schema.js +31 -20
  46. package/dist/src/entities/milestones/schema.js.map +1 -1
  47. package/dist/src/entities/mrs/registry.js +75 -79
  48. package/dist/src/entities/mrs/registry.js.map +1 -1
  49. package/dist/src/entities/mrs/schema-readonly.d.ts +36 -23
  50. package/dist/src/entities/mrs/schema-readonly.js +197 -338
  51. package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
  52. package/dist/src/entities/mrs/schema.d.ts +113 -37
  53. package/dist/src/entities/mrs/schema.js +140 -258
  54. package/dist/src/entities/mrs/schema.js.map +1 -1
  55. package/dist/src/entities/pipelines/registry.js +10 -4
  56. package/dist/src/entities/pipelines/registry.js.map +1 -1
  57. package/dist/src/entities/pipelines/schema-readonly.d.ts +30 -14
  58. package/dist/src/entities/pipelines/schema-readonly.js +62 -52
  59. package/dist/src/entities/pipelines/schema-readonly.js.map +1 -1
  60. package/dist/src/entities/pipelines/schema.d.ts +23 -16
  61. package/dist/src/entities/pipelines/schema.js +44 -26
  62. package/dist/src/entities/pipelines/schema.js.map +1 -1
  63. package/dist/src/entities/snippets/registry.js +79 -67
  64. package/dist/src/entities/snippets/registry.js.map +1 -1
  65. package/dist/src/entities/snippets/schema-readonly.d.ts +8 -9
  66. package/dist/src/entities/snippets/schema-readonly.js +30 -35
  67. package/dist/src/entities/snippets/schema-readonly.js.map +1 -1
  68. package/dist/src/entities/snippets/schema.d.ts +7 -11
  69. package/dist/src/entities/snippets/schema.js +31 -65
  70. package/dist/src/entities/snippets/schema.js.map +1 -1
  71. package/dist/src/entities/variables/registry.js +9 -5
  72. package/dist/src/entities/variables/registry.js.map +1 -1
  73. package/dist/src/entities/variables/schema-readonly.d.ts +9 -9
  74. package/dist/src/entities/variables/schema-readonly.js +22 -18
  75. package/dist/src/entities/variables/schema-readonly.js.map +1 -1
  76. package/dist/src/entities/variables/schema.d.ts +24 -7
  77. package/dist/src/entities/variables/schema.js +67 -38
  78. package/dist/src/entities/variables/schema.js.map +1 -1
  79. package/dist/src/entities/webhooks/registry.js +48 -46
  80. package/dist/src/entities/webhooks/registry.js.map +1 -1
  81. package/dist/src/entities/webhooks/schema-readonly.d.ts +9 -8
  82. package/dist/src/entities/webhooks/schema-readonly.js +14 -9
  83. package/dist/src/entities/webhooks/schema-readonly.js.map +1 -1
  84. package/dist/src/entities/webhooks/schema.d.ts +79 -26
  85. package/dist/src/entities/webhooks/schema.js +70 -61
  86. package/dist/src/entities/webhooks/schema.js.map +1 -1
  87. package/dist/src/entities/wiki/registry.js +7 -4
  88. package/dist/src/entities/wiki/registry.js.map +1 -1
  89. package/dist/src/entities/wiki/schema-readonly.d.ts +7 -7
  90. package/dist/src/entities/wiki/schema-readonly.js +11 -15
  91. package/dist/src/entities/wiki/schema-readonly.js.map +1 -1
  92. package/dist/src/entities/wiki/schema.d.ts +19 -8
  93. package/dist/src/entities/wiki/schema.js +32 -29
  94. package/dist/src/entities/wiki/schema.js.map +1 -1
  95. package/dist/src/entities/workitems/registry.js +7 -8
  96. package/dist/src/entities/workitems/registry.js.map +1 -1
  97. package/dist/src/entities/workitems/schema-readonly.d.ts +7 -8
  98. package/dist/src/entities/workitems/schema-readonly.js +12 -14
  99. package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
  100. package/dist/src/entities/workitems/schema.d.ts +17 -11
  101. package/dist/src/entities/workitems/schema.js +25 -25
  102. package/dist/src/entities/workitems/schema.js.map +1 -1
  103. package/dist/src/registry-manager.d.ts +1 -0
  104. package/dist/src/registry-manager.js +45 -11
  105. package/dist/src/registry-manager.js.map +1 -1
  106. package/dist/src/utils/schema-utils.d.ts +28 -0
  107. package/dist/src/utils/schema-utils.js +240 -0
  108. package/dist/src/utils/schema-utils.js.map +1 -0
  109. package/dist/structured-world-gitlab-mcp-6.10.0.tgz +0 -0
  110. package/dist/tsconfig.build.tsbuildinfo +1 -1
  111. package/package.json +4 -4
  112. package/dist/structured-world-gitlab-mcp-6.8.0.tgz +0 -0
@@ -36,16 +36,12 @@ export declare const MergeRequestThreadPositionSchema: z.ZodObject<{
36
36
  x: z.ZodOptional<z.ZodNumber>;
37
37
  y: z.ZodOptional<z.ZodNumber>;
38
38
  }, z.core.$strip>;
39
- export declare const ManageMergeRequestSchema: z.ZodObject<{
40
- action: z.ZodEnum<{
41
- create: "create";
42
- update: "update";
43
- merge: "merge";
44
- }>;
39
+ export declare const ManageMergeRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
40
+ action: z.ZodLiteral<"create">;
45
41
  project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
46
- source_branch: z.ZodOptional<z.ZodString>;
47
- target_branch: z.ZodOptional<z.ZodString>;
48
- title: z.ZodOptional<z.ZodString>;
42
+ source_branch: z.ZodString;
43
+ target_branch: z.ZodString;
44
+ title: z.ZodString;
49
45
  assignee_id: z.ZodOptional<z.ZodString>;
50
46
  assignee_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
51
47
  reviewer_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -57,35 +53,56 @@ export declare const ManageMergeRequestSchema: z.ZodObject<{
57
53
  allow_collaboration: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
58
54
  allow_maintainer_to_push: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
59
55
  squash: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
60
- merge_request_iid: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
56
+ }, z.core.$strip>, z.ZodObject<{
57
+ action: z.ZodLiteral<"update">;
58
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
59
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
60
+ target_branch: z.ZodOptional<z.ZodString>;
61
+ title: z.ZodOptional<z.ZodString>;
62
+ assignee_id: z.ZodOptional<z.ZodString>;
63
+ assignee_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ reviewer_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ labels: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
61
67
  add_labels: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
62
68
  remove_labels: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
69
+ milestone_id: z.ZodOptional<z.ZodString>;
70
+ remove_source_branch: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
71
+ allow_collaboration: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
72
+ allow_maintainer_to_push: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
73
+ squash: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
63
74
  state_event: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
64
75
  close: "close";
65
76
  reopen: "reopen";
66
77
  }>>>;
67
78
  discussion_locked: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
79
+ }, z.core.$strip>, z.ZodObject<{
80
+ action: z.ZodLiteral<"merge">;
81
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
82
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
68
83
  merge_commit_message: z.ZodOptional<z.ZodString>;
69
84
  squash_commit_message: z.ZodOptional<z.ZodString>;
85
+ squash: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
70
86
  should_remove_source_branch: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
71
87
  merge_when_pipeline_succeeds: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
72
88
  sha: z.ZodOptional<z.ZodString>;
73
- }, z.core.$strip>;
74
- export declare const ManageMrDiscussionSchema: z.ZodObject<{
75
- action: z.ZodEnum<{
76
- update: "update";
77
- comment: "comment";
78
- thread: "thread";
79
- reply: "reply";
80
- }>;
89
+ }, z.core.$strip>], "action">;
90
+ export declare const ManageMrDiscussionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
91
+ action: z.ZodLiteral<"comment">;
81
92
  project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
82
- noteable_type: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
93
+ noteable_type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
83
94
  issue: "issue";
84
95
  merge_request: "merge_request";
85
- }>>>;
86
- noteable_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
96
+ }>>;
97
+ noteable_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
98
+ body: z.ZodString;
87
99
  confidential: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
88
- merge_request_iid: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
100
+ created_at: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ action: z.ZodLiteral<"thread">;
103
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
104
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
105
+ body: z.ZodString;
89
106
  position: z.ZodOptional<z.ZodObject<{
90
107
  base_sha: z.ZodOptional<z.ZodString>;
91
108
  start_sha: z.ZodOptional<z.ZodString>;
@@ -124,22 +141,25 @@ export declare const ManageMrDiscussionSchema: z.ZodObject<{
124
141
  y: z.ZodOptional<z.ZodNumber>;
125
142
  }, z.core.$strip>>;
126
143
  commit_id: z.ZodOptional<z.ZodString>;
127
- discussion_id: z.ZodOptional<z.ZodString>;
128
- note_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
129
- body: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ action: z.ZodLiteral<"reply">;
146
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
147
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
148
+ discussion_id: z.ZodString;
149
+ body: z.ZodString;
130
150
  created_at: z.ZodOptional<z.ZodString>;
131
- }, z.core.$strip>;
132
- export declare const ManageDraftNotesSchema: z.ZodObject<{
133
- action: z.ZodEnum<{
134
- create: "create";
135
- update: "update";
136
- delete: "delete";
137
- publish: "publish";
138
- publish_all: "publish_all";
139
- }>;
151
+ }, z.core.$strip>, z.ZodObject<{
152
+ action: z.ZodLiteral<"update">;
140
153
  project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
141
154
  merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
142
- note: z.ZodOptional<z.ZodString>;
155
+ note_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
156
+ body: z.ZodString;
157
+ }, z.core.$strip>], "action">;
158
+ export declare const ManageDraftNotesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
159
+ action: z.ZodLiteral<"create">;
160
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
161
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
162
+ note: z.ZodString;
143
163
  position: z.ZodOptional<z.ZodObject<{
144
164
  base_sha: z.ZodOptional<z.ZodString>;
145
165
  start_sha: z.ZodOptional<z.ZodString>;
@@ -179,8 +199,64 @@ export declare const ManageDraftNotesSchema: z.ZodObject<{
179
199
  }, z.core.$strip>>;
180
200
  in_reply_to_discussion_id: z.ZodOptional<z.ZodString>;
181
201
  commit_id: z.ZodOptional<z.ZodString>;
182
- draft_note_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
183
- }, z.core.$strip>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ action: z.ZodLiteral<"update">;
204
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
205
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
206
+ draft_note_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
207
+ note: z.ZodString;
208
+ position: z.ZodOptional<z.ZodObject<{
209
+ base_sha: z.ZodOptional<z.ZodString>;
210
+ start_sha: z.ZodOptional<z.ZodString>;
211
+ head_sha: z.ZodOptional<z.ZodString>;
212
+ position_type: z.ZodOptional<z.ZodEnum<{
213
+ text: "text";
214
+ image: "image";
215
+ }>>;
216
+ old_path: z.ZodOptional<z.ZodString>;
217
+ new_path: z.ZodOptional<z.ZodString>;
218
+ old_line: z.ZodOptional<z.ZodNumber>;
219
+ new_line: z.ZodOptional<z.ZodNumber>;
220
+ line_range: z.ZodOptional<z.ZodObject<{
221
+ start: z.ZodObject<{
222
+ line_code: z.ZodString;
223
+ type: z.ZodOptional<z.ZodEnum<{
224
+ new: "new";
225
+ old: "old";
226
+ }>>;
227
+ old_line: z.ZodOptional<z.ZodNumber>;
228
+ new_line: z.ZodOptional<z.ZodNumber>;
229
+ }, z.core.$strip>;
230
+ end: z.ZodObject<{
231
+ line_code: z.ZodString;
232
+ type: z.ZodOptional<z.ZodEnum<{
233
+ new: "new";
234
+ old: "old";
235
+ }>>;
236
+ old_line: z.ZodOptional<z.ZodNumber>;
237
+ new_line: z.ZodOptional<z.ZodNumber>;
238
+ }, z.core.$strip>;
239
+ }, z.core.$strip>>;
240
+ width: z.ZodOptional<z.ZodNumber>;
241
+ height: z.ZodOptional<z.ZodNumber>;
242
+ x: z.ZodOptional<z.ZodNumber>;
243
+ y: z.ZodOptional<z.ZodNumber>;
244
+ }, z.core.$strip>>;
245
+ }, z.core.$strip>, z.ZodObject<{
246
+ action: z.ZodLiteral<"publish">;
247
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
248
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
249
+ draft_note_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ action: z.ZodLiteral<"publish_all">;
252
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
253
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
254
+ }, z.core.$strip>, z.ZodObject<{
255
+ action: z.ZodLiteral<"delete">;
256
+ project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
257
+ merge_request_iid: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
258
+ draft_note_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
259
+ }, z.core.$strip>], "action">;
184
260
  export type ManageMergeRequestInput = z.infer<typeof ManageMergeRequestSchema>;
185
261
  export type ManageMrDiscussionInput = z.infer<typeof ManageMrDiscussionSchema>;
186
262
  export type ManageDraftNotesInput = z.infer<typeof ManageDraftNotesSchema>;
@@ -34,290 +34,172 @@ exports.MergeRequestThreadPositionSchema = zod_1.z.object({
34
34
  x: zod_1.z.number().optional().describe("Horizontal pixel position for image comment."),
35
35
  y: zod_1.z.number().optional().describe("Vertical pixel position for image comment."),
36
36
  });
37
- exports.ManageMergeRequestSchema = zod_1.z
38
- .object({
39
- action: zod_1.z.enum(["create", "update", "merge"]).describe("Action to perform"),
40
- project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
41
- source_branch: zod_1.z
42
- .string()
43
- .optional()
44
- .describe("Branch containing changes to merge. Required for 'create' action."),
45
- target_branch: zod_1.z.string().optional().describe("Branch to merge into."),
46
- title: zod_1.z.string().optional().describe("MR title/summary. Required for 'create' action."),
47
- assignee_id: zod_1.z.string().optional().describe("Single assignee user ID."),
48
- assignee_ids: zod_1.z.array(zod_1.z.string()).optional().describe("Multiple assignee IDs."),
49
- reviewer_ids: zod_1.z.array(zod_1.z.string()).optional().describe("User IDs for code reviewers."),
50
- description: zod_1.z.string().optional().describe("MR description (Markdown)."),
51
- target_project_id: zod_1.z.coerce
52
- .string()
53
- .optional()
54
- .describe("Target project for cross-project MRs. For 'create' action."),
37
+ const projectIdField = utils_1.requiredId.describe("Project ID or URL-encoded path");
38
+ const mergeRequestIidField = utils_1.requiredId.describe("Internal MR ID unique to project");
39
+ const CreateMergeRequestSchema = zod_1.z.object({
40
+ action: zod_1.z.literal("create").describe("Create a new merge request"),
41
+ project_id: projectIdField,
42
+ source_branch: zod_1.z.string().describe("Branch containing changes to merge"),
43
+ target_branch: zod_1.z.string().describe("Branch to merge into"),
44
+ title: zod_1.z.string().describe("MR title/summary"),
45
+ assignee_id: zod_1.z.string().optional().describe("Single assignee user ID"),
46
+ assignee_ids: zod_1.z.array(zod_1.z.string()).optional().describe("Multiple assignee IDs"),
47
+ reviewer_ids: zod_1.z.array(zod_1.z.string()).optional().describe("User IDs for code reviewers"),
48
+ description: zod_1.z.string().optional().describe("MR description (Markdown)"),
49
+ target_project_id: zod_1.z.coerce.string().optional().describe("Target project for cross-project MRs"),
55
50
  labels: zod_1.z
56
51
  .union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
57
52
  .optional()
58
- .describe("Labels to categorize MR."),
59
- milestone_id: zod_1.z.string().optional().describe("Associate MR with milestone."),
53
+ .describe("Labels to categorize MR"),
54
+ milestone_id: zod_1.z.string().optional().describe("Associate MR with milestone"),
60
55
  remove_source_branch: utils_1.flexibleBoolean
61
56
  .optional()
62
- .describe("Auto-delete source branch after merge."),
63
- allow_collaboration: utils_1.flexibleBoolean
64
- .optional()
65
- .describe("Let maintainers push to source branch."),
57
+ .describe("Auto-delete source branch after merge"),
58
+ allow_collaboration: utils_1.flexibleBoolean.optional().describe("Let maintainers push to source branch"),
66
59
  allow_maintainer_to_push: utils_1.flexibleBoolean
67
60
  .optional()
68
- .describe("Deprecated - use allow_collaboration."),
69
- squash: utils_1.flexibleBoolean.optional().describe("Combine all commits into one when merging."),
70
- merge_request_iid: utils_1.requiredId
61
+ .describe("Deprecated - use allow_collaboration"),
62
+ squash: utils_1.flexibleBoolean.optional().describe("Combine all commits into one when merging"),
63
+ });
64
+ const UpdateMergeRequestSchema = zod_1.z.object({
65
+ action: zod_1.z.literal("update").describe("Update an existing merge request"),
66
+ project_id: projectIdField,
67
+ merge_request_iid: mergeRequestIidField,
68
+ target_branch: zod_1.z.string().optional().describe("Branch to merge into"),
69
+ title: zod_1.z.string().optional().describe("MR title/summary"),
70
+ assignee_id: zod_1.z.string().optional().describe("Single assignee user ID"),
71
+ assignee_ids: zod_1.z.array(zod_1.z.string()).optional().describe("Multiple assignee IDs"),
72
+ reviewer_ids: zod_1.z.array(zod_1.z.string()).optional().describe("User IDs for code reviewers"),
73
+ description: zod_1.z.string().optional().describe("MR description (Markdown)"),
74
+ labels: zod_1.z
75
+ .union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
71
76
  .optional()
72
- .describe("Internal MR ID unique to project. Required for 'update' and 'merge' actions."),
77
+ .describe("Labels to categorize MR"),
73
78
  add_labels: zod_1.z
74
79
  .union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
75
80
  .optional()
76
- .describe("Labels to add. For 'update' action."),
81
+ .describe("Labels to add"),
77
82
  remove_labels: zod_1.z
78
83
  .union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
79
84
  .optional()
80
- .describe("Labels to remove. For 'update' action."),
85
+ .describe("Labels to remove"),
86
+ milestone_id: zod_1.z.string().optional().describe("Associate MR with milestone"),
87
+ remove_source_branch: utils_1.flexibleBoolean
88
+ .optional()
89
+ .describe("Auto-delete source branch after merge"),
90
+ allow_collaboration: utils_1.flexibleBoolean.optional().describe("Let maintainers push to source branch"),
91
+ allow_maintainer_to_push: utils_1.flexibleBoolean
92
+ .optional()
93
+ .describe("Deprecated - use allow_collaboration"),
94
+ squash: utils_1.flexibleBoolean.optional().describe("Combine all commits into one when merging"),
81
95
  state_event: zod_1.z
82
96
  .string()
83
97
  .transform(val => val.toLowerCase())
84
98
  .pipe(zod_1.z.enum(["close", "reopen"]))
85
99
  .optional()
86
- .describe("State event: close or reopen. For 'update' action."),
87
- discussion_locked: utils_1.flexibleBoolean
88
- .optional()
89
- .describe("Lock discussion thread. For 'update' action."),
90
- merge_commit_message: zod_1.z
91
- .string()
92
- .optional()
93
- .describe("Custom merge commit message. For 'merge' action."),
94
- squash_commit_message: zod_1.z
95
- .string()
96
- .optional()
97
- .describe("Custom squash commit message. For 'merge' action."),
100
+ .describe("State event: close or reopen"),
101
+ discussion_locked: utils_1.flexibleBoolean.optional().describe("Lock discussion thread"),
102
+ });
103
+ const MergeMergeRequestSchema = zod_1.z.object({
104
+ action: zod_1.z.literal("merge").describe("Merge an approved merge request"),
105
+ project_id: projectIdField,
106
+ merge_request_iid: mergeRequestIidField,
107
+ merge_commit_message: zod_1.z.string().optional().describe("Custom merge commit message"),
108
+ squash_commit_message: zod_1.z.string().optional().describe("Custom squash commit message"),
109
+ squash: utils_1.flexibleBoolean.optional().describe("Combine all commits into one when merging"),
98
110
  should_remove_source_branch: utils_1.flexibleBoolean
99
111
  .optional()
100
- .describe("Remove source branch after merge. For 'merge' action."),
101
- merge_when_pipeline_succeeds: utils_1.flexibleBoolean
102
- .optional()
103
- .describe("Merge when pipeline succeeds. For 'merge' action."),
104
- sha: zod_1.z.string().optional().describe("SHA of the head commit. For 'merge' action."),
105
- })
106
- .refine(data => data.action !== "create" || data.source_branch !== undefined, {
107
- message: "source_branch is required for 'create' action",
108
- path: ["source_branch"],
109
- })
110
- .refine(data => data.action !== "create" || data.target_branch !== undefined, {
111
- message: "target_branch is required for 'create' action",
112
- path: ["target_branch"],
113
- })
114
- .refine(data => data.action !== "create" || data.title !== undefined, {
115
- message: "title is required for 'create' action",
116
- path: ["title"],
117
- })
118
- .refine(data => data.action === "create" || data.merge_request_iid !== undefined, {
119
- message: "merge_request_iid is required for 'update' and 'merge' actions",
120
- path: ["merge_request_iid"],
121
- })
122
- .refine(data => data.action === "create" || data.source_branch === undefined, {
123
- message: "source_branch is only valid for 'create' action",
124
- path: ["source_branch"],
125
- })
126
- .refine(data => data.action === "create" || data.target_project_id === undefined, {
127
- message: "target_project_id is only valid for 'create' action",
128
- path: ["target_project_id"],
129
- })
130
- .refine(data => data.action === "update" || data.add_labels === undefined, {
131
- message: "add_labels is only valid for 'update' action",
132
- path: ["add_labels"],
133
- })
134
- .refine(data => data.action === "update" || data.remove_labels === undefined, {
135
- message: "remove_labels is only valid for 'update' action",
136
- path: ["remove_labels"],
137
- })
138
- .refine(data => data.action === "update" || data.state_event === undefined, {
139
- message: "state_event is only valid for 'update' action",
140
- path: ["state_event"],
141
- })
142
- .refine(data => data.action === "update" || data.discussion_locked === undefined, {
143
- message: "discussion_locked is only valid for 'update' action",
144
- path: ["discussion_locked"],
145
- })
146
- .refine(data => data.action === "merge" || data.merge_commit_message === undefined, {
147
- message: "merge_commit_message is only valid for 'merge' action",
148
- path: ["merge_commit_message"],
149
- })
150
- .refine(data => data.action === "merge" || data.squash_commit_message === undefined, {
151
- message: "squash_commit_message is only valid for 'merge' action",
152
- path: ["squash_commit_message"],
153
- })
154
- .refine(data => data.action === "merge" || data.should_remove_source_branch === undefined, {
155
- message: "should_remove_source_branch is only valid for 'merge' action",
156
- path: ["should_remove_source_branch"],
157
- })
158
- .refine(data => data.action === "merge" || data.merge_when_pipeline_succeeds === undefined, {
159
- message: "merge_when_pipeline_succeeds is only valid for 'merge' action",
160
- path: ["merge_when_pipeline_succeeds"],
161
- })
162
- .refine(data => data.action === "merge" || data.sha === undefined, {
163
- message: "sha is only valid for 'merge' action",
164
- path: ["sha"],
165
- })
166
- .refine(data => data.action !== "merge" || data.target_branch === undefined, {
167
- message: "target_branch is not valid for 'merge' action",
168
- path: ["target_branch"],
169
- })
170
- .refine(data => data.action !== "merge" || data.title === undefined, {
171
- message: "title is not valid for 'merge' action",
172
- path: ["title"],
112
+ .describe("Remove source branch after merge"),
113
+ merge_when_pipeline_succeeds: utils_1.flexibleBoolean.optional().describe("Merge when pipeline succeeds"),
114
+ sha: zod_1.z.string().optional().describe("SHA of the head commit"),
173
115
  });
174
- exports.ManageMrDiscussionSchema = zod_1.z
175
- .object({
176
- action: zod_1.z.enum(["comment", "thread", "reply", "update"]).describe("Action to perform"),
177
- project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
116
+ exports.ManageMergeRequestSchema = zod_1.z.discriminatedUnion("action", [
117
+ CreateMergeRequestSchema,
118
+ UpdateMergeRequestSchema,
119
+ MergeMergeRequestSchema,
120
+ ]);
121
+ const CommentOnNoteableSchema = zod_1.z.object({
122
+ action: zod_1.z.literal("comment").describe("Add a comment to an issue or merge request"),
123
+ project_id: projectIdField,
178
124
  noteable_type: zod_1.z
179
125
  .string()
180
126
  .transform(val => val.toLowerCase())
181
127
  .pipe(zod_1.z.enum(["issue", "merge_request"]))
182
- .optional()
183
- .describe("Type of noteable: issue or merge_request. Required for 'comment' action."),
184
- noteable_id: utils_1.requiredId
185
- .optional()
186
- .describe("ID of the noteable object. Required for 'comment' action."),
187
- confidential: utils_1.flexibleBoolean
188
- .optional()
189
- .describe("Confidential note flag. For 'comment' action."),
190
- merge_request_iid: utils_1.requiredId
191
- .optional()
192
- .describe("Internal MR ID. Required for 'thread', 'reply', 'update' actions."),
193
- position: exports.MergeRequestThreadPositionSchema.optional().describe("Position for diff note. For 'thread' action."),
194
- commit_id: zod_1.z
195
- .string()
196
- .optional()
197
- .describe("SHA of commit to start discussion on. For 'thread' action."),
198
- discussion_id: zod_1.z
199
- .string()
200
- .optional()
201
- .describe("ID of the discussion to reply to. Required for 'reply' action."),
202
- note_id: utils_1.requiredId
203
- .optional()
204
- .describe("ID of the note to update. Required for 'update' action."),
205
- body: zod_1.z.string().optional().describe("Content/text. Required for all actions."),
206
- created_at: zod_1.z
207
- .string()
208
- .optional()
209
- .describe("Date time string (ISO 8601). For 'comment' and 'reply' actions."),
210
- })
211
- .refine(data => data.body !== undefined, {
212
- message: "body is required",
213
- path: ["body"],
214
- })
215
- .refine(data => data.action !== "comment" || data.noteable_type !== undefined, {
216
- message: "noteable_type is required for 'comment' action",
217
- path: ["noteable_type"],
218
- })
219
- .refine(data => data.action !== "comment" || data.noteable_id !== undefined, {
220
- message: "noteable_id is required for 'comment' action",
221
- path: ["noteable_id"],
222
- })
223
- .refine(data => !["thread", "reply", "update"].includes(data.action) || data.merge_request_iid !== undefined, {
224
- message: "merge_request_iid is required for 'thread', 'reply', 'update' actions",
225
- path: ["merge_request_iid"],
226
- })
227
- .refine(data => data.action !== "reply" || data.discussion_id !== undefined, {
228
- message: "discussion_id is required for 'reply' action",
229
- path: ["discussion_id"],
230
- })
231
- .refine(data => data.action !== "update" || data.note_id !== undefined, {
232
- message: "note_id is required for 'update' action",
233
- path: ["note_id"],
234
- })
235
- .refine(data => data.action === "comment" || data.noteable_type === undefined, {
236
- message: "noteable_type is only valid for 'comment' action",
237
- path: ["noteable_type"],
238
- })
239
- .refine(data => data.action === "comment" || data.noteable_id === undefined, {
240
- message: "noteable_id is only valid for 'comment' action",
241
- path: ["noteable_id"],
242
- })
243
- .refine(data => data.action === "comment" || data.confidential === undefined, {
244
- message: "confidential is only valid for 'comment' action",
245
- path: ["confidential"],
246
- })
247
- .refine(data => data.action !== "comment" || data.merge_request_iid === undefined, {
248
- message: "merge_request_iid is not valid for 'comment' action (use noteable_id instead)",
249
- path: ["merge_request_iid"],
250
- })
251
- .refine(data => data.action === "thread" || data.position === undefined, {
252
- message: "position is only valid for 'thread' action",
253
- path: ["position"],
254
- })
255
- .refine(data => data.action === "thread" || data.commit_id === undefined, {
256
- message: "commit_id is only valid for 'thread' action",
257
- path: ["commit_id"],
258
- })
259
- .refine(data => data.action === "reply" || data.discussion_id === undefined, {
260
- message: "discussion_id is only valid for 'reply' action",
261
- path: ["discussion_id"],
262
- })
263
- .refine(data => data.action === "update" || data.note_id === undefined, {
264
- message: "note_id is only valid for 'update' action",
265
- path: ["note_id"],
266
- })
267
- .refine(data => ["comment", "reply"].includes(data.action) || data.created_at === undefined, {
268
- message: "created_at is only valid for 'comment' and 'reply' actions",
269
- path: ["created_at"],
128
+ .describe("Type of noteable: issue or merge_request"),
129
+ noteable_id: utils_1.requiredId.describe("ID of the noteable object"),
130
+ body: zod_1.z.string().describe("Content/text of the comment"),
131
+ confidential: utils_1.flexibleBoolean.optional().describe("Confidential note flag"),
132
+ created_at: zod_1.z.string().optional().describe("Date time string (ISO 8601)"),
270
133
  });
271
- exports.ManageDraftNotesSchema = zod_1.z
272
- .object({
273
- action: zod_1.z
274
- .enum(["create", "update", "publish", "publish_all", "delete"])
275
- .describe("Action to perform"),
276
- project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
277
- merge_request_iid: utils_1.requiredId.describe("Internal MR ID unique to project."),
278
- note: zod_1.z
279
- .string()
280
- .optional()
281
- .describe("Content of the draft note. Required for 'create' and 'update' actions."),
282
- position: exports.MergeRequestThreadPositionSchema.optional().describe("Position for diff note. For 'create' and 'update' actions."),
283
- in_reply_to_discussion_id: zod_1.z
284
- .string()
285
- .optional()
286
- .describe("Discussion ID to reply to. For 'create' action."),
287
- commit_id: zod_1.z
288
- .string()
289
- .optional()
290
- .describe("SHA of commit to start discussion on. For 'create' action."),
291
- draft_note_id: utils_1.requiredId
292
- .optional()
293
- .describe("ID of the draft note. Required for 'update', 'publish', 'delete' actions."),
294
- })
295
- .refine(data => !["create", "update"].includes(data.action) || data.note !== undefined, {
296
- message: "note is required for 'create' and 'update' actions",
297
- path: ["note"],
298
- })
299
- .refine(data => !["update", "publish", "delete"].includes(data.action) || data.draft_note_id !== undefined, {
300
- message: "draft_note_id is required for 'update', 'publish', 'delete' actions",
301
- path: ["draft_note_id"],
302
- })
303
- .refine(data => ["create", "update"].includes(data.action) || data.note === undefined, {
304
- message: "note is only valid for 'create' and 'update' actions",
305
- path: ["note"],
306
- })
307
- .refine(data => ["create", "update"].includes(data.action) || data.position === undefined, {
308
- message: "position is only valid for 'create' and 'update' actions",
309
- path: ["position"],
310
- })
311
- .refine(data => data.action === "create" || data.in_reply_to_discussion_id === undefined, {
312
- message: "in_reply_to_discussion_id is only valid for 'create' action",
313
- path: ["in_reply_to_discussion_id"],
314
- })
315
- .refine(data => data.action === "create" || data.commit_id === undefined, {
316
- message: "commit_id is only valid for 'create' action",
317
- path: ["commit_id"],
318
- })
319
- .refine(data => data.action !== "create" || data.draft_note_id === undefined, {
320
- message: "draft_note_id is not valid for 'create' action",
321
- path: ["draft_note_id"],
134
+ const CreateThreadSchema = zod_1.z.object({
135
+ action: zod_1.z.literal("thread").describe("Start a new discussion thread on an MR"),
136
+ project_id: projectIdField,
137
+ merge_request_iid: mergeRequestIidField,
138
+ body: zod_1.z.string().describe("Content/text of the thread"),
139
+ position: exports.MergeRequestThreadPositionSchema.optional().describe("Position for diff note"),
140
+ commit_id: zod_1.z.string().optional().describe("SHA of commit to start discussion on"),
141
+ });
142
+ const ReplyToThreadSchema = zod_1.z.object({
143
+ action: zod_1.z.literal("reply").describe("Reply to an existing discussion thread"),
144
+ project_id: projectIdField,
145
+ merge_request_iid: mergeRequestIidField,
146
+ discussion_id: zod_1.z.string().describe("ID of the discussion to reply to"),
147
+ body: zod_1.z.string().describe("Content/text of the reply"),
148
+ created_at: zod_1.z.string().optional().describe("Date time string (ISO 8601)"),
149
+ });
150
+ const UpdateNoteSchema = zod_1.z.object({
151
+ action: zod_1.z.literal("update").describe("Update an existing note/comment"),
152
+ project_id: projectIdField,
153
+ merge_request_iid: mergeRequestIidField,
154
+ note_id: utils_1.requiredId.describe("ID of the note to update"),
155
+ body: zod_1.z.string().describe("New content/text for the note"),
156
+ });
157
+ exports.ManageMrDiscussionSchema = zod_1.z.discriminatedUnion("action", [
158
+ CommentOnNoteableSchema,
159
+ CreateThreadSchema,
160
+ ReplyToThreadSchema,
161
+ UpdateNoteSchema,
162
+ ]);
163
+ const draftNoteIdField = utils_1.requiredId.describe("ID of the draft note");
164
+ const CreateDraftNoteSchema = zod_1.z.object({
165
+ action: zod_1.z.literal("create").describe("Create a new draft note"),
166
+ project_id: projectIdField,
167
+ merge_request_iid: mergeRequestIidField,
168
+ note: zod_1.z.string().describe("Content of the draft note"),
169
+ position: exports.MergeRequestThreadPositionSchema.optional().describe("Position for diff note"),
170
+ in_reply_to_discussion_id: zod_1.z.string().optional().describe("Discussion ID to reply to"),
171
+ commit_id: zod_1.z.string().optional().describe("SHA of commit to start discussion on"),
172
+ });
173
+ const UpdateDraftNoteSchema = zod_1.z.object({
174
+ action: zod_1.z.literal("update").describe("Update an existing draft note"),
175
+ project_id: projectIdField,
176
+ merge_request_iid: mergeRequestIidField,
177
+ draft_note_id: draftNoteIdField,
178
+ note: zod_1.z.string().describe("New content for the draft note"),
179
+ position: exports.MergeRequestThreadPositionSchema.optional().describe("Position for diff note"),
180
+ });
181
+ const PublishDraftNoteSchema = zod_1.z.object({
182
+ action: zod_1.z.literal("publish").describe("Publish a single draft note"),
183
+ project_id: projectIdField,
184
+ merge_request_iid: mergeRequestIidField,
185
+ draft_note_id: draftNoteIdField,
186
+ });
187
+ const PublishAllDraftNotesSchema = zod_1.z.object({
188
+ action: zod_1.z.literal("publish_all").describe("Publish all draft notes at once"),
189
+ project_id: projectIdField,
190
+ merge_request_iid: mergeRequestIidField,
191
+ });
192
+ const DeleteDraftNoteSchema = zod_1.z.object({
193
+ action: zod_1.z.literal("delete").describe("Delete a draft note"),
194
+ project_id: projectIdField,
195
+ merge_request_iid: mergeRequestIidField,
196
+ draft_note_id: draftNoteIdField,
322
197
  });
198
+ exports.ManageDraftNotesSchema = zod_1.z.discriminatedUnion("action", [
199
+ CreateDraftNoteSchema,
200
+ UpdateDraftNoteSchema,
201
+ PublishDraftNoteSchema,
202
+ PublishAllDraftNotesSchema,
203
+ DeleteDraftNoteSchema,
204
+ ]);
323
205
  //# sourceMappingURL=schema.js.map