@gitlab/opencode-gitlab-plugin 1.5.3 → 1.5.4

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [1.5.4](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/compare/v1.5.3...v1.5.4) (2026-02-03)
6
+
7
+
8
+ ### 📚 Documentation
9
+
10
+ * update README for unified discussion tools consolidation ([a832573](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/commit/a832573159b157c0cfe806ab1f12047325e14c56))
11
+
5
12
  ## [1.5.3](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/compare/v1.5.2...v1.5.3) (2026-02-03)
6
13
 
7
14
 
package/README.md CHANGED
@@ -53,19 +53,19 @@ A comprehensive GitLab API plugin for OpenCode that provides AI-powered access t
53
53
  - **Rate Limiting**: Built-in handling for GitLab API rate limits
54
54
  - **Caching**: Efficient API response handling
55
55
  - **Modular Architecture**: Clean separation of concerns with client and tool modules
56
- - **Comprehensive Testing**: 181 tests with full coverage of all features
56
+ - **Comprehensive Testing**: 180 tests with full coverage of all features
57
57
 
58
58
  ### GraphQL-Powered Tools
59
59
 
60
60
  The following tools use GitLab's GraphQL API for enhanced functionality:
61
61
 
62
- | Category | Tools | Benefits |
63
- | --------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
64
- | **TODOs** | `gitlab_list_todos`, `gitlab_get_todo_count` | Cursor-based pagination, rich filtering |
65
- | **Notes** | `gitlab_list_mr_notes`, `gitlab_list_issue_notes`, `gitlab_list_epic_notes`, `gitlab_list_snippet_notes` | Efficient pagination, consistent response format |
66
- | **Discussions** | `gitlab_list_mr_discussions`, `gitlab_list_issue_discussions`, `gitlab_list_epic_discussions`, `gitlab_list_snippet_discussions` | Cursor-based pagination, nested note support |
67
- | **Auto-merge** | `gitlab_set_mr_auto_merge` | MWPS (Merge When Pipeline Succeeds), merge train support |
68
- | **Security** | All vulnerability management tools | Type-safe GID validation, mutation support |
62
+ | Category | Tools | Benefits |
63
+ | --------------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
64
+ | **TODOs** | `gitlab_list_todos`, `gitlab_get_todo_count` | Cursor-based pagination, rich filtering |
65
+ | **Notes** | `gitlab_list_mr_notes`, `gitlab_list_issue_notes`, `gitlab_list_epic_notes`, `gitlab_list_snippet_notes` | Efficient pagination, consistent response format |
66
+ | **Discussions** | `gitlab_list_discussions`, `gitlab_get_discussion`, `gitlab_create_discussion`, `gitlab_resolve_discussion` | Unified interface for all resource types, cursor-based pagination, code position support |
67
+ | **Auto-merge** | `gitlab_set_mr_auto_merge` | MWPS (Merge When Pipeline Succeeds), merge train support |
68
+ | **Security** | All vulnerability management tools | Type-safe GID validation, mutation support |
69
69
 
70
70
  ## 🏗️ Architecture
71
71
 
@@ -134,7 +134,7 @@ graph LR
134
134
  B --> B1[readTokenFromAuthStorage]
135
135
  B --> B2[getGitLabClient]
136
136
 
137
- C --> C1[60+ Tool Definitions]
137
+ C --> C1[81 Tool Definitions]
138
138
 
139
139
  D --> A
140
140
  D --> B
@@ -287,9 +287,9 @@ Or for API tokens:
287
287
 
288
288
  ## 🛠️ Available Tools
289
289
 
290
- The plugin provides **102 tools** organized into the following categories:
290
+ The plugin provides **81 tools** organized into the following categories:
291
291
 
292
- ### Merge Request Tools (16 tools)
292
+ ### Merge Request Tools (10 tools)
293
293
 
294
294
  | Tool | Description |
295
295
  | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -298,34 +298,23 @@ The plugin provides **102 tools** organized into the following categories:
298
298
  | `gitlab_create_merge_request` | Create a new merge request |
299
299
  | `gitlab_update_merge_request` | Update merge request title, description, state, assignees, reviewers, and labels |
300
300
  | `gitlab_get_mr_changes` | Get file changes/diffs for a merge request |
301
- | `gitlab_list_mr_discussions` | List discussion threads on a merge request (GraphQL with cursor-based pagination) |
302
- | `gitlab_get_mr_discussion` | Get a specific discussion thread with all replies |
303
301
  | `gitlab_list_mr_notes` | List all comments with cursor-based pagination (GraphQL) |
304
- | `gitlab_create_mr_note` | Add a comment or reply to a merge request discussion |
305
- | `gitlab_create_mr_discussion` | Start a new discussion thread (optionally on specific code lines) |
306
- | `gitlab_resolve_mr_discussion` | Mark a discussion as resolved after addressing feedback |
307
- | `gitlab_unresolve_mr_discussion` | Reopen a resolved discussion |
308
302
  | `gitlab_get_mr_commits` | Get all commits in a merge request |
309
303
  | `gitlab_get_mr_pipelines` | Get all pipelines for a merge request |
310
304
  | `gitlab_list_merge_request_diffs` | List file diffs with pagination support for large changesets |
311
305
  | `gitlab_set_mr_auto_merge` | Enable auto-merge (MWPS) using GraphQL API when pipeline succeeds |
312
306
 
313
- ### Issue Tools (10 tools)
307
+ ### Issue Tools (5 tools)
314
308
 
315
- | Tool | Description |
316
- | ----------------------------------- | ---------------------------------------------------------------------------- |
317
- | `gitlab_create_issue` | Create a new issue with title, description, labels, assignees, and milestone |
318
- | `gitlab_get_issue` | Get issue details including state, author, assignees, labels, and comments |
319
- | `gitlab_list_issues` | List issues with filtering by state, labels, assignee, and milestone |
320
- | `gitlab_list_issue_notes` | List all comments with cursor-based pagination (GraphQL) |
321
- | `gitlab_list_issue_discussions` | List discussion threads with cursor-based pagination (GraphQL) |
322
- | `gitlab_get_issue_discussion` | Get a specific discussion thread with context |
323
- | `gitlab_create_issue_note` | Add a comment or reply to an issue discussion |
324
- | `gitlab_get_issue_note` | Get a specific note by ID with full details |
325
- | `gitlab_resolve_issue_discussion` | Mark an issue discussion as resolved |
326
- | `gitlab_unresolve_issue_discussion` | Reopen a resolved issue discussion |
309
+ | Tool | Description |
310
+ | ------------------------- | ---------------------------------------------------------------------------- |
311
+ | `gitlab_create_issue` | Create a new issue with title, description, labels, assignees, and milestone |
312
+ | `gitlab_get_issue` | Get issue details including state, author, assignees, labels, and comments |
313
+ | `gitlab_list_issues` | List issues with filtering by state, labels, assignee, and milestone |
314
+ | `gitlab_list_issue_notes` | List all comments with cursor-based pagination (GraphQL) |
315
+ | `gitlab_get_issue_note` | Get a specific note by ID with full details |
327
316
 
328
- ### Epic Tools (12 tools)
317
+ ### Epic Tools (9 tools)
329
318
 
330
319
  | Tool | Description |
331
320
  | ------------------------------- | ----------------------------------------------------------------------------- |
@@ -337,9 +326,6 @@ The plugin provides **102 tools** organized into the following categories:
337
326
  | `gitlab_add_issue_to_epic` | Link an issue to an epic |
338
327
  | `gitlab_remove_issue_from_epic` | Unlink an issue from an epic |
339
328
  | `gitlab_list_epic_notes` | List all comments with cursor-based pagination (GraphQL) |
340
- | `gitlab_list_epic_discussions` | List discussion threads with cursor-based pagination (GraphQL) |
341
- | `gitlab_create_epic_note` | Add a comment or reply to an epic discussion |
342
- | `gitlab_get_epic_discussion` | Get a specific epic discussion thread |
343
329
  | `gitlab_get_epic_note` | Get a specific epic note by ID |
344
330
 
345
331
  ### Pipeline Tools (8 tools)
@@ -355,22 +341,17 @@ The plugin provides **102 tools** organized into the following categories:
355
341
  | `gitlab_lint_ci_config` | Validate CI/CD YAML configuration with project context |
356
342
  | `gitlab_lint_existing_ci_config` | Validate existing .gitlab-ci.yml from repository |
357
343
 
358
- ### Repository Tools (12 tools)
359
-
360
- | Tool | Description |
361
- | --------------------------------- | ---------------------------------------------------------------------------- |
362
- | `gitlab_get_file` | Get file contents from any branch, tag, or commit |
363
- | `gitlab_get_commit` | Get commit details with metadata, author, and stats |
364
- | `gitlab_list_commits` | List commits with filtering by branch, path, and dates |
365
- | `gitlab_get_commit_diff` | Get diff for a specific commit |
366
- | `gitlab_create_commit` | Create a commit with multiple file operations (create, update, delete, move) |
367
- | `gitlab_list_repository_tree` | List files and directories at a given path |
368
- | `gitlab_list_branches` | List all branches in a repository |
369
- | `gitlab_list_commit_discussions` | List discussion threads on a commit |
370
- | `gitlab_get_commit_discussion` | Get a specific commit discussion thread |
371
- | `gitlab_create_commit_note` | Add a comment to a commit (optionally line-specific) |
372
- | `gitlab_create_commit_discussion` | Start a new discussion on a commit |
373
- | `gitlab_get_commit_comments` | Get all commit comments in flat structure |
344
+ ### Repository Tools (7 tools)
345
+
346
+ | Tool | Description |
347
+ | ----------------------------- | ------------------------------------------------------ |
348
+ | `gitlab_get_file` | Get file contents from any branch, tag, or commit |
349
+ | `gitlab_get_commit` | Get commit details with metadata, author, and stats |
350
+ | `gitlab_list_commits` | List commits with filtering by branch, path, and dates |
351
+ | `gitlab_get_commit_diff` | Get diff for a specific commit |
352
+ | `gitlab_list_repository_tree` | List files and directories at a given path |
353
+ | `gitlab_list_branches` | List all branches in a repository |
354
+ | `gitlab_get_commit_comments` | Get all commit comments in flat structure |
374
355
 
375
356
  ### Search Tools (11 tools)
376
357
 
@@ -431,22 +412,20 @@ The plugin provides **102 tools** organized into the following categories:
431
412
  | `gitlab_list_project_members` | List all members of a project |
432
413
  | `gitlab_get_current_user` | Get authenticated user information |
433
414
 
434
- ### Snippet Tools (5 tools)
415
+ ### Snippet Tools (1 tool)
435
416
 
436
- | Tool | Description |
437
- | ---------------------------------- | -------------------------------------------------------------- |
438
- | `gitlab_list_snippet_discussions` | List discussion threads with cursor-based pagination (GraphQL) |
439
- | `gitlab_get_snippet_discussion` | Get a specific snippet discussion thread |
440
- | `gitlab_list_snippet_notes` | List all comments with cursor-based pagination (GraphQL) |
441
- | `gitlab_create_snippet_note` | Add a comment or reply to a snippet discussion |
442
- | `gitlab_create_snippet_discussion` | Start a new discussion on a snippet |
417
+ | Tool | Description |
418
+ | --------------------------- | -------------------------------------------------------- |
419
+ | `gitlab_list_snippet_notes` | List all comments with cursor-based pagination (GraphQL) |
443
420
 
444
- ### Discussion Tools (2 tools)
421
+ ### Discussion Tools (4 tools)
445
422
 
446
- | Tool | Description |
447
- | ---------------------------- | -------------------------------------------------------------------------------------------- |
448
- | `gitlab_reply_to_discussion` | Universal tool for replying to any discussion thread (MRs, issues, epics, commits, snippets) |
449
- | `gitlab_get_discussion` | Universal tool for fetching discussion details from any resource type |
423
+ | Tool | Description |
424
+ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
425
+ | `gitlab_list_discussions` | List discussions (comment threads) on any GitLab resource (MRs, issues, epics, commits, snippets) with cursor pagination |
426
+ | `gitlab_get_discussion` | Get a specific discussion thread with all replies from any resource type |
427
+ | `gitlab_create_discussion` | Create a new discussion thread OR reply to an existing one (supports code-position comments for MRs and commits) |
428
+ | `gitlab_resolve_discussion` | Mark a discussion thread as resolved or unresolve it (MRs and issues only) |
450
429
 
451
430
  ### Audit Event Tools (3 tools)
452
431
 
@@ -516,18 +495,29 @@ const mr = await plugin.tool.gitlab_get_merge_request.execute({
516
495
  include_changes: true,
517
496
  });
518
497
 
519
- // Get discussions
520
- const discussions = await plugin.tool.gitlab_list_mr_discussions.execute({
498
+ // Get discussions (unified tool supports all resource types)
499
+ const discussions = await plugin.tool.gitlab_list_discussions.execute({
500
+ resource_type: 'merge_request',
521
501
  project_id: 'gitlab-org/gitlab',
522
- mr_iid: 12345,
502
+ iid: 12345,
523
503
  });
524
504
 
525
- // Add a review comment
526
- await plugin.tool.gitlab_create_mr_note.execute({
505
+ // Add a review comment (creates a new discussion)
506
+ await plugin.tool.gitlab_create_discussion.execute({
507
+ resource_type: 'merge_request',
527
508
  project_id: 'gitlab-org/gitlab',
528
- mr_iid: 12345,
509
+ iid: 12345,
529
510
  body: 'LGTM! Great work on this feature.',
530
511
  });
512
+
513
+ // Reply to an existing discussion thread
514
+ await plugin.tool.gitlab_create_discussion.execute({
515
+ resource_type: 'merge_request',
516
+ project_id: 'gitlab-org/gitlab',
517
+ iid: 12345,
518
+ discussion_id: discussions.discussions.nodes[0].id,
519
+ body: 'Thanks for addressing the feedback!',
520
+ });
531
521
  ```
532
522
 
533
523
  ### Example 3: Debug Failed Pipeline
@@ -588,10 +578,11 @@ const epicIssues = await plugin.tool.gitlab_list_epic_issues.execute({
588
578
  epic_iid: epic.iid,
589
579
  });
590
580
 
591
- // Add a comment
592
- await plugin.tool.gitlab_create_epic_note.execute({
581
+ // Add a comment (creates a new discussion)
582
+ await plugin.tool.gitlab_create_discussion.execute({
583
+ resource_type: 'epic',
593
584
  group_id: 'my-group',
594
- epic_iid: epic.iid,
585
+ iid: epic.iid,
595
586
  body: 'Epic created and issues linked successfully!',
596
587
  });
597
588
  ```
@@ -774,11 +765,12 @@ opencode-gitlab-plugin/
774
765
  │ │ ├── merge-requests.ts # MR tool definitions
775
766
  │ │ ├── pipelines.ts # Pipeline tool definitions
776
767
  │ │ ├── repository.ts # Repository tool definitions
768
+ │ │ ├── discussions-unified.ts # Unified discussion tools (4 tools)
777
769
  │ │ └── ... # Other tool definitions
778
770
  │ ├── index.ts # Main plugin entry point
779
771
  │ ├── utils.ts # Utility functions
780
772
  │ └── validation.ts # GID validation utilities
781
- ├── tests/ # Test suite (142 tests)
773
+ ├── tests/ # Test suite (180 tests)
782
774
  │ ├── client/ # Client tests
783
775
  │ ├── tools/ # Tool tests
784
776
  │ ├── validation.test.ts # Validation tests
@@ -900,7 +892,7 @@ npm run test:coverage
900
892
 
901
893
  **Test Coverage:**
902
894
 
903
- - **181 tests** across 21 test files
895
+ - **180 tests** across 21 test files
904
896
  - Client tests for all API methods (REST and GraphQL)
905
897
  - Tool tests for all tool definitions
906
898
  - Validation tests for GID utilities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/opencode-gitlab-plugin",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "GitLab tools plugin for OpenCode - provides GitLab API access for merge requests, issues, pipelines, and more",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",