@gitlab/opencode-gitlab-plugin 1.5.5 → 1.5.6
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 +8 -0
- package/README.md +8 -17
- package/dist/gitlab-opencode-gitlab-plugin-1.5.6.tgz +0 -0
- package/dist/index.js +174 -235
- package/package.json +1 -1
- package/dist/gitlab-opencode-gitlab-plugin-1.5.5.tgz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.6](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/compare/v1.5.5...v1.5.6) (2026-02-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ♻️ Code Refactoring
|
|
9
|
+
|
|
10
|
+
* consolidate search tools into unified interface ([bb75def](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/commit/bb75def68290ea740a04d09afc5d7efa9da02020))
|
|
11
|
+
* implement GitLab Duo review suggestions ([8fa6738](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/commit/8fa67382436d8edb9bce1868c3330d8853255606))
|
|
12
|
+
|
|
5
13
|
## [1.5.5](https://gitlab.com/gitlab-org/editor-extensions/opencode-gitlab-plugin/compare/v1.5.4...v1.5.5) (2026-02-03)
|
|
6
14
|
|
|
7
15
|
|
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ graph LR
|
|
|
134
134
|
B --> B1[readTokenFromAuthStorage]
|
|
135
135
|
B --> B2[getGitLabClient]
|
|
136
136
|
|
|
137
|
-
C --> C1[
|
|
137
|
+
C --> C1[69 Tool Definitions]
|
|
138
138
|
|
|
139
139
|
D --> A
|
|
140
140
|
D --> B
|
|
@@ -287,7 +287,7 @@ Or for API tokens:
|
|
|
287
287
|
|
|
288
288
|
## 🛠️ Available Tools
|
|
289
289
|
|
|
290
|
-
The plugin provides **
|
|
290
|
+
The plugin provides **69 tools** organized into the following categories:
|
|
291
291
|
|
|
292
292
|
### Merge Request Tools (9 tools)
|
|
293
293
|
|
|
@@ -348,21 +348,12 @@ The plugin provides **78 tools** organized into the following categories:
|
|
|
348
348
|
| `gitlab_list_branches` | List all branches in a repository |
|
|
349
349
|
| `gitlab_get_commit_comments` | Get all commit comments in flat structure |
|
|
350
350
|
|
|
351
|
-
### Search Tools (
|
|
352
|
-
|
|
353
|
-
| Tool | Description
|
|
354
|
-
| ----------------------------- |
|
|
355
|
-
| `gitlab_search` |
|
|
356
|
-
| `
|
|
357
|
-
| `gitlab_merge_request_search` | Specialized merge request search with better filtering |
|
|
358
|
-
| `gitlab_blob_search` | Search code/text within repository files |
|
|
359
|
-
| `gitlab_commit_search` | Search commits by message, author, or SHA |
|
|
360
|
-
| `gitlab_group_project_search` | Search projects within a specific group |
|
|
361
|
-
| `gitlab_milestone_search` | Search milestones by title or description |
|
|
362
|
-
| `gitlab_note_search` | Search comments across issues, MRs, and commits (Premium/Ultimate) |
|
|
363
|
-
| `gitlab_user_search` | Search users by name or email |
|
|
364
|
-
| `gitlab_wiki_blob_search` | Search wiki content with advanced filters |
|
|
365
|
-
| `gitlab_documentation_search` | Search GitLab official documentation |
|
|
351
|
+
### Search Tools (2 tools)
|
|
352
|
+
|
|
353
|
+
| Tool | Description |
|
|
354
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
355
|
+
| `gitlab_search` | Unified search across all GitLab resources with scope-specific options (projects, issues, merge_requests, milestones, users, blobs, commits, notes, wiki_blobs, group_projects) |
|
|
356
|
+
| `gitlab_documentation_search` | Search GitLab official documentation at docs.gitlab.com |
|
|
366
357
|
|
|
367
358
|
### Work Item Tools (6 tools)
|
|
368
359
|
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -2734,10 +2734,83 @@ This is different from discussions - it returns individual comments in a flat st
|
|
|
2734
2734
|
// src/tools/search.ts
|
|
2735
2735
|
import { tool as tool6 } from "@opencode-ai/plugin";
|
|
2736
2736
|
var z6 = tool6.schema;
|
|
2737
|
+
var GENERIC_SEARCH_SCOPES = ["projects", "issues", "merge_requests", "blobs"];
|
|
2738
|
+
var SPECIALIZED_SCOPES = [
|
|
2739
|
+
"milestones",
|
|
2740
|
+
"users",
|
|
2741
|
+
"commits",
|
|
2742
|
+
"notes",
|
|
2743
|
+
"wiki_blobs",
|
|
2744
|
+
"group_projects"
|
|
2745
|
+
];
|
|
2746
|
+
var ALL_SCOPES = [...GENERIC_SEARCH_SCOPES, ...SPECIALIZED_SCOPES];
|
|
2747
|
+
var REF_SUPPORTED_SCOPES = ["commits", "wiki_blobs"];
|
|
2748
|
+
var STATE_SUPPORTED_SCOPES = ["milestones"];
|
|
2749
|
+
function validationError(param, scope) {
|
|
2750
|
+
return new Error(`Missing required parameter: '${param}' is required for scope '${scope}'`);
|
|
2751
|
+
}
|
|
2752
|
+
function invalidParamError(param, validScopes) {
|
|
2753
|
+
return new Error(
|
|
2754
|
+
`Invalid parameter: '${param}' is only valid for scopes: ${validScopes.join(", ")}`
|
|
2755
|
+
);
|
|
2756
|
+
}
|
|
2757
|
+
function validateSearchParams(scope, args) {
|
|
2758
|
+
switch (scope) {
|
|
2759
|
+
case "notes":
|
|
2760
|
+
if (!args.project_id) throw validationError("project_id", scope);
|
|
2761
|
+
break;
|
|
2762
|
+
case "group_projects":
|
|
2763
|
+
if (!args.group_id) throw validationError("group_id", scope);
|
|
2764
|
+
break;
|
|
2765
|
+
}
|
|
2766
|
+
if (args.ref && !REF_SUPPORTED_SCOPES.includes(scope)) {
|
|
2767
|
+
throw invalidParamError("ref", REF_SUPPORTED_SCOPES);
|
|
2768
|
+
}
|
|
2769
|
+
if (args.state && !STATE_SUPPORTED_SCOPES.includes(scope)) {
|
|
2770
|
+
throw invalidParamError("state", STATE_SUPPORTED_SCOPES);
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2737
2773
|
var searchTools = {
|
|
2774
|
+
/**
|
|
2775
|
+
* Unified search across all GitLab resources
|
|
2776
|
+
*
|
|
2777
|
+
* @example
|
|
2778
|
+
* // Search for issues in a project
|
|
2779
|
+
* gitlab_search({ scope: "issues", search: "bug", project_id: "my-group/project" })
|
|
2780
|
+
*
|
|
2781
|
+
* @example
|
|
2782
|
+
* // Search commits on specific branch
|
|
2783
|
+
* gitlab_search({ scope: "commits", search: "fix", ref: "main" })
|
|
2784
|
+
*
|
|
2785
|
+
* @example
|
|
2786
|
+
* // Search for projects within a group
|
|
2787
|
+
* gitlab_search({ scope: "group_projects", group_id: "gitlab-org", search: "runner" })
|
|
2788
|
+
*
|
|
2789
|
+
* @example
|
|
2790
|
+
* // Search notes/comments in a project
|
|
2791
|
+
* gitlab_search({ scope: "notes", search: "LGTM", project_id: "my-group/project" })
|
|
2792
|
+
*/
|
|
2738
2793
|
gitlab_search: tool6({
|
|
2739
|
-
description: `Search across GitLab for various resources.
|
|
2740
|
-
|
|
2794
|
+
description: `Search across GitLab for various resources with scope-specific options.
|
|
2795
|
+
|
|
2796
|
+
Scopes and their requirements:
|
|
2797
|
+
- projects: Search projects by name/description
|
|
2798
|
+
- issues: Search issues by title/description
|
|
2799
|
+
- merge_requests: Search MRs by title/description
|
|
2800
|
+
- milestones: Search milestones (supports state filter)
|
|
2801
|
+
- users: Search users by name/email
|
|
2802
|
+
- blobs: Search file content (code search)
|
|
2803
|
+
- commits: Search commits by message/author/SHA (supports ref filter)
|
|
2804
|
+
- notes: Search comments/notes (requires project_id)
|
|
2805
|
+
- wiki_blobs: Search wiki content (supports ref filter)
|
|
2806
|
+
- group_projects: Search projects within a group (requires group_id)
|
|
2807
|
+
|
|
2808
|
+
Examples:
|
|
2809
|
+
- Issues: scope="issues", search="bug", project_id="my-group/my-project"
|
|
2810
|
+
- Code: scope="blobs", search="function calculateTotal"
|
|
2811
|
+
- Commits: scope="commits", search="fix login", ref="main"
|
|
2812
|
+
- Group projects: scope="group_projects", group_id="gitlab-org", search="runner"
|
|
2813
|
+
- Notes: scope="notes", search="LGTM", project_id="my-group/my-project"`,
|
|
2741
2814
|
args: {
|
|
2742
2815
|
scope: z6.enum([
|
|
2743
2816
|
"projects",
|
|
@@ -2748,238 +2821,104 @@ Scopes: projects, issues, merge_requests, milestones, users, blobs (code), commi
|
|
|
2748
2821
|
"blobs",
|
|
2749
2822
|
"commits",
|
|
2750
2823
|
"notes",
|
|
2751
|
-
"wiki_blobs"
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
project_id: z6.string().optional().describe("Limit search to a specific project (optional)"),
|
|
2755
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2756
|
-
},
|
|
2757
|
-
execute: async (args, _ctx) => {
|
|
2758
|
-
const client = getGitLabClient();
|
|
2759
|
-
const results = await client.search(args.scope, args.search, args.project_id, args.limit);
|
|
2760
|
-
return JSON.stringify(results, null, 2);
|
|
2761
|
-
}
|
|
2762
|
-
}),
|
|
2763
|
-
gitlab_issue_search: tool6({
|
|
2764
|
-
description: `Search issues by keyword across GitLab.
|
|
2765
|
-
Specialized search for issues with better filtering than the generic search.`,
|
|
2766
|
-
args: {
|
|
2767
|
-
search: z6.string().describe("The search query"),
|
|
2768
|
-
project_id: z6.string().optional().describe("Limit search to a specific project (optional)"),
|
|
2769
|
-
state: z6.enum(["opened", "closed", "all"]).optional().describe("Filter by issue state"),
|
|
2770
|
-
labels: z6.string().optional().describe("Comma-separated list of labels to filter by"),
|
|
2771
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2772
|
-
},
|
|
2773
|
-
execute: async (args, _ctx) => {
|
|
2774
|
-
const client = getGitLabClient();
|
|
2775
|
-
const results = await client.search("issues", args.search, args.project_id, args.limit);
|
|
2776
|
-
return JSON.stringify(results, null, 2);
|
|
2777
|
-
}
|
|
2778
|
-
}),
|
|
2779
|
-
gitlab_blob_search: tool6({
|
|
2780
|
-
description: `Search file content in repositories.
|
|
2781
|
-
Search for code/text within files across projects.`,
|
|
2782
|
-
args: {
|
|
2783
|
-
search: z6.string().describe("The search query (code/text to find)"),
|
|
2784
|
-
project_id: z6.string().optional().describe("Limit search to a specific project (optional)"),
|
|
2785
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2786
|
-
},
|
|
2787
|
-
execute: async (args, _ctx) => {
|
|
2788
|
-
const client = getGitLabClient();
|
|
2789
|
-
const results = await client.search("blobs", args.search, args.project_id, args.limit);
|
|
2790
|
-
return JSON.stringify(results, null, 2);
|
|
2791
|
-
}
|
|
2792
|
-
}),
|
|
2793
|
-
gitlab_merge_request_search: tool6({
|
|
2794
|
-
description: `Search merge requests by keyword.
|
|
2795
|
-
Specialized search for merge requests with better filtering than the generic search.`,
|
|
2796
|
-
args: {
|
|
2824
|
+
"wiki_blobs",
|
|
2825
|
+
"group_projects"
|
|
2826
|
+
]).describe("The type of resource to search"),
|
|
2797
2827
|
search: z6.string().describe("The search query"),
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
);
|
|
2811
|
-
return JSON.stringify(results, null, 2);
|
|
2812
|
-
}
|
|
2813
|
-
}),
|
|
2814
|
-
gitlab_commit_search: tool6({
|
|
2815
|
-
description: `Search for commits in a project or across GitLab.
|
|
2816
|
-
Returns commits matching the search query with commit details including SHA, title, message, author, and dates.
|
|
2817
|
-
|
|
2818
|
-
Supports searching by:
|
|
2819
|
-
- Commit message content
|
|
2820
|
-
- Author name or email
|
|
2821
|
-
- Commit SHA (partial or full)
|
|
2822
|
-
|
|
2823
|
-
Note: Advanced search features (Premium/Ultimate) provide better commit search capabilities.`,
|
|
2824
|
-
args: {
|
|
2825
|
-
search: z6.string().describe("The search query (commit message, author, or SHA)"),
|
|
2826
|
-
project_id: z6.string().optional().describe("Limit search to a specific project (optional)"),
|
|
2827
|
-
ref: z6.string().optional().describe("Branch or tag name to search on (defaults to default branch)"),
|
|
2828
|
-
order_by: z6.enum(["created_at"]).optional().describe("Order results by created_at (default: created_at desc)"),
|
|
2829
|
-
sort: z6.enum(["asc", "desc"]).optional().describe("Sort order (asc or desc)"),
|
|
2830
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2828
|
+
// Context parameters
|
|
2829
|
+
project_id: z6.string().optional().describe("Limit search to a specific project. Required for notes scope"),
|
|
2830
|
+
group_id: z6.string().optional().describe("Group ID or path. Required for group_projects scope"),
|
|
2831
|
+
// Common options
|
|
2832
|
+
limit: z6.number().optional().describe("Maximum number of results (default: 20)"),
|
|
2833
|
+
order_by: z6.enum(["created_at"]).optional().describe(
|
|
2834
|
+
"Order results by field (for milestones, users, commits, notes, wiki_blobs, group_projects)"
|
|
2835
|
+
),
|
|
2836
|
+
sort: z6.enum(["asc", "desc"]).optional().describe("Sort order (for milestones, users, commits, notes, wiki_blobs, group_projects)"),
|
|
2837
|
+
// Scope-specific options
|
|
2838
|
+
ref: z6.string().optional().describe("Branch or tag name (for commits, wiki_blobs scopes)"),
|
|
2839
|
+
state: z6.enum(["active", "closed", "all"]).optional().describe("Filter by state (for milestones scope)")
|
|
2831
2840
|
},
|
|
2832
2841
|
execute: async (args, _ctx) => {
|
|
2833
|
-
|
|
2834
|
-
|
|
2842
|
+
validateSearchParams(args.scope, {
|
|
2843
|
+
project_id: args.project_id,
|
|
2844
|
+
group_id: args.group_id,
|
|
2835
2845
|
ref: args.ref,
|
|
2836
|
-
|
|
2837
|
-
sort: args.sort,
|
|
2838
|
-
limit: args.limit
|
|
2846
|
+
state: args.state
|
|
2839
2847
|
});
|
|
2840
|
-
return JSON.stringify(results, null, 2);
|
|
2841
|
-
}
|
|
2842
|
-
}),
|
|
2843
|
-
gitlab_group_project_search: tool6({
|
|
2844
|
-
description: `Search for projects within a specific group.
|
|
2845
|
-
Returns projects matching the search query within the specified group and its subgroups.
|
|
2846
|
-
|
|
2847
|
-
Useful for:
|
|
2848
|
-
- Finding projects by name or description within a group
|
|
2849
|
-
- Discovering projects in large group hierarchies
|
|
2850
|
-
- Filtering group projects by keywords`,
|
|
2851
|
-
args: {
|
|
2852
|
-
group_id: z6.string().describe("The group ID or URL-encoded path"),
|
|
2853
|
-
search: z6.string().describe("The search query (project name or description)"),
|
|
2854
|
-
order_by: z6.enum(["created_at"]).optional().describe("Order results by created_at (default: created_at desc)"),
|
|
2855
|
-
sort: z6.enum(["asc", "desc"]).optional().describe("Sort order (asc or desc)"),
|
|
2856
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2857
|
-
},
|
|
2858
|
-
execute: async (args, _ctx) => {
|
|
2859
2848
|
const client = getGitLabClient();
|
|
2860
|
-
const
|
|
2849
|
+
const commonOptions = {
|
|
2861
2850
|
order_by: args.order_by,
|
|
2862
2851
|
sort: args.sort,
|
|
2863
2852
|
limit: args.limit
|
|
2864
|
-
}
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
- Finding users to assign to issues or merge requests
|
|
2928
|
-
- Looking up user information by name or email
|
|
2929
|
-
- Discovering team members and collaborators`,
|
|
2930
|
-
args: {
|
|
2931
|
-
search: z6.string().describe("The search query (user name or email)"),
|
|
2932
|
-
project_id: z6.string().optional().describe("Limit search to project members (optional)"),
|
|
2933
|
-
order_by: z6.enum(["created_at"]).optional().describe("Order results by created_at (default: created_at desc)"),
|
|
2934
|
-
sort: z6.enum(["asc", "desc"]).optional().describe("Sort order (asc or desc)"),
|
|
2935
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2936
|
-
},
|
|
2937
|
-
execute: async (args, _ctx) => {
|
|
2938
|
-
const client = getGitLabClient();
|
|
2939
|
-
const results = await client.searchUsers(args.search, args.project_id, {
|
|
2940
|
-
order_by: args.order_by,
|
|
2941
|
-
sort: args.sort,
|
|
2942
|
-
limit: args.limit
|
|
2943
|
-
});
|
|
2944
|
-
return JSON.stringify(results, null, 2);
|
|
2945
|
-
}
|
|
2946
|
-
}),
|
|
2947
|
-
gitlab_wiki_blob_search: tool6({
|
|
2948
|
-
description: `Search for wiki content (blobs) in a project or across GitLab.
|
|
2949
|
-
Returns wiki pages matching the search query with content snippets and file information.
|
|
2950
|
-
|
|
2951
|
-
Supports advanced filters (use in search query):
|
|
2952
|
-
- filename:some_name* - Filter by filename with wildcards
|
|
2953
|
-
- path:some/path* - Filter by path with wildcards
|
|
2954
|
-
- extension:md - Filter by file extension
|
|
2955
|
-
|
|
2956
|
-
Examples:
|
|
2957
|
-
- "installation" - Search for "installation" in wiki content
|
|
2958
|
-
- "setup filename:getting-started*" - Search in files starting with "getting-started"
|
|
2959
|
-
- "api extension:md" - Search for "api" in markdown files
|
|
2960
|
-
|
|
2961
|
-
Note: Advanced search (Premium/Ultimate) provides better wiki search capabilities.`,
|
|
2962
|
-
args: {
|
|
2963
|
-
search: z6.string().describe(
|
|
2964
|
-
"The search query (supports filters: filename:, path:, extension: with wildcards)"
|
|
2965
|
-
),
|
|
2966
|
-
project_id: z6.string().optional().describe("Limit search to a specific project (optional)"),
|
|
2967
|
-
ref: z6.string().optional().describe("Branch or tag name to search on (defaults to default branch)"),
|
|
2968
|
-
order_by: z6.enum(["created_at"]).optional().describe("Order results by created_at (default: created_at desc)"),
|
|
2969
|
-
sort: z6.enum(["asc", "desc"]).optional().describe("Sort order (asc or desc)"),
|
|
2970
|
-
limit: z6.number().optional().describe("Maximum number of results (default: 20)")
|
|
2971
|
-
},
|
|
2972
|
-
execute: async (args, _ctx) => {
|
|
2973
|
-
const client = getGitLabClient();
|
|
2974
|
-
const results = await client.searchWikiBlobs(args.search, args.project_id, {
|
|
2975
|
-
ref: args.ref,
|
|
2976
|
-
order_by: args.order_by,
|
|
2977
|
-
sort: args.sort,
|
|
2978
|
-
limit: args.limit
|
|
2979
|
-
});
|
|
2980
|
-
return JSON.stringify(results, null, 2);
|
|
2853
|
+
};
|
|
2854
|
+
switch (args.scope) {
|
|
2855
|
+
// Generic search API scopes
|
|
2856
|
+
case "projects":
|
|
2857
|
+
case "issues":
|
|
2858
|
+
case "merge_requests":
|
|
2859
|
+
case "blobs":
|
|
2860
|
+
return JSON.stringify(
|
|
2861
|
+
await client.search(args.scope, args.search, args.project_id, args.limit),
|
|
2862
|
+
null,
|
|
2863
|
+
2
|
|
2864
|
+
);
|
|
2865
|
+
// Specialized scopes with dedicated client methods
|
|
2866
|
+
case "milestones":
|
|
2867
|
+
return JSON.stringify(
|
|
2868
|
+
await client.searchMilestones(args.search, args.project_id, {
|
|
2869
|
+
...commonOptions,
|
|
2870
|
+
state: args.state
|
|
2871
|
+
}),
|
|
2872
|
+
null,
|
|
2873
|
+
2
|
|
2874
|
+
);
|
|
2875
|
+
case "users":
|
|
2876
|
+
return JSON.stringify(
|
|
2877
|
+
await client.searchUsers(args.search, args.project_id, commonOptions),
|
|
2878
|
+
null,
|
|
2879
|
+
2
|
|
2880
|
+
);
|
|
2881
|
+
case "commits":
|
|
2882
|
+
return JSON.stringify(
|
|
2883
|
+
await client.searchCommits(args.search, args.project_id, {
|
|
2884
|
+
...commonOptions,
|
|
2885
|
+
ref: args.ref
|
|
2886
|
+
}),
|
|
2887
|
+
null,
|
|
2888
|
+
2
|
|
2889
|
+
);
|
|
2890
|
+
case "notes":
|
|
2891
|
+
return JSON.stringify(
|
|
2892
|
+
await client.searchNotes(args.search, args.project_id, commonOptions),
|
|
2893
|
+
null,
|
|
2894
|
+
2
|
|
2895
|
+
);
|
|
2896
|
+
case "wiki_blobs":
|
|
2897
|
+
return JSON.stringify(
|
|
2898
|
+
await client.searchWikiBlobs(args.search, args.project_id, {
|
|
2899
|
+
...commonOptions,
|
|
2900
|
+
ref: args.ref
|
|
2901
|
+
}),
|
|
2902
|
+
null,
|
|
2903
|
+
2
|
|
2904
|
+
);
|
|
2905
|
+
case "group_projects":
|
|
2906
|
+
return JSON.stringify(
|
|
2907
|
+
await client.searchGroupProjects(args.group_id, args.search, commonOptions),
|
|
2908
|
+
null,
|
|
2909
|
+
2
|
|
2910
|
+
);
|
|
2911
|
+
default:
|
|
2912
|
+
throw new Error(
|
|
2913
|
+
`Invalid scope '${args.scope}'. Must be one of: ${ALL_SCOPES.join(", ")}`
|
|
2914
|
+
);
|
|
2915
|
+
}
|
|
2981
2916
|
}
|
|
2982
2917
|
}),
|
|
2918
|
+
/**
|
|
2919
|
+
* Search GitLab official documentation
|
|
2920
|
+
* Separate tool because it uses a completely different API (docs.gitlab.com)
|
|
2921
|
+
*/
|
|
2983
2922
|
gitlab_documentation_search: tool6({
|
|
2984
2923
|
description: `Search GitLab official documentation at docs.gitlab.com.
|
|
2985
2924
|
Returns relevant documentation pages matching the search query.
|
|
@@ -3757,7 +3696,7 @@ import { tool as tool13 } from "@opencode-ai/plugin";
|
|
|
3757
3696
|
var z13 = tool13.schema;
|
|
3758
3697
|
var VALID_LIST_CREATE_TYPES = ["merge_request", "issue", "epic", "snippet"];
|
|
3759
3698
|
var VALID_GET_NOTE_TYPES = ["issue", "epic"];
|
|
3760
|
-
function
|
|
3699
|
+
function validationError2(param, resourceType) {
|
|
3761
3700
|
return new Error(
|
|
3762
3701
|
`Missing required parameter: '${param}' is required for resource_type '${resourceType}'`
|
|
3763
3702
|
);
|
|
@@ -3771,16 +3710,16 @@ function validateListCreateParams(resourceType, args) {
|
|
|
3771
3710
|
switch (resourceType) {
|
|
3772
3711
|
case "merge_request":
|
|
3773
3712
|
case "issue":
|
|
3774
|
-
if (!args.project_id) throw
|
|
3775
|
-
if (args.iid == null) throw
|
|
3713
|
+
if (!args.project_id) throw validationError2("project_id", resourceType);
|
|
3714
|
+
if (args.iid == null) throw validationError2("iid", resourceType);
|
|
3776
3715
|
break;
|
|
3777
3716
|
case "epic":
|
|
3778
|
-
if (!args.group_id) throw
|
|
3779
|
-
if (args.iid == null) throw
|
|
3717
|
+
if (!args.group_id) throw validationError2("group_id", resourceType);
|
|
3718
|
+
if (args.iid == null) throw validationError2("iid", resourceType);
|
|
3780
3719
|
break;
|
|
3781
3720
|
case "snippet":
|
|
3782
|
-
if (!args.project_id) throw
|
|
3783
|
-
if (args.snippet_id == null) throw
|
|
3721
|
+
if (!args.project_id) throw validationError2("project_id", resourceType);
|
|
3722
|
+
if (args.snippet_id == null) throw validationError2("snippet_id", resourceType);
|
|
3784
3723
|
break;
|
|
3785
3724
|
}
|
|
3786
3725
|
}
|
|
@@ -3790,15 +3729,15 @@ function validateGetNoteParams(resourceType, args) {
|
|
|
3790
3729
|
`Invalid resource_type '${resourceType}'. Must be one of: ${VALID_GET_NOTE_TYPES.join(", ")}`
|
|
3791
3730
|
);
|
|
3792
3731
|
}
|
|
3793
|
-
if (args.note_id == null) throw
|
|
3732
|
+
if (args.note_id == null) throw validationError2("note_id", resourceType);
|
|
3794
3733
|
switch (resourceType) {
|
|
3795
3734
|
case "issue":
|
|
3796
|
-
if (!args.project_id) throw
|
|
3797
|
-
if (args.iid == null) throw
|
|
3735
|
+
if (!args.project_id) throw validationError2("project_id", resourceType);
|
|
3736
|
+
if (args.iid == null) throw validationError2("iid", resourceType);
|
|
3798
3737
|
break;
|
|
3799
3738
|
case "epic":
|
|
3800
|
-
if (!args.group_id) throw
|
|
3801
|
-
if (args.iid == null) throw
|
|
3739
|
+
if (!args.group_id) throw validationError2("group_id", resourceType);
|
|
3740
|
+
if (args.iid == null) throw validationError2("iid", resourceType);
|
|
3802
3741
|
break;
|
|
3803
3742
|
}
|
|
3804
3743
|
}
|
package/package.json
CHANGED
|
Binary file
|