-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathgitlab.ts
More file actions
3106 lines (3025 loc) · 112 KB
/
Copy pathgitlab.ts
File metadata and controls
3106 lines (3025 loc) · 112 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { GitLabIcon } from '@/components/icons'
import type { BlockConfig, BlockMeta } from '@/blocks/types'
import { AuthMode, IntegrationType } from '@/blocks/types'
import type { GitLabResponse } from '@/tools/gitlab/types'
import { getTrigger } from '@/triggers'
/**
* Access/membership operations scoped to a project OR group. These take a
* `resourceType` (Project | Group) plus a `resourceId`.
*/
const RESOURCE_SCOPED_OPS = [
'gitlab_list_members',
'gitlab_add_member',
'gitlab_update_member',
'gitlab_remove_member',
'gitlab_invite_member',
'gitlab_list_invitations',
'gitlab_update_invitation',
'gitlab_revoke_invitation',
'gitlab_list_access_requests',
'gitlab_approve_access_request',
'gitlab_deny_access_request',
]
/** Operations that require a target user ID (member target or admin user target). */
const USER_ID_OPS = [
'gitlab_add_member',
'gitlab_update_member',
'gitlab_remove_member',
'gitlab_approve_access_request',
'gitlab_deny_access_request',
'gitlab_update_user',
'gitlab_delete_user',
'gitlab_block_user',
'gitlab_unblock_user',
'gitlab_deactivate_user',
'gitlab_activate_user',
'gitlab_ban_user',
'gitlab_unban_user',
'gitlab_approve_user',
'gitlab_reject_user',
'gitlab_delete_user_identity',
]
/**
* Operations that take the shared access-level dropdown (required unless
* noted). Update Member deliberately has its own dropdown without a default so
* an expiry-only edit cannot silently reset a Maintainer/Owner to Developer.
*/
const ACCESS_LEVEL_OPS = [
'gitlab_add_member',
'gitlab_invite_member',
'gitlab_approve_access_request',
'gitlab_add_saml_group_link',
]
/** Operations where the access level is required (approve/invitation update are optional). */
const ACCESS_LEVEL_REQUIRED_OPS = [
'gitlab_add_member',
'gitlab_invite_member',
'gitlab_add_saml_group_link',
]
/** Operations that support an access-expiration date. */
const EXPIRES_AT_OPS = [
'gitlab_add_member',
'gitlab_update_member',
'gitlab_invite_member',
'gitlab_update_invitation',
]
/** Operations that support a custom member role ID (Ultimate). */
const MEMBER_ROLE_OPS = [
'gitlab_add_member',
'gitlab_update_member',
'gitlab_invite_member',
'gitlab_add_saml_group_link',
]
/** Operations that take an email address. */
const EMAIL_OPS = ['gitlab_invite_member', 'gitlab_update_invitation', 'gitlab_revoke_invitation']
/** Group-only SAML group link operations that take a group ID. */
const SAML_LINK_OPS = [
'gitlab_list_saml_group_links',
'gitlab_add_saml_group_link',
'gitlab_delete_saml_group_link',
]
/** SAML operations that take a SAML group name. */
const SAML_NAME_OPS = ['gitlab_add_saml_group_link', 'gitlab_delete_saml_group_link']
/** Ops where the User ID field is strictly required (Add Member also accepts a username instead). */
const USER_ID_REQUIRED_OPS = USER_ID_OPS.filter((op) => op !== 'gitlab_add_member')
/**
* Parses an optional JSON text field at execution time. Returns undefined for
* blank input and throws a field-specific error for malformed JSON.
*/
function parseJsonParam(raw: unknown, label: string): any {
if (raw === undefined || raw === null || raw === '') return undefined
let parsed = raw
if (typeof raw === 'string') {
try {
parsed = JSON.parse(raw)
} catch {
throw new Error(`${label} must be valid JSON.`)
}
}
if (parsed === null) return undefined
if (typeof parsed !== 'object') {
throw new Error(`${label} must be a JSON object or array.`)
}
return parsed
}
/** Maps a "Leave unchanged / Yes / No" dropdown value to true, false, or undefined. */
function parseTriState(raw: unknown): boolean | undefined {
if (raw === 'true' || raw === true) return true
if (raw === 'false' || raw === false) return false
return undefined
}
export const GitLabBlock: BlockConfig<GitLabResponse> = {
type: 'gitlab',
name: 'GitLab',
description: 'Interact with GitLab projects, issues, merge requests, and pipelines',
authMode: AuthMode.ApiKey,
triggerAllowed: true,
longDescription:
'Integrate GitLab into the workflow. Can manage projects, issues, merge requests, pipelines, and add comments, plus project/group membership, invitations, access requests, SAML group links, and instance user administration. Supports all core GitLab DevOps operations.',
docsLink: 'https://docs.sim.ai/integrations/gitlab',
category: 'tools',
integrationType: IntegrationType.DevOps,
icon: GitLabIcon,
bgColor: '#FFFFFF',
subBlocks: [
{
id: 'operation',
title: 'Operation',
type: 'dropdown',
options: [
// Project Operations
{ label: 'List Projects', id: 'gitlab_list_projects' },
{ label: 'Get Project', id: 'gitlab_get_project' },
// Issue Operations
{ label: 'List Issues', id: 'gitlab_list_issues' },
{ label: 'Get Issue', id: 'gitlab_get_issue' },
{ label: 'Create Issue', id: 'gitlab_create_issue' },
{ label: 'Update Issue', id: 'gitlab_update_issue' },
{ label: 'Delete Issue', id: 'gitlab_delete_issue' },
{ label: 'Add Issue Comment', id: 'gitlab_create_issue_note' },
// Merge Request Operations
{ label: 'List Merge Requests', id: 'gitlab_list_merge_requests' },
{ label: 'Get Merge Request', id: 'gitlab_get_merge_request' },
{ label: 'Create Merge Request', id: 'gitlab_create_merge_request' },
{ label: 'Update Merge Request', id: 'gitlab_update_merge_request' },
{ label: 'Merge Merge Request', id: 'gitlab_merge_merge_request' },
{ label: 'Add MR Comment', id: 'gitlab_create_merge_request_note' },
// Pipeline Operations
{ label: 'List Pipelines', id: 'gitlab_list_pipelines' },
{ label: 'Get Pipeline', id: 'gitlab_get_pipeline' },
{ label: 'Create Pipeline', id: 'gitlab_create_pipeline' },
{ label: 'Retry Pipeline', id: 'gitlab_retry_pipeline' },
{ label: 'Cancel Pipeline', id: 'gitlab_cancel_pipeline' },
// Repository Operations
{ label: 'List Repository Tree', id: 'gitlab_list_repository_tree' },
{ label: 'Get File', id: 'gitlab_get_file' },
{ label: 'Create File', id: 'gitlab_create_file' },
{ label: 'Update File', id: 'gitlab_update_file' },
{ label: 'List Commits', id: 'gitlab_list_commits' },
{ label: 'List Branches', id: 'gitlab_list_branches' },
{ label: 'Create Branch', id: 'gitlab_create_branch' },
{ label: 'Delete Branch', id: 'gitlab_delete_branch' },
{ label: 'Compare Branches', id: 'gitlab_compare_branches' },
// Additional Merge Request Operations
{ label: 'Get MR Changes', id: 'gitlab_get_merge_request_changes' },
{ label: 'Approve Merge Request', id: 'gitlab_approve_merge_request' },
// Job Operations
{ label: 'List Pipeline Jobs', id: 'gitlab_list_pipeline_jobs' },
{ label: 'Get Job Log', id: 'gitlab_get_job_log' },
{ label: 'Play Job', id: 'gitlab_play_job' },
// Release Operations
{ label: 'List Releases', id: 'gitlab_list_releases' },
{ label: 'Create Release', id: 'gitlab_create_release' },
// Access / Membership Operations
{ label: 'List Members', id: 'gitlab_list_members' },
{ label: 'Add Member', id: 'gitlab_add_member' },
{ label: 'Update Member', id: 'gitlab_update_member' },
{ label: 'Remove Member', id: 'gitlab_remove_member' },
{ label: 'Invite Member by Email', id: 'gitlab_invite_member' },
{ label: 'List Invitations', id: 'gitlab_list_invitations' },
{ label: 'Update Invitation', id: 'gitlab_update_invitation' },
{ label: 'Revoke Invitation', id: 'gitlab_revoke_invitation' },
{ label: 'List Access Requests', id: 'gitlab_list_access_requests' },
{ label: 'Approve Access Request', id: 'gitlab_approve_access_request' },
{ label: 'Deny Access Request', id: 'gitlab_deny_access_request' },
{ label: 'List SAML Group Links', id: 'gitlab_list_saml_group_links' },
{ label: 'Search Users', id: 'gitlab_search_users' },
// User Administration Operations (require an admin token)
{ label: 'Create User', id: 'gitlab_create_user' },
{ label: 'Update User', id: 'gitlab_update_user' },
{ label: 'Delete User', id: 'gitlab_delete_user' },
{ label: 'Block User', id: 'gitlab_block_user' },
{ label: 'Unblock User', id: 'gitlab_unblock_user' },
{ label: 'Deactivate User', id: 'gitlab_deactivate_user' },
{ label: 'Activate User', id: 'gitlab_activate_user' },
{ label: 'Ban User', id: 'gitlab_ban_user' },
{ label: 'Unban User', id: 'gitlab_unban_user' },
{ label: 'Approve User Signup', id: 'gitlab_approve_user' },
{ label: 'Reject User Signup', id: 'gitlab_reject_user' },
{ label: 'Delete User Identity', id: 'gitlab_delete_user_identity' },
{ label: 'Add SAML Group Link', id: 'gitlab_add_saml_group_link' },
{ label: 'Delete SAML Group Link', id: 'gitlab_delete_saml_group_link' },
],
value: () => 'gitlab_list_projects',
},
{
id: 'accessToken',
title: 'Personal Access Token',
type: 'short-input',
placeholder: 'Enter your GitLab Personal Access Token',
password: true,
required: true,
},
// Self-managed GitLab host (defaults to gitlab.com)
{
id: 'host',
title: 'GitLab Host',
type: 'short-input',
placeholder: 'gitlab.com',
mode: 'advanced',
description: 'Self-managed GitLab host. Leave blank for gitlab.com.',
},
// Project ID (required for most operations)
{
id: 'projectId',
title: 'Project ID',
type: 'short-input',
placeholder: 'Enter project ID or path (e.g., username/project)',
required: true,
condition: {
field: 'operation',
value: [
'gitlab_get_project',
'gitlab_list_issues',
'gitlab_get_issue',
'gitlab_create_issue',
'gitlab_update_issue',
'gitlab_delete_issue',
'gitlab_create_issue_note',
'gitlab_list_merge_requests',
'gitlab_get_merge_request',
'gitlab_create_merge_request',
'gitlab_update_merge_request',
'gitlab_merge_merge_request',
'gitlab_create_merge_request_note',
'gitlab_list_pipelines',
'gitlab_get_pipeline',
'gitlab_create_pipeline',
'gitlab_retry_pipeline',
'gitlab_cancel_pipeline',
'gitlab_list_repository_tree',
'gitlab_get_file',
'gitlab_create_file',
'gitlab_update_file',
'gitlab_list_commits',
'gitlab_list_branches',
'gitlab_create_branch',
'gitlab_delete_branch',
'gitlab_compare_branches',
'gitlab_get_merge_request_changes',
'gitlab_approve_merge_request',
'gitlab_list_pipeline_jobs',
'gitlab_get_job_log',
'gitlab_play_job',
'gitlab_list_releases',
'gitlab_create_release',
],
},
},
// Issue Number (IID) - the # shown in GitLab UI
{
id: 'issueIid',
title: 'Issue Number',
type: 'short-input',
placeholder: 'Enter issue number (e.g., 1 for issue #1)',
required: true,
condition: {
field: 'operation',
value: [
'gitlab_get_issue',
'gitlab_update_issue',
'gitlab_delete_issue',
'gitlab_create_issue_note',
],
},
},
// Merge Request Number (IID) - the ! number shown in GitLab UI
{
id: 'mergeRequestIid',
title: 'MR Number',
type: 'short-input',
placeholder: 'Enter MR number (e.g., 1 for !1)',
required: true,
condition: {
field: 'operation',
value: [
'gitlab_get_merge_request',
'gitlab_update_merge_request',
'gitlab_merge_merge_request',
'gitlab_create_merge_request_note',
'gitlab_get_merge_request_changes',
'gitlab_approve_merge_request',
],
},
},
// Pipeline ID
{
id: 'pipelineId',
title: 'Pipeline ID',
type: 'short-input',
placeholder: 'Enter pipeline ID',
required: true,
condition: {
field: 'operation',
value: [
'gitlab_get_pipeline',
'gitlab_retry_pipeline',
'gitlab_cancel_pipeline',
'gitlab_list_pipeline_jobs',
],
},
},
// Title (for issue/MR creation)
{
id: 'title',
title: 'Title',
type: 'short-input',
placeholder: 'Enter title',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_issue', 'gitlab_create_merge_request'],
},
wandConfig: {
enabled: true,
prompt: `Generate a clear, descriptive title for a GitLab issue or merge request based on the user's request.
The title should be concise but informative.
Return ONLY the title - no explanations, no extra text.`,
placeholder: 'Describe the issue or merge request...',
},
},
// Description
{
id: 'description',
title: 'Description',
type: 'long-input',
placeholder: 'Enter description (Markdown supported)',
condition: {
field: 'operation',
value: [
'gitlab_create_issue',
'gitlab_update_issue',
'gitlab_create_merge_request',
'gitlab_update_merge_request',
'gitlab_create_release',
],
},
wandConfig: {
enabled: true,
prompt: `Generate a comprehensive description for a GitLab issue, merge request, or release based on the user's request.
Include relevant sections as appropriate:
- Summary of changes or problem
- Context and motivation
- Testing done (for MRs)
- Steps to reproduce (for bugs)
- Highlights and notable changes (for releases)
Use Markdown formatting for readability.
Return ONLY the description - no explanations outside the content.`,
placeholder: 'Describe the content in detail...',
},
},
// Comment body
{
id: 'body',
title: 'Comment',
type: 'long-input',
placeholder: 'Enter comment text (Markdown supported)',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_issue_note', 'gitlab_create_merge_request_note'],
},
wandConfig: {
enabled: true,
prompt: `Generate a helpful GitLab comment based on the user's request.
The comment should be clear, constructive, and professional.
Use Markdown formatting for readability.
Return ONLY the comment text - no explanations, no extra formatting.`,
placeholder: 'Describe the comment you want to write...',
},
},
// Source branch (for MR creation)
{
id: 'sourceBranch',
title: 'Source Branch',
type: 'short-input',
placeholder: 'Enter source branch name',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_merge_request'],
},
},
// Target branch (for MR creation)
{
id: 'targetBranch',
title: 'Target Branch',
type: 'short-input',
placeholder: 'Enter target branch name (e.g., main)',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_merge_request'],
},
},
// Ref (for pipeline creation)
{
id: 'ref',
title: 'Branch/Tag',
type: 'short-input',
placeholder: 'Enter branch or tag name',
required: {
field: 'operation',
value: ['gitlab_create_pipeline', 'gitlab_get_file', 'gitlab_create_branch'],
},
condition: {
field: 'operation',
value: [
'gitlab_create_pipeline',
'gitlab_get_file',
'gitlab_create_branch',
'gitlab_create_release',
'gitlab_list_repository_tree',
'gitlab_list_pipelines',
],
},
},
// File Path
{
id: 'filePath',
title: 'File Path',
type: 'short-input',
placeholder: 'Path to file (e.g., src/index.ts)',
required: true,
condition: {
field: 'operation',
value: ['gitlab_get_file', 'gitlab_create_file', 'gitlab_update_file'],
},
},
// Branch
{
id: 'branch',
title: 'Branch',
type: 'short-input',
placeholder: 'Branch name',
required: true,
condition: {
field: 'operation',
value: [
'gitlab_create_file',
'gitlab_update_file',
'gitlab_create_branch',
'gitlab_delete_branch',
],
},
},
// Compare from ref
{
id: 'compareFrom',
title: 'From',
type: 'short-input',
placeholder: 'Branch, tag, or commit SHA to compare from',
required: true,
condition: {
field: 'operation',
value: ['gitlab_compare_branches'],
},
},
// Compare to ref
{
id: 'compareTo',
title: 'To',
type: 'short-input',
placeholder: 'Branch, tag, or commit SHA to compare to',
required: true,
condition: {
field: 'operation',
value: ['gitlab_compare_branches'],
},
},
// Compare directly instead of using merge base
{
id: 'straight',
title: 'Compare Directly',
type: 'switch',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_compare_branches'],
},
},
// Release tag name
{
id: 'tagName',
title: 'Tag Name',
type: 'short-input',
placeholder: 'Enter the Git tag for the release (e.g., v1.0.0)',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_release'],
},
},
// Release name
{
id: 'releaseName',
title: 'Release Name',
type: 'short-input',
placeholder: 'Enter release name (optional)',
condition: {
field: 'operation',
value: ['gitlab_create_release'],
},
},
// Release date
{
id: 'releasedAt',
title: 'Released At',
type: 'short-input',
placeholder: 'ISO 8601 date for an upcoming or historical release (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_create_release'],
},
wandConfig: {
enabled: true,
prompt: `Generate an ISO 8601 timestamp based on the user's description of when the release happened or will happen.
Return ONLY the timestamp string - no explanations, no extra text.`,
generationType: 'timestamp',
placeholder: 'Describe when the release happened...',
},
},
// Release milestones
{
id: 'releaseMilestones',
title: 'Milestones',
type: 'short-input',
placeholder: 'Milestone titles (comma-separated, optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_create_release'],
},
},
// File Content
{
id: 'content',
title: 'File Content',
type: 'long-input',
placeholder: 'File content',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_file', 'gitlab_update_file'],
},
},
// Commit Message
{
id: 'commitMessage',
title: 'Commit Message',
type: 'short-input',
placeholder: 'Commit message',
required: true,
condition: {
field: 'operation',
value: ['gitlab_create_file', 'gitlab_update_file'],
},
},
// Job ID
{
id: 'jobId',
title: 'Job ID',
type: 'short-input',
placeholder: 'Enter job ID',
required: true,
condition: {
field: 'operation',
value: ['gitlab_get_job_log', 'gitlab_play_job'],
},
},
// Subdirectory path (for repository tree)
{
id: 'path',
title: 'Path',
type: 'short-input',
placeholder: 'File or subdirectory path filter (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_repository_tree', 'gitlab_list_commits'],
},
},
// Recursive tree listing
{
id: 'recursive',
title: 'Recursive',
type: 'switch',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_repository_tree'],
},
},
// Ref name filter (for list commits)
{
id: 'refName',
title: 'Ref (branch/tag)',
type: 'short-input',
placeholder: 'Branch or tag (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_commits'],
},
},
// Commit time range filters
{
id: 'since',
title: 'Since',
type: 'short-input',
placeholder: 'Only commits after this ISO 8601 date (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_commits'],
},
wandConfig: {
enabled: true,
prompt: `Generate an ISO 8601 timestamp based on the user's description of the earliest commit date.
Return ONLY the timestamp string - no explanations, no extra text.`,
generationType: 'timestamp',
placeholder: 'Describe the start of the time range...',
},
},
{
id: 'until',
title: 'Until',
type: 'short-input',
placeholder: 'Only commits before this ISO 8601 date (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_commits'],
},
wandConfig: {
enabled: true,
prompt: `Generate an ISO 8601 timestamp based on the user's description of the latest commit date.
Return ONLY the timestamp string - no explanations, no extra text.`,
generationType: 'timestamp',
placeholder: 'Describe the end of the time range...',
},
},
// Commit author filter
{
id: 'author',
title: 'Author',
type: 'short-input',
placeholder: 'Filter commits by author name or email (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_commits'],
},
},
// Optimistic-locking guard (update file)
{
id: 'lastCommitId',
title: 'Last Commit ID',
type: 'short-input',
placeholder: 'Fail if the file changed since this commit SHA (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_update_file'],
},
},
// Include retried jobs (list pipeline jobs)
{
id: 'includeRetried',
title: 'Include Retried Jobs',
type: 'switch',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_pipeline_jobs'],
},
},
// Job scope filter (for list pipeline jobs)
{
id: 'scope',
title: 'Job Scope',
type: 'dropdown',
options: [
{ label: 'All', id: '' },
{ label: 'Created', id: 'created' },
{ label: 'Waiting for resource', id: 'waiting_for_resource' },
{ label: 'Preparing', id: 'preparing' },
{ label: 'Pending', id: 'pending' },
{ label: 'Running', id: 'running' },
{ label: 'Success', id: 'success' },
{ label: 'Failed', id: 'failed' },
{ label: 'Canceling', id: 'canceling' },
{ label: 'Canceled', id: 'canceled' },
{ label: 'Skipped', id: 'skipped' },
{ label: 'Manual', id: 'manual' },
{ label: 'Scheduled', id: 'scheduled' },
],
value: () => '',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_pipeline_jobs'],
},
},
// Commit SHA (for approve merge request)
{
id: 'sha',
title: 'Commit SHA',
type: 'short-input',
placeholder: 'Optional HEAD SHA to approve',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_approve_merge_request'],
},
},
// Labels
{
id: 'labels',
title: 'Labels',
type: 'short-input',
placeholder: 'Enter labels (comma-separated)',
mode: 'advanced',
condition: {
field: 'operation',
value: [
'gitlab_create_issue',
'gitlab_update_issue',
'gitlab_list_issues',
'gitlab_create_merge_request',
'gitlab_update_merge_request',
'gitlab_list_merge_requests',
],
},
},
// Assignee IDs
{
id: 'assigneeIds',
title: 'Assignee IDs',
type: 'short-input',
placeholder: 'Enter assignee user IDs (comma-separated)',
mode: 'advanced',
condition: {
field: 'operation',
value: [
'gitlab_create_issue',
'gitlab_update_issue',
'gitlab_create_merge_request',
'gitlab_update_merge_request',
],
},
},
// Milestone ID
{
id: 'milestoneId',
title: 'Milestone ID',
type: 'short-input',
placeholder: 'Enter milestone ID',
mode: 'advanced',
condition: {
field: 'operation',
value: [
'gitlab_create_issue',
'gitlab_update_issue',
'gitlab_create_merge_request',
'gitlab_update_merge_request',
],
},
},
// State filter for issues
{
id: 'issueState',
title: 'State',
type: 'dropdown',
options: [
{ label: 'All', id: 'all' },
{ label: 'Open', id: 'opened' },
{ label: 'Closed', id: 'closed' },
],
value: () => 'all',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_issues'],
},
},
// State filter for merge requests
{
id: 'mrState',
title: 'State',
type: 'dropdown',
options: [
{ label: 'All', id: 'all' },
{ label: 'Open', id: 'opened' },
{ label: 'Closed', id: 'closed' },
{ label: 'Merged', id: 'merged' },
],
value: () => 'all',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_merge_requests'],
},
},
// State event (for updates)
{
id: 'stateEvent',
title: 'State Event',
type: 'dropdown',
options: [
{ label: 'No Change', id: '' },
{ label: 'Close', id: 'close' },
{ label: 'Reopen', id: 'reopen' },
],
value: () => '',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_update_issue', 'gitlab_update_merge_request'],
},
},
// Pipeline status filter
{
id: 'pipelineStatus',
title: 'Pipeline Status',
type: 'dropdown',
options: [
{ label: 'All', id: '' },
{ label: 'Created', id: 'created' },
{ label: 'Waiting for resource', id: 'waiting_for_resource' },
{ label: 'Preparing', id: 'preparing' },
{ label: 'Pending', id: 'pending' },
{ label: 'Running', id: 'running' },
{ label: 'Success', id: 'success' },
{ label: 'Failed', id: 'failed' },
{ label: 'Canceling', id: 'canceling' },
{ label: 'Canceled', id: 'canceled' },
{ label: 'Skipped', id: 'skipped' },
{ label: 'Manual', id: 'manual' },
{ label: 'Scheduled', id: 'scheduled' },
],
value: () => '',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_pipelines'],
},
},
// Remove source branch after merge
{
id: 'removeSourceBranch',
title: 'Remove Source Branch',
type: 'switch',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_create_merge_request', 'gitlab_merge_merge_request'],
},
},
// Tri-state variants for Update MR: a switch cannot express "turn this
// off" without also clobbering the setting on every unrelated update.
{
id: 'updateRemoveSourceBranch',
title: 'Remove Source Branch',
type: 'dropdown',
options: [
{ label: 'Leave unchanged', id: '' },
{ label: 'Yes', id: 'true' },
{ label: 'No', id: 'false' },
],
value: () => '',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_update_merge_request'],
},
},
{
id: 'updateSquash',
title: 'Squash Commits',
type: 'dropdown',
options: [
{ label: 'Leave unchanged', id: '' },
{ label: 'Yes', id: 'true' },
{ label: 'No', id: 'false' },
],
value: () => '',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_update_merge_request'],
},
},
// Squash commits
{
id: 'squash',
title: 'Squash Commits',
type: 'switch',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_create_merge_request', 'gitlab_merge_merge_request'],
},
},
// Merge commit message
{
id: 'mergeCommitMessage',
title: 'Merge Commit Message',
type: 'long-input',
placeholder: 'Enter custom merge commit message (optional)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_merge_merge_request'],
},
wandConfig: {
enabled: true,
prompt: `Generate a clear merge commit message based on the user's request.
The message should summarize what is being merged and why.
Return ONLY the commit message - no explanations, no extra text.`,
placeholder: 'Describe the merge...',
},
},
// Search filter (projects and issues listings)
{
id: 'searchQuery',
title: 'Search',
type: 'short-input',
placeholder: 'Search projects (name/path/description) or issues (title/description)',
mode: 'advanced',
condition: {
field: 'operation',
value: ['gitlab_list_projects', 'gitlab_list_issues'],
},
},
// List-projects filters
{
id: 'owned',
title: 'Owned Only',
type: 'switch',
mode: 'advanced',
description: 'Only projects explicitly owned by the current user',
condition: {
field: 'operation',
value: ['gitlab_list_projects'],
},
},
{
id: 'membership',
title: 'Member Only',
type: 'switch',
mode: 'advanced',
description: 'Only projects the current user is a member of',
condition: {
field: 'operation',
value: ['gitlab_list_projects'],
},
},
{