@gitlab/opencode-gitlab-plugin 1.5.7 → 1.5.8

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.8](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/compare/v1.5.7...v1.5.8) (2026-02-03)
6
+
7
+
8
+ ### ♻️ Code Refactoring
9
+
10
+ * consolidate MR details, CI lint, and todo tools ([46d830f](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/commit/46d830fd6d9fabf851d7f6e8cc00836e55c7f266))
11
+
5
12
  ## [1.5.7](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/compare/v1.5.6...v1.5.7) (2026-02-03)
6
13
 
7
14
 
package/README.md CHANGED
@@ -287,9 +287,9 @@ Or for API tokens:
287
287
 
288
288
  ## 🛠️ Available Tools
289
289
 
290
- The plugin provides **67 tools** organized into the following categories:
290
+ The plugin provides **64 tools** organized into the following categories:
291
291
 
292
- ### Merge Request Tools (9 tools)
292
+ ### Merge Request Tools (8 tools)
293
293
 
294
294
  | Tool | Description |
295
295
  | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -298,8 +298,7 @@ The plugin provides **67 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_get_mr_commits` | Get all commits in a merge request |
302
- | `gitlab_get_mr_pipelines` | Get all pipelines for a merge request |
301
+ | `gitlab_get_mr_details` | Get additional MR details (commits or pipelines) with detail_type parameter |
303
302
  | `gitlab_list_merge_request_diffs` | List file diffs with pagination support for large changesets |
304
303
  | `gitlab_set_mr_auto_merge` | Enable auto-merge (MWPS) using GraphQL API when pipeline succeeds |
305
304
 
@@ -321,18 +320,17 @@ The plugin provides **67 tools** organized into the following categories:
321
320
  | `gitlab_update_epic` | Update epic title, description, labels, dates, and state |
322
321
  | `gitlab_manage_epic_issues` | Manage issues linked to an epic (list, add, remove) with action parameter |
323
322
 
324
- ### Pipeline Tools (8 tools)
323
+ ### Pipeline Tools (7 tools)
325
324
 
326
- | Tool | Description |
327
- | ---------------------------------- | ---------------------------------------------------------- |
328
- | `gitlab_list_pipelines` | List pipelines with filtering by status, ref, and username |
329
- | `gitlab_get_pipeline` | Get pipeline details with jobs and status |
330
- | `gitlab_list_pipeline_jobs` | List all jobs in a pipeline with optional scope filtering |
331
- | `gitlab_get_job_log` | Get the log output of a specific CI job |
332
- | `gitlab_retry_job` | Retry a failed or canceled job |
333
- | `gitlab_get_pipeline_failing_jobs` | Get only failed jobs for easier debugging |
334
- | `gitlab_lint_ci_config` | Validate CI/CD YAML configuration with project context |
335
- | `gitlab_lint_existing_ci_config` | Validate existing .gitlab-ci.yml from repository |
325
+ | Tool | Description |
326
+ | ---------------------------------- | ------------------------------------------------------------------------------- |
327
+ | `gitlab_list_pipelines` | List pipelines with filtering by status, ref, and username |
328
+ | `gitlab_get_pipeline` | Get pipeline details with jobs and status |
329
+ | `gitlab_list_pipeline_jobs` | List all jobs in a pipeline with optional scope filtering |
330
+ | `gitlab_get_job_log` | Get the log output of a specific CI job |
331
+ | `gitlab_retry_job` | Retry a failed or canceled job |
332
+ | `gitlab_get_pipeline_failing_jobs` | Get only failed jobs for easier debugging |
333
+ | `gitlab_lint_ci_config` | Validate CI/CD YAML config with mode parameter (content or existing repository) |
336
334
 
337
335
  ### Repository Tools (7 tools)
338
336
 
@@ -379,14 +377,13 @@ The plugin provides **67 tools** organized into the following categories:
379
377
 
380
378
  **Note**: All GraphQL-based security tools include automatic GID (Global ID) format validation.
381
379
 
382
- ### TODO Tools (4 tools)
380
+ ### TODO Tools (3 tools)
383
381
 
384
- | Tool | Description |
385
- | ---------------------------- | ------------------------------------------------------ |
386
- | `gitlab_list_todos` | List TODO items with cursor-based pagination (GraphQL) |
387
- | `gitlab_mark_todo_done` | Mark a specific TODO as completed |
388
- | `gitlab_mark_all_todos_done` | Mark all pending TODOs as completed |
389
- | `gitlab_get_todo_count` | Get count of pending TODOs (GraphQL) |
382
+ | Tool | Description |
383
+ | ----------------------- | ------------------------------------------------------ |
384
+ | `gitlab_list_todos` | List TODO items with cursor-based pagination (GraphQL) |
385
+ | `gitlab_mark_todo_done` | Mark TODOs as done with action parameter (one or all) |
386
+ | `gitlab_get_todo_count` | Get count of pending TODOs (GraphQL) |
390
387
 
391
388
  ### Project & User Tools (3 tools)
392
389
 
package/dist/index.js CHANGED
@@ -2155,30 +2155,33 @@ Can update title, description, state, assignees, reviewers, labels, and more.`,
2155
2155
  return JSON.stringify(mr, null, 2);
2156
2156
  }
2157
2157
  }),
2158
- gitlab_get_mr_commits: tool({
2159
- description: `Get the list of commits in a merge request.
2160
- Returns all commits that are part of the merge request.`,
2161
- args: {
2162
- project_id: z.string().describe("The project ID or URL-encoded path"),
2163
- mr_iid: z.number().describe("The internal ID of the merge request")
2164
- },
2165
- execute: async (args, _ctx) => {
2166
- const client = getGitLabClient();
2167
- const commits = await client.getMrCommits(args.project_id, args.mr_iid);
2168
- return JSON.stringify(commits, null, 2);
2169
- }
2170
- }),
2171
- gitlab_get_mr_pipelines: tool({
2172
- description: `Get the list of pipelines for a merge request.
2173
- Returns all pipelines that ran for the merge request.`,
2158
+ gitlab_get_mr_details: tool({
2159
+ description: `Get additional details for a merge request.
2160
+
2161
+ Detail types:
2162
+ - commits: List all commits in the MR
2163
+ - pipelines: List all pipelines that ran for the MR
2164
+
2165
+ Examples:
2166
+ - Get commits: detail_type="commits", project_id="group/project", mr_iid=123
2167
+ - Get pipelines: detail_type="pipelines", project_id="group/project", mr_iid=123`,
2174
2168
  args: {
2169
+ detail_type: z.enum(["commits", "pipelines"]).describe("Type of details to fetch"),
2175
2170
  project_id: z.string().describe("The project ID or URL-encoded path"),
2176
2171
  mr_iid: z.number().describe("The internal ID of the merge request")
2177
2172
  },
2178
2173
  execute: async (args, _ctx) => {
2179
2174
  const client = getGitLabClient();
2180
- const pipelines = await client.getMrPipelines(args.project_id, args.mr_iid);
2181
- return JSON.stringify(pipelines, null, 2);
2175
+ switch (args.detail_type) {
2176
+ case "commits": {
2177
+ const commits = await client.getMrCommits(args.project_id, args.mr_iid);
2178
+ return JSON.stringify(commits, null, 2);
2179
+ }
2180
+ case "pipelines": {
2181
+ const pipelines = await client.getMrPipelines(args.project_id, args.mr_iid);
2182
+ return JSON.stringify(pipelines, null, 2);
2183
+ }
2184
+ }
2182
2185
  }
2183
2186
  }),
2184
2187
  gitlab_list_merge_request_diffs: tool({
@@ -2559,66 +2562,58 @@ This validates the configuration in the context of the project, including:
2559
2562
  - Optionally simulating pipeline creation (dry_run)
2560
2563
  - Optionally including the list of jobs that would be created
2561
2564
 
2565
+ Modes:
2566
+ - content: Validate provided YAML content (requires 'content' parameter)
2567
+ - existing: Validate the existing .gitlab-ci.yml from the repository
2568
+
2562
2569
  Returns validation result with:
2563
2570
  - valid: boolean indicating if configuration is valid
2564
2571
  - errors: array of error messages
2565
2572
  - warnings: array of warning messages
2566
2573
  - merged_yaml: the final merged YAML after processing includes (optional)
2567
- - jobs: list of jobs that would be created (optional, requires include_jobs=true)`,
2574
+ - includes: list of included files (for existing mode)
2575
+ - jobs: list of jobs that would be created (optional, requires include_jobs=true)
2576
+
2577
+ Examples:
2578
+ - Validate content: mode="content", project_id="group/project", content="stages: [build]..."
2579
+ - Validate existing: mode="existing", project_id="group/project"`,
2568
2580
  args: {
2581
+ mode: z4.enum(["content", "existing"]).describe('Validation mode: "content" for provided YAML, "existing" for repo file'),
2569
2582
  project_id: z4.string().describe("The project ID or URL-encoded path"),
2570
- content: z4.string().describe("The CI/CD configuration content (YAML as string)"),
2583
+ content: z4.string().optional().describe('The CI/CD configuration content (YAML as string) - required for mode="content"'),
2571
2584
  dry_run: z4.boolean().optional().describe("Run pipeline creation simulation instead of just static check (default: false)"),
2572
2585
  include_jobs: z4.boolean().optional().describe("Include list of jobs that would be created in the response (default: false)"),
2573
2586
  ref: z4.string().optional().describe(
2574
2587
  "Branch or tag context to use for validation (defaults to project default branch)"
2575
- )
2576
- },
2577
- execute: async (args, _ctx) => {
2578
- const client = getGitLabClient();
2579
- const result = await client.lintCiConfig(args.project_id, args.content, {
2580
- dry_run: args.dry_run,
2581
- include_jobs: args.include_jobs,
2582
- ref: args.ref
2583
- });
2584
- return JSON.stringify(result, null, 2);
2585
- }
2586
- }),
2587
- gitlab_lint_existing_ci_config: tool4({
2588
- description: `Validate an existing .gitlab-ci.yml configuration from the repository.
2589
- This validates the configuration in the context of the project, including:
2590
- - Using the project's CI/CD variables
2591
- - Searching the project's files for include:local entries
2592
- - Optionally simulating pipeline creation (dry_run)
2593
- - Optionally including the list of jobs that would be created
2594
-
2595
- Returns validation result with:
2596
- - valid: boolean indicating if configuration is valid
2597
- - errors: array of error messages
2598
- - warnings: array of warning messages
2599
- - merged_yaml: the final merged YAML after processing includes (optional)
2600
- - includes: list of included files with their locations (optional)
2601
- - jobs: list of jobs that would be created (optional, requires include_jobs=true)`,
2602
- args: {
2603
- project_id: z4.string().describe("The project ID or URL-encoded path"),
2604
- content_ref: z4.string().optional().describe(
2605
- "Commit SHA, branch or tag to get CI config from (defaults to project default branch)"
2606
2588
  ),
2607
- dry_run: z4.boolean().optional().describe("Run pipeline creation simulation instead of just static check (default: false)"),
2608
- dry_run_ref: z4.string().optional().describe(
2609
- "Branch or tag context to use for validation when dry_run is true (defaults to project default branch)"
2610
- ),
2611
- include_jobs: z4.boolean().optional().describe("Include list of jobs that would be created in the response (default: false)")
2589
+ content_ref: z4.string().optional().describe(
2590
+ 'For mode="existing": Commit SHA, branch or tag to get CI config from (defaults to project default branch)'
2591
+ )
2612
2592
  },
2613
2593
  execute: async (args, _ctx) => {
2614
2594
  const client = getGitLabClient();
2615
- const result = await client.lintExistingCiConfig(args.project_id, {
2616
- content_ref: args.content_ref,
2617
- dry_run: args.dry_run,
2618
- dry_run_ref: args.dry_run_ref,
2619
- include_jobs: args.include_jobs
2620
- });
2621
- return JSON.stringify(result, null, 2);
2595
+ switch (args.mode) {
2596
+ case "content": {
2597
+ if (!args.content) {
2598
+ return JSON.stringify({ error: 'content is required when mode is "content"' }, null, 2);
2599
+ }
2600
+ const result = await client.lintCiConfig(args.project_id, args.content, {
2601
+ dry_run: args.dry_run,
2602
+ include_jobs: args.include_jobs,
2603
+ ref: args.ref
2604
+ });
2605
+ return JSON.stringify(result, null, 2);
2606
+ }
2607
+ case "existing": {
2608
+ const result = await client.lintExistingCiConfig(args.project_id, {
2609
+ content_ref: args.content_ref,
2610
+ dry_run: args.dry_run,
2611
+ dry_run_ref: args.ref,
2612
+ include_jobs: args.include_jobs
2613
+ });
2614
+ return JSON.stringify(result, null, 2);
2615
+ }
2616
+ }
2622
2617
  }
2623
2618
  })
2624
2619
  };
@@ -3211,25 +3206,34 @@ Use 'before' with the 'startCursor' from pageInfo to get the previous page.`,
3211
3206
  }
3212
3207
  }),
3213
3208
  gitlab_mark_todo_done: tool9({
3214
- description: `Mark a specific TODO item as done.
3215
- Use this to mark a single TODO as completed.`,
3209
+ description: `Mark TODO items as done.
3210
+
3211
+ Actions:
3212
+ - one: Mark a specific TODO item as done (requires todo_id)
3213
+ - all: Mark all pending TODO items as done
3214
+
3215
+ Examples:
3216
+ - Mark one: action="one", todo_id=123
3217
+ - Mark all: action="all"`,
3216
3218
  args: {
3217
- todo_id: z9.number().describe("The ID of the TODO item to mark as done")
3219
+ action: z9.enum(["one", "all"]).describe('Action to perform: "one" for single TODO, "all" for all TODOs'),
3220
+ todo_id: z9.number().optional().describe('The ID of the TODO item (required for action="one")')
3218
3221
  },
3219
3222
  execute: async (args, _ctx) => {
3220
3223
  const client = getGitLabClient();
3221
- const result = await client.markTodoAsDone(args.todo_id);
3222
- return JSON.stringify(result, null, 2);
3223
- }
3224
- }),
3225
- gitlab_mark_all_todos_done: tool9({
3226
- description: `Mark all TODO items as done.
3227
- Use this to mark all pending TODOs for the current user as completed.`,
3228
- args: {},
3229
- execute: async (_args, _ctx) => {
3230
- const client = getGitLabClient();
3231
- const result = await client.markAllTodosAsDone();
3232
- return JSON.stringify(result, null, 2);
3224
+ switch (args.action) {
3225
+ case "one": {
3226
+ if (args.todo_id === void 0) {
3227
+ return JSON.stringify({ error: 'todo_id is required when action is "one"' }, null, 2);
3228
+ }
3229
+ const result = await client.markTodoAsDone(args.todo_id);
3230
+ return JSON.stringify(result, null, 2);
3231
+ }
3232
+ case "all": {
3233
+ const result = await client.markAllTodosAsDone();
3234
+ return JSON.stringify(result, null, 2);
3235
+ }
3236
+ }
3233
3237
  }
3234
3238
  }),
3235
3239
  gitlab_get_todo_count: tool9({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/opencode-gitlab-plugin",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
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",