gitlab-auto-reviewers 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1878 -0
  3. package/dist/api/gitlab-api.d.ts +136 -0
  4. package/dist/api/gitlab-api.d.ts.map +1 -0
  5. package/dist/api/gitlab-api.js +334 -0
  6. package/dist/api/gitlab-api.js.map +1 -0
  7. package/dist/bin/cli.d.ts +10 -0
  8. package/dist/bin/cli.d.ts.map +1 -0
  9. package/dist/bin/cli.js +186 -0
  10. package/dist/bin/cli.js.map +1 -0
  11. package/dist/bin/deprecated-mcp.d.ts +12 -0
  12. package/dist/bin/deprecated-mcp.d.ts.map +1 -0
  13. package/dist/bin/deprecated-mcp.js +73 -0
  14. package/dist/bin/deprecated-mcp.js.map +1 -0
  15. package/dist/bin/index.d.ts +18 -0
  16. package/dist/bin/index.d.ts.map +1 -0
  17. package/dist/bin/index.js +78 -0
  18. package/dist/bin/index.js.map +1 -0
  19. package/dist/bin/mcp.d.ts +11 -0
  20. package/dist/bin/mcp.d.ts.map +1 -0
  21. package/dist/bin/mcp.js +43 -0
  22. package/dist/bin/mcp.js.map +1 -0
  23. package/dist/cache/cache.service.d.ts +113 -0
  24. package/dist/cache/cache.service.d.ts.map +1 -0
  25. package/dist/cache/cache.service.js +213 -0
  26. package/dist/cache/cache.service.js.map +1 -0
  27. package/dist/cli/commands.d.ts +40 -0
  28. package/dist/cli/commands.d.ts.map +1 -0
  29. package/dist/cli/commands.js +142 -0
  30. package/dist/cli/commands.js.map +1 -0
  31. package/dist/cli/output.d.ts +24 -0
  32. package/dist/cli/output.d.ts.map +1 -0
  33. package/dist/cli/output.js +143 -0
  34. package/dist/cli/output.js.map +1 -0
  35. package/dist/config/config.service.d.ts +89 -0
  36. package/dist/config/config.service.d.ts.map +1 -0
  37. package/dist/config/config.service.js +169 -0
  38. package/dist/config/config.service.js.map +1 -0
  39. package/dist/datasources/git-data-source.interface.d.ts +140 -0
  40. package/dist/datasources/git-data-source.interface.d.ts.map +1 -0
  41. package/dist/datasources/git-data-source.interface.js +2 -0
  42. package/dist/datasources/git-data-source.interface.js.map +1 -0
  43. package/dist/datasources/gitlab-api-data-source.d.ts +127 -0
  44. package/dist/datasources/gitlab-api-data-source.d.ts.map +1 -0
  45. package/dist/datasources/gitlab-api-data-source.js +248 -0
  46. package/dist/datasources/gitlab-api-data-source.js.map +1 -0
  47. package/dist/datasources/local-git-data-source.d.ts +124 -0
  48. package/dist/datasources/local-git-data-source.d.ts.map +1 -0
  49. package/dist/datasources/local-git-data-source.js +580 -0
  50. package/dist/datasources/local-git-data-source.js.map +1 -0
  51. package/dist/errors/error-handler.d.ts +113 -0
  52. package/dist/errors/error-handler.d.ts.map +1 -0
  53. package/dist/errors/error-handler.js +230 -0
  54. package/dist/errors/error-handler.js.map +1 -0
  55. package/dist/index.d.ts +139 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +139 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/logging/example.d.ts +15 -0
  60. package/dist/logging/example.d.ts.map +1 -0
  61. package/dist/logging/example.js +79 -0
  62. package/dist/logging/example.js.map +1 -0
  63. package/dist/logging/index.d.ts +7 -0
  64. package/dist/logging/index.d.ts.map +1 -0
  65. package/dist/logging/index.js +7 -0
  66. package/dist/logging/index.js.map +1 -0
  67. package/dist/logging/logger.service.d.ts +98 -0
  68. package/dist/logging/logger.service.d.ts.map +1 -0
  69. package/dist/logging/logger.service.js +160 -0
  70. package/dist/logging/logger.service.js.map +1 -0
  71. package/dist/mcp/server.d.ts +67 -0
  72. package/dist/mcp/server.d.ts.map +1 -0
  73. package/dist/mcp/server.js +213 -0
  74. package/dist/mcp/server.js.map +1 -0
  75. package/dist/mcp/tools.d.ts +22 -0
  76. package/dist/mcp/tools.d.ts.map +1 -0
  77. package/dist/mcp/tools.js +176 -0
  78. package/dist/mcp/tools.js.map +1 -0
  79. package/dist/services/blacklist.service.d.ts +32 -0
  80. package/dist/services/blacklist.service.d.ts.map +1 -0
  81. package/dist/services/blacklist.service.js +59 -0
  82. package/dist/services/blacklist.service.js.map +1 -0
  83. package/dist/services/codeowners.service.d.ts +45 -0
  84. package/dist/services/codeowners.service.d.ts.map +1 -0
  85. package/dist/services/codeowners.service.js +200 -0
  86. package/dist/services/codeowners.service.js.map +1 -0
  87. package/dist/services/comment-builder.service.d.ts +48 -0
  88. package/dist/services/comment-builder.service.d.ts.map +1 -0
  89. package/dist/services/comment-builder.service.js +61 -0
  90. package/dist/services/comment-builder.service.js.map +1 -0
  91. package/dist/services/contributors.service.d.ts +52 -0
  92. package/dist/services/contributors.service.d.ts.map +1 -0
  93. package/dist/services/contributors.service.js +144 -0
  94. package/dist/services/contributors.service.js.map +1 -0
  95. package/dist/services/reviewer-service.d.ts +125 -0
  96. package/dist/services/reviewer-service.d.ts.map +1 -0
  97. package/dist/services/reviewer-service.js +554 -0
  98. package/dist/services/reviewer-service.js.map +1 -0
  99. package/dist/services/team-members.service.d.ts +29 -0
  100. package/dist/services/team-members.service.d.ts.map +1 -0
  101. package/dist/services/team-members.service.js +45 -0
  102. package/dist/services/team-members.service.js.map +1 -0
  103. package/dist/services/whitelist.service.d.ts +31 -0
  104. package/dist/services/whitelist.service.d.ts.map +1 -0
  105. package/dist/services/whitelist.service.js +51 -0
  106. package/dist/services/whitelist.service.js.map +1 -0
  107. package/dist/tools.d.ts +22 -0
  108. package/dist/tools.d.ts.map +1 -0
  109. package/dist/tools.js +176 -0
  110. package/dist/tools.js.map +1 -0
  111. package/dist/types/index.d.ts +502 -0
  112. package/dist/types/index.d.ts.map +1 -0
  113. package/dist/types/index.js +91 -0
  114. package/dist/types/index.js.map +1 -0
  115. package/dist/types.d.ts +219 -0
  116. package/dist/types.d.ts.map +1 -0
  117. package/dist/types.js +7 -0
  118. package/dist/types.js.map +1 -0
  119. package/package.json +71 -0
@@ -0,0 +1,502 @@
1
+ /**
2
+ * Type Definitions for MCP Server
3
+ *
4
+ * Comprehensive type definitions for GitLab API responses and internal data structures.
5
+ * Replaces all `any` types with proper TypeScript interfaces.
6
+ */
7
+ /**
8
+ * GitLab User
9
+ *
10
+ * @property id - GitLab user ID
11
+ * @property username - GitLab username
12
+ * @property name - Full display name
13
+ * @property email - Email address (optional)
14
+ * @property state - User account state (e.g., 'active', 'blocked')
15
+ * @property avatar_url - URL to user's avatar image (optional)
16
+ * @property web_url - URL to user's GitLab profile
17
+ */
18
+ export interface GitLabUser {
19
+ id: number;
20
+ username: string;
21
+ name: string;
22
+ email?: string;
23
+ state: string;
24
+ avatar_url?: string;
25
+ web_url: string;
26
+ }
27
+ /**
28
+ * GitLab Merge Request
29
+ *
30
+ * @property id - Global merge request ID
31
+ * @property iid - Project-specific internal ID (IID)
32
+ * @property project_id - ID of the project containing this MR
33
+ * @property title - Merge request title
34
+ * @property description - Merge request description (can be null)
35
+ * @property state - Current state of the merge request
36
+ * @property created_at - When the MR was created (ISO 8601)
37
+ * @property updated_at - When the MR was last updated (ISO 8601)
38
+ * @property merged_at - When the MR was merged (ISO 8601, null if not merged)
39
+ * @property closed_at - When the MR was closed (ISO 8601, null if not closed)
40
+ * @property target_branch - Target branch name (where changes will be merged)
41
+ * @property source_branch - Source branch name (where changes come from)
42
+ * @property author - User who created the merge request
43
+ * @property assignee - Single assignee (deprecated, use assignees)
44
+ * @property assignees - Array of assigned users
45
+ * @property reviewers - Array of reviewer users
46
+ * @property source_project_id - ID of the source project (for forks)
47
+ * @property target_project_id - ID of the target project
48
+ * @property labels - Array of label names applied to this MR
49
+ * @property draft - True if this is a draft merge request
50
+ * @property work_in_progress - True if marked as work in progress (deprecated)
51
+ * @property merge_when_pipeline_succeeds - True if auto-merge is enabled
52
+ * @property merge_status - Status of merge checks (e.g., 'can_be_merged')
53
+ * @property sha - Current HEAD SHA of the source branch
54
+ * @property merge_commit_sha - SHA of the merge commit (null if not merged)
55
+ * @property squash_commit_sha - SHA of the squash commit (null if not squashed)
56
+ * @property user_notes_count - Number of comments on this MR
57
+ * @property changes_count - Number of changed files (as string)
58
+ * @property should_remove_source_branch - True if source branch should be removed after merge
59
+ * @property force_remove_source_branch - True if source branch will be force removed
60
+ * @property web_url - URL to view this MR in GitLab web interface
61
+ * @property references - Reference strings for this MR
62
+ * @property references.short - Short reference (e.g., '!123')
63
+ * @property references.relative - Relative reference (e.g., 'project!123')
64
+ * @property references.full - Full reference (e.g., 'group/project!123')
65
+ * @property diff_refs - Diff reference SHAs (optional)
66
+ */
67
+ export interface MergeRequest {
68
+ id: number;
69
+ iid: number;
70
+ project_id: number;
71
+ title: string;
72
+ description: string | null;
73
+ state: 'opened' | 'closed' | 'locked' | 'merged';
74
+ created_at: string;
75
+ updated_at: string;
76
+ merged_at: string | null;
77
+ closed_at: string | null;
78
+ target_branch: string;
79
+ source_branch: string;
80
+ author: GitLabUser;
81
+ assignee: GitLabUser | null;
82
+ assignees: GitLabUser[];
83
+ reviewers: GitLabUser[];
84
+ source_project_id: number;
85
+ target_project_id: number;
86
+ labels: string[];
87
+ draft: boolean;
88
+ work_in_progress: boolean;
89
+ merge_when_pipeline_succeeds: boolean;
90
+ merge_status: string;
91
+ sha: string;
92
+ merge_commit_sha: string | null;
93
+ squash_commit_sha: string | null;
94
+ user_notes_count: number;
95
+ changes_count: string;
96
+ should_remove_source_branch: boolean | null;
97
+ force_remove_source_branch: boolean | null;
98
+ web_url: string;
99
+ references: {
100
+ short: string;
101
+ relative: string;
102
+ full: string;
103
+ };
104
+ diff_refs?: DiffRefs;
105
+ }
106
+ /**
107
+ * Diff References
108
+ *
109
+ * Contains the SHA references for comparing merge request changes.
110
+ *
111
+ * @property base_sha - The base commit SHA (target branch)
112
+ * @property head_sha - The head commit SHA (source branch)
113
+ * @property start_sha - The start commit SHA for the diff range
114
+ */
115
+ export interface DiffRefs {
116
+ base_sha: string;
117
+ head_sha: string;
118
+ start_sha: string;
119
+ }
120
+ /**
121
+ * Merge Request Diff
122
+ *
123
+ * Represents changes to a single file in a merge request.
124
+ *
125
+ * @property old_path - The file path before changes
126
+ * @property new_path - The file path after changes
127
+ * @property a_mode - File mode in the base version
128
+ * @property b_mode - File mode in the head version
129
+ * @property new_file - True if this is a newly created file
130
+ * @property renamed_file - True if the file was renamed
131
+ * @property deleted_file - True if the file was deleted
132
+ * @property diff - The unified diff content showing line changes
133
+ */
134
+ export interface MergeRequestDiff {
135
+ old_path: string;
136
+ new_path: string;
137
+ a_mode: string;
138
+ b_mode: string;
139
+ new_file: boolean;
140
+ renamed_file: boolean;
141
+ deleted_file: boolean;
142
+ diff: string;
143
+ }
144
+ /**
145
+ * Git Blame Line
146
+ *
147
+ * Represents git blame information for a range of lines in a file.
148
+ *
149
+ * @property commit - The commit that last modified these lines
150
+ * @property commit.id - Full commit SHA
151
+ * @property commit.message - Commit message
152
+ * @property commit.parent_ids - Array of parent commit SHAs
153
+ * @property commit.authored_date - When the commit was authored (ISO 8601)
154
+ * @property commit.author_name - Name of the commit author
155
+ * @property commit.author_email - Email of the commit author
156
+ * @property commit.committed_date - When the commit was committed (ISO 8601)
157
+ * @property commit.committer_name - Name of the committer
158
+ * @property commit.committer_email - Email of the committer
159
+ * @property lines - Array of line content strings from the file
160
+ */
161
+ export interface BlameLine {
162
+ commit: {
163
+ id: string;
164
+ message: string;
165
+ parent_ids: string[];
166
+ authored_date: string;
167
+ author_name: string;
168
+ author_email: string;
169
+ committed_date: string;
170
+ committer_name: string;
171
+ committer_email: string;
172
+ };
173
+ lines: string[];
174
+ }
175
+ /**
176
+ * GitLab Branch
177
+ *
178
+ * Represents a Git branch in a GitLab project.
179
+ *
180
+ * @property name - Branch name
181
+ * @property merged - True if the branch has been merged
182
+ * @property protected - True if the branch is protected from force pushes
183
+ * @property default - True if this is the default branch (e.g., main/master)
184
+ * @property developers_can_push - True if developers have push access
185
+ * @property developers_can_merge - True if developers can merge to this branch
186
+ * @property can_push - True if the current user can push to this branch
187
+ * @property web_url - URL to view the branch in GitLab web interface
188
+ * @property commit - The latest commit on this branch
189
+ * @property commit.id - Full commit SHA
190
+ * @property commit.short_id - Abbreviated commit SHA
191
+ * @property commit.created_at - When the commit was created (ISO 8601)
192
+ * @property commit.parent_ids - Array of parent commit SHAs
193
+ * @property commit.title - First line of the commit message
194
+ * @property commit.message - Full commit message
195
+ * @property commit.author_name - Name of the commit author
196
+ * @property commit.author_email - Email of the commit author
197
+ * @property commit.authored_date - When the commit was authored (ISO 8601)
198
+ * @property commit.committer_name - Name of the committer
199
+ * @property commit.committer_email - Email of the committer
200
+ * @property commit.committed_date - When the commit was committed (ISO 8601)
201
+ * @property commit.web_url - URL to view the commit in GitLab
202
+ */
203
+ export interface GitLabBranch {
204
+ name: string;
205
+ merged: boolean;
206
+ protected: boolean;
207
+ default: boolean;
208
+ developers_can_push: boolean;
209
+ developers_can_merge: boolean;
210
+ can_push: boolean;
211
+ web_url: string;
212
+ commit: {
213
+ id: string;
214
+ short_id: string;
215
+ created_at: string;
216
+ parent_ids: string[];
217
+ title: string;
218
+ message: string;
219
+ author_name: string;
220
+ author_email: string;
221
+ authored_date: string;
222
+ committer_name: string;
223
+ committer_email: string;
224
+ committed_date: string;
225
+ web_url: string;
226
+ };
227
+ }
228
+ /**
229
+ * GitLab Commit
230
+ *
231
+ * Represents a Git commit in a GitLab project.
232
+ *
233
+ * @property id - Full commit SHA
234
+ * @property short_id - Abbreviated commit SHA
235
+ * @property created_at - When the commit was created (ISO 8601)
236
+ * @property parent_ids - Array of parent commit SHAs
237
+ * @property title - First line of the commit message
238
+ * @property message - Full commit message
239
+ * @property author_name - Name of the commit author
240
+ * @property author_email - Email of the commit author
241
+ * @property authored_date - When the commit was authored (ISO 8601)
242
+ * @property committer_name - Name of the committer
243
+ * @property committer_email - Email of the committer
244
+ * @property committed_date - When the commit was committed (ISO 8601)
245
+ * @property web_url - URL to view the commit in GitLab
246
+ */
247
+ export interface GitLabCommit {
248
+ id: string;
249
+ short_id: string;
250
+ created_at: string;
251
+ parent_ids: string[];
252
+ title: string;
253
+ message: string;
254
+ author_name: string;
255
+ author_email: string;
256
+ authored_date: string;
257
+ committer_name: string;
258
+ committer_email: string;
259
+ committed_date: string;
260
+ web_url: string;
261
+ }
262
+ /**
263
+ * GitLab Note (Comment)
264
+ *
265
+ * Represents a comment or note on a GitLab object (merge request, issue, etc.).
266
+ *
267
+ * @property id - Unique note ID
268
+ * @property type - Type of note (null for regular comments)
269
+ * @property body - The comment text content
270
+ * @property attachment - URL to attached file (null if no attachment)
271
+ * @property author - The user who created the note
272
+ * @property created_at - When the note was created (ISO 8601)
273
+ * @property updated_at - When the note was last updated (ISO 8601)
274
+ * @property system - True if this is a system-generated note (e.g., status changes)
275
+ * @property noteable_id - ID of the object this note is attached to
276
+ * @property noteable_type - Type of object (e.g., 'MergeRequest', 'Issue')
277
+ * @property noteable_iid - Internal ID of the noteable object
278
+ * @property resolvable - True if this note can be marked as resolved
279
+ * @property confidential - True if this note is confidential
280
+ */
281
+ export interface GitLabNote {
282
+ id: number;
283
+ type: string | null;
284
+ body: string;
285
+ attachment: string | null;
286
+ author: GitLabUser;
287
+ created_at: string;
288
+ updated_at: string;
289
+ system: boolean;
290
+ noteable_id: number;
291
+ noteable_type: string;
292
+ noteable_iid: number;
293
+ resolvable: boolean;
294
+ confidential: boolean;
295
+ }
296
+ /**
297
+ * Reviewer Suggestion
298
+ *
299
+ * Represents a suggested reviewer with scoring and reasoning.
300
+ *
301
+ * @property username - GitLab username of the suggested reviewer
302
+ * @property score - Numerical score indicating relevance (higher is better)
303
+ * @property reason - Human-readable explanation for why this reviewer was suggested
304
+ */
305
+ export interface ReviewerSuggestion {
306
+ username: string;
307
+ score: number;
308
+ reason: string;
309
+ }
310
+ /**
311
+ * Contributor with Changes
312
+ *
313
+ * Represents a contributor and their specific changes in a merge request.
314
+ *
315
+ * @property username - GitLab username of the contributor
316
+ * @property changes - Array of file changes made by this contributor
317
+ * @property changes[].path - File path that was modified
318
+ * @property changes[].fragments - Number of line fragments changed in this file
319
+ */
320
+ export interface ContributorWithChanges {
321
+ username: string;
322
+ changes: Array<{
323
+ path: string;
324
+ fragments: number;
325
+ }>;
326
+ }
327
+ /**
328
+ * Code Owner Group
329
+ *
330
+ * Represents a CODEOWNERS pattern and its associated owners.
331
+ *
332
+ * @property pattern - File path pattern (glob or exact path)
333
+ * @property owners - Array of GitLab usernames who own files matching this pattern
334
+ */
335
+ export interface CodeOwnerGroup {
336
+ pattern: string;
337
+ owners: string[];
338
+ }
339
+ /**
340
+ * Team Member
341
+ *
342
+ * Represents a team member with their availability information.
343
+ *
344
+ * @property username - GitLab username of the team member
345
+ * @property fte - Full-Time Equivalent (0.0-1.0) indicating availability for this team
346
+ */
347
+ export interface TeamMember {
348
+ username: string;
349
+ fte: number;
350
+ }
351
+ /**
352
+ * Team Member with Score
353
+ *
354
+ * Extends TeamMember with load balancing metrics.
355
+ *
356
+ * @property username - GitLab username (inherited from TeamMember)
357
+ * @property fte - Full-Time Equivalent (inherited from TeamMember)
358
+ * @property score - Current number of assigned merge requests
359
+ * @property ratio - Workload ratio (assigned MRs / FTE) for load balancing
360
+ */
361
+ export interface TeamMemberWithScore extends TeamMember {
362
+ score: number;
363
+ ratio: number;
364
+ }
365
+ /**
366
+ * Load Balanced Team
367
+ *
368
+ * Represents a team with members ordered by workload for fair distribution.
369
+ *
370
+ * @property team - Team name or identifier
371
+ * @property members - Array of member usernames, ordered by workload (lowest first)
372
+ * @property loadBalanced - True if load balancing has been applied
373
+ * @property memberScores - Detailed scoring information for each member
374
+ */
375
+ export interface LoadBalancedTeam {
376
+ team: string;
377
+ members: string[];
378
+ loadBalanced: boolean;
379
+ memberScores: TeamMemberWithScore[];
380
+ }
381
+ /**
382
+ * Code Owner with Scores
383
+ *
384
+ * Represents code ownership information with load balancing metrics.
385
+ *
386
+ * @property sectionName - Name of the CODEOWNERS section (or 'Global')
387
+ * @property files - Array of file paths in this section
388
+ * @property owners - Array of selected owner usernames (after load balancing)
389
+ * @property loadBalanced - True if load balancing has been applied (optional)
390
+ * @property ownerScores - Detailed scoring for all potential owners (optional)
391
+ * @property ownerScores[].username - GitLab username
392
+ * @property ownerScores[].ratio - Workload ratio (assigned MRs / FTE)
393
+ * @property ownerScores[].assignedMRs - Current number of assigned merge requests
394
+ * @property ownerScores[].fte - Full-Time Equivalent availability
395
+ */
396
+ export interface CodeOwnerWithScores {
397
+ sectionName: string;
398
+ files: string[];
399
+ owners: string[];
400
+ loadBalanced?: boolean;
401
+ ownerScores?: Array<{
402
+ username: string;
403
+ ratio: number;
404
+ assignedMRs: number;
405
+ fte: number;
406
+ }>;
407
+ }
408
+ /**
409
+ * Reviewer Analysis Result
410
+ *
411
+ * Contains the complete analysis of potential reviewers from multiple sources.
412
+ *
413
+ * @property contributors - Contributors who previously modified the changed code
414
+ * @property teamMembers - Team members organized by team with load balancing
415
+ * @property codeOwners - Code owners based on CODEOWNERS file patterns
416
+ */
417
+ export interface ReviewerAnalysisResult {
418
+ contributors: ContributorWithChanges[];
419
+ teamMembers: LoadBalancedTeam[];
420
+ codeOwners: CodeOwnerWithScores[];
421
+ }
422
+ /**
423
+ * Post Comment Parameters
424
+ *
425
+ * Parameters for posting a comment to a GitLab merge request.
426
+ *
427
+ * @property project - GitLab project identifier (ID or path)
428
+ * @property mergeRequestIid - Merge request internal ID (optional)
429
+ * @property branch - Branch name to find the merge request (optional)
430
+ * @property repoPath - Local repository path for git operations (optional)
431
+ * @property gitlabUrl - GitLab instance URL (optional, defaults to configured URL)
432
+ * @property gitlabToken - GitLab API token (optional, defaults to configured token)
433
+ */
434
+ export interface PostCommentParams {
435
+ project: string;
436
+ mergeRequestIid?: number;
437
+ branch?: string;
438
+ repoPath?: string;
439
+ gitlabUrl?: string;
440
+ gitlabToken?: string;
441
+ }
442
+ /**
443
+ * Invite Reviewers Parameters
444
+ *
445
+ * Parameters for inviting reviewers to a GitLab merge request.
446
+ * Inherits all properties from PostCommentParams.
447
+ *
448
+ * @property project - GitLab project identifier (inherited)
449
+ * @property mergeRequestIid - Merge request internal ID (inherited, optional)
450
+ * @property branch - Branch name to find the merge request (inherited, optional)
451
+ * @property repoPath - Local repository path (inherited, optional)
452
+ * @property gitlabUrl - GitLab instance URL (inherited, optional)
453
+ * @property gitlabToken - GitLab API token (inherited, optional)
454
+ */
455
+ export interface InviteReviewersParams extends PostCommentParams {
456
+ }
457
+ /**
458
+ * Type Guards
459
+ */
460
+ /**
461
+ * Type guard to check if an object is a MergeRequest
462
+ *
463
+ * @param obj - The object to check
464
+ * @returns True if obj is a MergeRequest, false otherwise
465
+ */
466
+ export declare function isMergeRequest(obj: unknown): obj is MergeRequest;
467
+ /**
468
+ * Type guard to check if an object is a GitLabUser
469
+ *
470
+ * @param obj - The object to check
471
+ * @returns True if obj is a GitLabUser, false otherwise
472
+ */
473
+ export declare function isGitLabUser(obj: unknown): obj is GitLabUser;
474
+ /**
475
+ * Type guard to check if an object is a BlameLine
476
+ *
477
+ * @param obj - The object to check
478
+ * @returns True if obj is a BlameLine, false otherwise
479
+ */
480
+ export declare function isBlameLine(obj: unknown): obj is BlameLine;
481
+ /**
482
+ * Type guard to check if an object is a GitLabBranch
483
+ *
484
+ * @param obj - The object to check
485
+ * @returns True if obj is a GitLabBranch, false otherwise
486
+ */
487
+ export declare function isGitLabBranch(obj: unknown): obj is GitLabBranch;
488
+ /**
489
+ * Type guard to check if an object is a GitLabNote
490
+ *
491
+ * @param obj - The object to check
492
+ * @returns True if obj is a GitLabNote, false otherwise
493
+ */
494
+ export declare function isGitLabNote(obj: unknown): obj is GitLabNote;
495
+ /**
496
+ * Type guard to check if an object is a MergeRequestDiff
497
+ *
498
+ * @param obj - The object to check
499
+ * @returns True if obj is a MergeRequestDiff, false otherwise
500
+ */
501
+ export declare function isMergeRequestDiff(obj: unknown): obj is MergeRequestDiff;
502
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;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AKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,YAAY,CAQhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAS5D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,gBAAgB,CAQxE"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Type Definitions for MCP Server
3
+ *
4
+ * Comprehensive type definitions for GitLab API responses and internal data structures.
5
+ * Replaces all `any` types with proper TypeScript interfaces.
6
+ */
7
+ /**
8
+ * Type Guards
9
+ */
10
+ /**
11
+ * Type guard to check if an object is a MergeRequest
12
+ *
13
+ * @param obj - The object to check
14
+ * @returns True if obj is a MergeRequest, false otherwise
15
+ */
16
+ export function isMergeRequest(obj) {
17
+ return (typeof obj === 'object' &&
18
+ obj !== null &&
19
+ 'id' in obj &&
20
+ 'iid' in obj &&
21
+ 'title' in obj &&
22
+ 'state' in obj);
23
+ }
24
+ /**
25
+ * Type guard to check if an object is a GitLabUser
26
+ *
27
+ * @param obj - The object to check
28
+ * @returns True if obj is a GitLabUser, false otherwise
29
+ */
30
+ export function isGitLabUser(obj) {
31
+ return (typeof obj === 'object' &&
32
+ obj !== null &&
33
+ 'id' in obj &&
34
+ 'username' in obj &&
35
+ 'name' in obj);
36
+ }
37
+ /**
38
+ * Type guard to check if an object is a BlameLine
39
+ *
40
+ * @param obj - The object to check
41
+ * @returns True if obj is a BlameLine, false otherwise
42
+ */
43
+ export function isBlameLine(obj) {
44
+ return (typeof obj === 'object' &&
45
+ obj !== null &&
46
+ 'commit' in obj &&
47
+ 'lines' in obj &&
48
+ typeof obj.commit === 'object' &&
49
+ Array.isArray(obj.lines));
50
+ }
51
+ /**
52
+ * Type guard to check if an object is a GitLabBranch
53
+ *
54
+ * @param obj - The object to check
55
+ * @returns True if obj is a GitLabBranch, false otherwise
56
+ */
57
+ export function isGitLabBranch(obj) {
58
+ return (typeof obj === 'object' &&
59
+ obj !== null &&
60
+ 'name' in obj &&
61
+ 'default' in obj &&
62
+ 'commit' in obj);
63
+ }
64
+ /**
65
+ * Type guard to check if an object is a GitLabNote
66
+ *
67
+ * @param obj - The object to check
68
+ * @returns True if obj is a GitLabNote, false otherwise
69
+ */
70
+ export function isGitLabNote(obj) {
71
+ return (typeof obj === 'object' &&
72
+ obj !== null &&
73
+ 'id' in obj &&
74
+ 'body' in obj &&
75
+ 'author' in obj &&
76
+ 'system' in obj);
77
+ }
78
+ /**
79
+ * Type guard to check if an object is a MergeRequestDiff
80
+ *
81
+ * @param obj - The object to check
82
+ * @returns True if obj is a MergeRequestDiff, false otherwise
83
+ */
84
+ export function isMergeRequestDiff(obj) {
85
+ return (typeof obj === 'object' &&
86
+ obj !== null &&
87
+ 'old_path' in obj &&
88
+ 'new_path' in obj &&
89
+ 'diff' in obj);
90
+ }
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAudH;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,IAAI,IAAI,GAAG;QACX,KAAK,IAAI,GAAG;QACZ,OAAO,IAAI,GAAG;QACd,OAAO,IAAI,GAAG,CACf,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,IAAI,IAAI,GAAG;QACX,UAAU,IAAI,GAAG;QACjB,MAAM,IAAI,GAAG,CACd,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,OA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