@structured-world/gitlab-mcp 6.1.0 → 6.2.1
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/README.md +14 -13
- package/dist/src/entities/pipelines/registry.js +181 -229
- package/dist/src/entities/pipelines/registry.js.map +1 -1
- package/dist/src/entities/pipelines/schema-readonly.d.ts +25 -23
- package/dist/src/entities/pipelines/schema-readonly.js +90 -83
- package/dist/src/entities/pipelines/schema-readonly.js.map +1 -1
- package/dist/src/entities/pipelines/schema.d.ts +27 -30
- package/dist/src/entities/pipelines/schema.js +41 -27
- package/dist/src/entities/pipelines/schema.js.map +1 -1
- package/dist/src/entities/utils.d.ts +1 -0
- package/dist/src/entities/utils.js +2 -1
- package/dist/src/entities/utils.js.map +1 -1
- package/dist/src/entities/workitems/registry.js +240 -252
- package/dist/src/entities/workitems/registry.js.map +1 -1
- package/dist/src/entities/workitems/schema-readonly.d.ts +25 -1
- package/dist/src/entities/workitems/schema-readonly.js +33 -6
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
- package/dist/src/entities/workitems/schema.d.ts +35 -0
- package/dist/src/entities/workitems/schema.js +32 -1
- package/dist/src/entities/workitems/schema.js.map +1 -1
- package/dist/structured-world-gitlab-mcp-6.2.1.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/structured-world-gitlab-mcp-6.1.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -464,6 +464,7 @@ When OAuth is enabled, the following endpoints are available:
|
|
|
464
464
|
- `USE_MRS`: When set to 'true', enables the merge request-related tools (browse_merge_requests, browse_mr_discussions, manage_merge_request, manage_mr_discussion, manage_draft_notes). These 5 CQRS tools consolidate all MR operations. By default, merge request features are enabled.
|
|
465
465
|
- `USE_FILES`: When set to 'true', enables the file-related tools (browse_files, manage_files). These 2 CQRS tools consolidate all file operations. By default, file operation features are enabled.
|
|
466
466
|
- `USE_VARIABLES`: When set to 'true', enables the CI/CD variables-related tools (list_variables, get_variable, create_variable, update_variable, delete_variable). Supports both project-level and group-level variables. By default, variables features are enabled.
|
|
467
|
+
- `USE_WORKITEMS`: When set to 'true', enables the work items-related tools (browse_work_items, manage_work_item). These 2 CQRS tools consolidate all work item operations using GitLab GraphQL API. By default, work items features are enabled.
|
|
467
468
|
- `GITLAB_AUTH_COOKIE_PATH`: Path to an authentication cookie file for GitLab instances that require cookie-based authentication. When provided, the cookie will be included in all GitLab API requests.
|
|
468
469
|
- `SKIP_TLS_VERIFY`: When set to 'true', skips TLS certificate verification for all GitLab API requests (both REST and GraphQL). **WARNING**: This bypasses SSL certificate validation and should only be used for testing with self-signed certificates or trusted internal GitLab instances. Never use this in production environments.
|
|
469
470
|
- `SSL_CERT_PATH`: Path to PEM certificate file for direct HTTPS/TLS termination. Requires `SSL_KEY_PATH` to also be set.
|
|
@@ -502,7 +503,7 @@ export GITLAB_TOOL_GET_FILE_CONTENTS="Read source code files from the repository
|
|
|
502
503
|
# Multiple customizations
|
|
503
504
|
export GITLAB_TOOL_LIST_PROJECTS="List user projects"
|
|
504
505
|
export GITLAB_TOOL_GET_PROJECT="Get project details including settings"
|
|
505
|
-
export
|
|
506
|
+
export GITLAB_TOOL_MANAGE_WORK_ITEM="Create and manage tickets for our sprint planning"
|
|
506
507
|
```
|
|
507
508
|
|
|
508
509
|
#### Usage in Configuration Files
|
|
@@ -532,11 +533,11 @@ export GITLAB_TOOL_CREATE_WORK_ITEM="Create tickets for our sprint planning"
|
|
|
532
533
|
- **Case Sensitivity**: Tool names in environment variables must be UPPERCASE (e.g., `LIST_PROJECTS` not `list_projects`)
|
|
533
534
|
- **Invalid Names**: Invalid tool names in environment variables are ignored with a warning in debug logs
|
|
534
535
|
- **Content Guidelines**: Descriptions can be any valid string but should be kept concise for better UX
|
|
535
|
-
- **Scope**: Works with all
|
|
536
|
+
- **Scope**: Works with all 58 available tools across all entities (Core, Work Items, Merge Requests, Files, etc.)
|
|
536
537
|
|
|
537
538
|
## Tools 🛠️
|
|
538
539
|
|
|
539
|
-
**
|
|
540
|
+
**58 Tools Available** - Organized by entity and functionality below.
|
|
540
541
|
|
|
541
542
|
### Key Features:
|
|
542
543
|
- **CQRS Pattern** - Consolidated action-based tools: `browse_*` for reads, `manage_*` for writes
|
|
@@ -617,14 +618,14 @@ Requires USE_VARIABLES=true environment variable (enabled by default). Supports
|
|
|
617
618
|
- ✏️ **`update_variable`**: Update an existing CI/CD variable's value, security settings, or configuration in a project or group
|
|
618
619
|
- ✏️ **`delete_variable`**: Remove a CI/CD variable from a project or group
|
|
619
620
|
|
|
620
|
-
### Work Items (
|
|
621
|
-
Modern GraphQL API for issues, epics, tasks, and more. Requires USE_WORKITEMS=true (enabled by default).
|
|
621
|
+
### Work Items (2 CQRS tools)
|
|
622
|
+
Modern GraphQL API for issues, epics, tasks, and more. Requires USE_WORKITEMS=true (enabled by default). Uses CQRS pattern with action-based tools.
|
|
622
623
|
|
|
623
|
-
|
|
624
|
-
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
-
|
|
624
|
+
#### Work Item Browsing (Query)
|
|
625
|
+
- 📖 **`browse_work_items`**: BROWSE work items. Actions: "list" shows work items with filtering (groups return epics, projects return issues/tasks), "get" retrieves single work item by ID with full widget details.
|
|
626
|
+
|
|
627
|
+
#### Work Item Management (Command)
|
|
628
|
+
- ✏️ **`manage_work_item`**: MANAGE work items. Actions: "create" creates new work item (Epics need GROUP namespace, Issues/Tasks need PROJECT), "update" modifies properties/widgets, "delete" permanently removes.
|
|
628
629
|
|
|
629
630
|
### Wiki Management (5 tools)
|
|
630
631
|
Requires USE_GITLAB_WIKI=true environment variable. Supports both project-level and group-level wikis.
|
|
@@ -775,9 +776,9 @@ For rapid testing of individual MCP tools:
|
|
|
775
776
|
|
|
776
777
|
```bash
|
|
777
778
|
# Test specific tools directly
|
|
778
|
-
./scripts/test_mcp.sh '{"name": "
|
|
779
|
-
./scripts/test_mcp.sh '{"name": "
|
|
780
|
-
./scripts/test_mcp.sh '{"name": "
|
|
779
|
+
./scripts/test_mcp.sh '{"name": "browse_work_items", "arguments": {"action": "list", "namespace": "test"}}'
|
|
780
|
+
./scripts/test_mcp.sh '{"name": "browse_work_items", "arguments": {"action": "get", "id": "gid://gitlab/WorkItem/123"}}'
|
|
781
|
+
./scripts/test_mcp.sh '{"name": "manage_work_item", "arguments": {"action": "create", "namespace": "test", "workItemType": "EPIC", "title": "Test Epic"}}'
|
|
781
782
|
```
|
|
782
783
|
|
|
783
784
|
The `test_mcp.sh` script automatically:
|
|
@@ -46,267 +46,219 @@ const fetch_1 = require("../../utils/fetch");
|
|
|
46
46
|
const logger_1 = require("../../logger");
|
|
47
47
|
exports.pipelinesToolRegistry = new Map([
|
|
48
48
|
[
|
|
49
|
-
"
|
|
49
|
+
"browse_pipelines",
|
|
50
50
|
{
|
|
51
|
-
name: "
|
|
52
|
-
description:
|
|
53
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.
|
|
51
|
+
name: "browse_pipelines",
|
|
52
|
+
description: 'BROWSE pipelines. Actions: "list" searches pipelines with filtering, "get" retrieves single pipeline details, "jobs" lists jobs in pipeline, "triggers" lists bridge/trigger jobs, "job" gets single job details, "logs" fetches job console output.',
|
|
53
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowsePipelinesSchema),
|
|
54
54
|
handler: async (args) => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
[
|
|
63
|
-
"get_pipeline",
|
|
64
|
-
{
|
|
65
|
-
name: "get_pipeline",
|
|
66
|
-
description: "ANALYZE: Get comprehensive details about a specific pipeline run. Use when: Debugging CI/CD failures and issues, Inspecting pipeline configuration and timing, Understanding what triggered the run. Returns commit details, branch/tag info, duration metrics, and failure reasons. Essential for pipeline troubleshooting.",
|
|
67
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetPipelineSchema),
|
|
68
|
-
handler: async (args) => {
|
|
69
|
-
const options = schema_readonly_1.GetPipelineSchema.parse(args);
|
|
70
|
-
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(options.project_id)}/pipelines/${options.pipeline_id}`);
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
[
|
|
75
|
-
"list_pipeline_jobs",
|
|
76
|
-
{
|
|
77
|
-
name: "list_pipeline_jobs",
|
|
78
|
-
description: "INSPECT: Get all CI/CD jobs within a pipeline run. Use when: Identifying failed jobs and stages, Understanding pipeline job structure, Analyzing job timing and performance. Returns job names, stages, status, duration, and runner info. Supports filtering by scope (failed, success, manual) for targeted troubleshooting.",
|
|
79
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.ListPipelineJobsSchema),
|
|
80
|
-
handler: async (args) => {
|
|
81
|
-
const options = schema_readonly_1.ListPipelineJobsSchema.parse(args);
|
|
82
|
-
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(options.project_id)}/pipelines/${options.pipeline_id}/jobs`, { query: (0, gitlab_api_1.toQuery)(options, ["project_id", "pipeline_id"]) });
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
[
|
|
87
|
-
"list_pipeline_trigger_jobs",
|
|
88
|
-
{
|
|
89
|
-
name: "list_pipeline_trigger_jobs",
|
|
90
|
-
description: "BRIDGE: List jobs that trigger downstream pipelines in multi-project setups. Use when: Understanding cross-project CI/CD flows, Debugging pipeline dependencies, Analyzing parent-child pipeline connections. Bridge jobs link projects together. Returns trigger configuration and downstream pipeline status.",
|
|
91
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.ListPipelineTriggerJobsSchema),
|
|
92
|
-
handler: async (args) => {
|
|
93
|
-
const options = schema_readonly_1.ListPipelineTriggerJobsSchema.parse(args);
|
|
94
|
-
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(options.project_id)}/pipelines/${options.pipeline_id}/bridges`, { query: (0, gitlab_api_1.toQuery)(options, ["project_id", "pipeline_id"]) });
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
"get_pipeline_job",
|
|
100
|
-
{
|
|
101
|
-
name: "get_pipeline_job",
|
|
102
|
-
description: "DETAILS: Get detailed information about a specific CI/CD job. Use when: Debugging individual job failures, Inspecting job configuration and variables, Understanding job dependencies and artifacts. Shows job script, runner tags, artifact paths, and failure details. Essential for job-level troubleshooting.",
|
|
103
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetPipelineJobOutputSchema),
|
|
104
|
-
handler: async (args) => {
|
|
105
|
-
const options = schema_readonly_1.GetPipelineJobOutputSchema.parse(args);
|
|
106
|
-
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(options.project_id)}/jobs/${options.job_id}`);
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
[
|
|
111
|
-
"get_pipeline_job_output",
|
|
112
|
-
{
|
|
113
|
-
name: "get_pipeline_job_output",
|
|
114
|
-
description: "LOGS: Fetch console output/logs from a CI/CD job execution. Use when: Debugging job failures and errors, Reviewing test results and build output, Analyzing command execution traces. Supports output limiting for large logs. Returns raw text showing all commands and output. Critical for troubleshooting CI/CD issues.",
|
|
115
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetPipelineJobOutputSchema),
|
|
116
|
-
handler: async (args) => {
|
|
117
|
-
const options = schema_readonly_1.GetPipelineJobOutputSchema.parse(args);
|
|
118
|
-
const { project_id, job_id, limit, max_lines, start } = options;
|
|
119
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}/trace`;
|
|
120
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
121
|
-
if (!response.ok) {
|
|
122
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
123
|
-
}
|
|
124
|
-
let trace = await response.text();
|
|
125
|
-
const lines = trace.split("\n");
|
|
126
|
-
const totalLines = lines.length;
|
|
127
|
-
const defaultMaxLines = 200;
|
|
128
|
-
let processedLines = [];
|
|
129
|
-
let maxLinesToShow = defaultMaxLines;
|
|
130
|
-
if (max_lines !== undefined) {
|
|
131
|
-
maxLinesToShow = max_lines;
|
|
132
|
-
}
|
|
133
|
-
else if (limit !== undefined) {
|
|
134
|
-
maxLinesToShow = limit;
|
|
135
|
-
}
|
|
136
|
-
let outOfBoundsMessage = "";
|
|
137
|
-
if (start !== undefined && start < 0) {
|
|
138
|
-
processedLines = lines.slice(start);
|
|
139
|
-
if (processedLines.length > maxLinesToShow) {
|
|
140
|
-
processedLines = processedLines.slice(-maxLinesToShow);
|
|
55
|
+
const input = schema_readonly_1.BrowsePipelinesSchema.parse(args);
|
|
56
|
+
switch (input.action) {
|
|
57
|
+
case "list": {
|
|
58
|
+
const { project_id, action: _action, ...queryOptions } = input;
|
|
59
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipelines`, {
|
|
60
|
+
query: (0, gitlab_api_1.toQuery)(queryOptions, []),
|
|
61
|
+
});
|
|
141
62
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
63
|
+
case "get": {
|
|
64
|
+
const { project_id, pipeline_id } = input;
|
|
65
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipelines/${pipeline_id}`);
|
|
66
|
+
}
|
|
67
|
+
case "jobs": {
|
|
68
|
+
const { project_id, pipeline_id, action: _action, ...queryOptions } = input;
|
|
69
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipelines/${pipeline_id}/jobs`, { query: (0, gitlab_api_1.toQuery)(queryOptions, []) });
|
|
147
70
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
71
|
+
case "triggers": {
|
|
72
|
+
const { project_id, pipeline_id, action: _action, ...queryOptions } = input;
|
|
73
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipelines/${pipeline_id}/bridges`, { query: (0, gitlab_api_1.toQuery)(queryOptions, []) });
|
|
74
|
+
}
|
|
75
|
+
case "job": {
|
|
76
|
+
const { project_id, job_id } = input;
|
|
77
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}`);
|
|
78
|
+
}
|
|
79
|
+
case "logs": {
|
|
80
|
+
const { project_id, job_id, limit, max_lines, start } = input;
|
|
81
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}/trace`;
|
|
82
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
83
|
+
if (!response.ok) {
|
|
84
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
85
|
+
}
|
|
86
|
+
let trace = await response.text();
|
|
87
|
+
const lines = trace.split("\n");
|
|
88
|
+
const totalLines = lines.length;
|
|
89
|
+
const defaultMaxLines = 200;
|
|
90
|
+
let processedLines = [];
|
|
91
|
+
let maxLinesToShow = defaultMaxLines;
|
|
92
|
+
if (max_lines !== undefined) {
|
|
93
|
+
maxLinesToShow = max_lines;
|
|
94
|
+
}
|
|
95
|
+
else if (limit !== undefined) {
|
|
96
|
+
maxLinesToShow = limit;
|
|
97
|
+
}
|
|
98
|
+
let outOfBoundsMessage = "";
|
|
99
|
+
if (start !== undefined && start < 0) {
|
|
100
|
+
processedLines = lines.slice(start);
|
|
101
|
+
if (processedLines.length > maxLinesToShow) {
|
|
102
|
+
processedLines = processedLines.slice(-maxLinesToShow);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else if (start !== undefined && start >= 0) {
|
|
106
|
+
if (start >= totalLines) {
|
|
107
|
+
processedLines = [];
|
|
108
|
+
outOfBoundsMessage = `[OUT OF BOUNDS: Start position ${start} exceeds total lines ${totalLines}. Available range: 0-${totalLines - 1}]`;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
processedLines = lines.slice(start, start + maxLinesToShow);
|
|
112
|
+
if (start + maxLinesToShow > totalLines) {
|
|
113
|
+
const availableFromStart = totalLines - start;
|
|
114
|
+
outOfBoundsMessage = `[PARTIAL REQUEST: Requested ${maxLinesToShow} lines from position ${start}, but only ${availableFromStart} lines available]`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
processedLines = lines.slice(-maxLinesToShow);
|
|
153
120
|
}
|
|
121
|
+
const actualDataLines = processedLines.length;
|
|
122
|
+
if (outOfBoundsMessage) {
|
|
123
|
+
processedLines.unshift(outOfBoundsMessage);
|
|
124
|
+
}
|
|
125
|
+
if (processedLines.length < totalLines && !outOfBoundsMessage) {
|
|
126
|
+
const truncatedCount = totalLines - actualDataLines;
|
|
127
|
+
processedLines.unshift(`[LOG TRUNCATED: Showing last ${actualDataLines} of ${totalLines} lines - ${truncatedCount} lines hidden]`);
|
|
128
|
+
}
|
|
129
|
+
trace = processedLines.join("\n");
|
|
130
|
+
return { trace, totalLines, shownLines: actualDataLines };
|
|
131
|
+
}
|
|
132
|
+
default: {
|
|
133
|
+
const _exhaustive = input;
|
|
134
|
+
throw new Error(`Unknown action: ${_exhaustive.action}`);
|
|
154
135
|
}
|
|
155
136
|
}
|
|
156
|
-
else {
|
|
157
|
-
processedLines = lines.slice(-maxLinesToShow);
|
|
158
|
-
}
|
|
159
|
-
const actualDataLines = processedLines.length;
|
|
160
|
-
if (outOfBoundsMessage) {
|
|
161
|
-
processedLines.unshift(outOfBoundsMessage);
|
|
162
|
-
}
|
|
163
|
-
if (processedLines.length < totalLines && !outOfBoundsMessage) {
|
|
164
|
-
const truncatedCount = totalLines - actualDataLines;
|
|
165
|
-
processedLines.unshift(`[LOG TRUNCATED: Showing last ${actualDataLines} of ${totalLines} lines - ${truncatedCount} lines hidden]`);
|
|
166
|
-
}
|
|
167
|
-
trace = processedLines.join("\n");
|
|
168
|
-
return { trace, totalLines, shownLines: actualDataLines };
|
|
169
137
|
},
|
|
170
138
|
},
|
|
171
139
|
],
|
|
172
140
|
[
|
|
173
|
-
"
|
|
141
|
+
"manage_pipeline",
|
|
174
142
|
{
|
|
175
|
-
name: "
|
|
176
|
-
description:
|
|
177
|
-
inputSchema: z.toJSONSchema(schema_1.
|
|
143
|
+
name: "manage_pipeline",
|
|
144
|
+
description: 'MANAGE pipelines. Actions: "create" triggers new pipeline on branch/tag with optional variables, "retry" re-runs failed/canceled pipeline, "cancel" stops running pipeline.',
|
|
145
|
+
inputSchema: z.toJSONSchema(schema_1.ManagePipelineSchema),
|
|
178
146
|
handler: async (args) => {
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const errorDetails = [];
|
|
203
|
-
const messageObj = errorBody.message;
|
|
204
|
-
Object.keys(messageObj).forEach(key => {
|
|
205
|
-
const value = messageObj[key];
|
|
206
|
-
if (Array.isArray(value)) {
|
|
207
|
-
errorDetails.push(`${key}: ${value.join(", ")}`);
|
|
147
|
+
const input = schema_1.ManagePipelineSchema.parse(args);
|
|
148
|
+
switch (input.action) {
|
|
149
|
+
case "create": {
|
|
150
|
+
const { project_id, ref, variables } = input;
|
|
151
|
+
const queryParams = new URLSearchParams();
|
|
152
|
+
queryParams.set("ref", ref);
|
|
153
|
+
const body = {};
|
|
154
|
+
if (variables && variables.length > 0) {
|
|
155
|
+
body.variables = variables;
|
|
156
|
+
}
|
|
157
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipeline?${queryParams}`;
|
|
158
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
159
|
+
method: "POST",
|
|
160
|
+
headers: { "Content-Type": "application/json" },
|
|
161
|
+
body: JSON.stringify(body),
|
|
162
|
+
});
|
|
163
|
+
if (!response.ok) {
|
|
164
|
+
let errorMessage = `GitLab API error: ${response.status} ${response.statusText}`;
|
|
165
|
+
try {
|
|
166
|
+
const errorBody = (await response.json());
|
|
167
|
+
if (errorBody.message) {
|
|
168
|
+
if (typeof errorBody.message === "string") {
|
|
169
|
+
errorMessage += ` - ${errorBody.message}`;
|
|
208
170
|
}
|
|
209
|
-
else {
|
|
210
|
-
errorDetails
|
|
171
|
+
else if (typeof errorBody.message === "object" && errorBody.message !== null) {
|
|
172
|
+
const errorDetails = [];
|
|
173
|
+
const messageObj = errorBody.message;
|
|
174
|
+
Object.keys(messageObj).forEach(key => {
|
|
175
|
+
const value = messageObj[key];
|
|
176
|
+
if (Array.isArray(value)) {
|
|
177
|
+
errorDetails.push(`${key}: ${value.join(", ")}`);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
errorDetails.push(`${key}: ${String(value)}`);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
if (errorDetails.length > 0) {
|
|
184
|
+
errorMessage += ` - ${errorDetails.join("; ")}`;
|
|
185
|
+
}
|
|
211
186
|
}
|
|
212
|
-
});
|
|
213
|
-
if (errorDetails.length > 0) {
|
|
214
|
-
errorMessage += ` - ${errorDetails.join("; ")}`;
|
|
215
187
|
}
|
|
188
|
+
if (typeof errorBody.error === "string") {
|
|
189
|
+
errorMessage += ` - ${errorBody.error}`;
|
|
190
|
+
}
|
|
191
|
+
if (Array.isArray(errorBody.errors)) {
|
|
192
|
+
errorMessage += ` - ${errorBody.errors.map(e => String(e)).join(", ")}`;
|
|
193
|
+
}
|
|
194
|
+
logger_1.logger.error({ status: response.status, errorBody, url: apiUrl }, "manage_pipeline create failed");
|
|
216
195
|
}
|
|
196
|
+
catch {
|
|
197
|
+
logger_1.logger.error({ status: response.status, url: apiUrl }, "manage_pipeline create failed (could not parse error)");
|
|
198
|
+
}
|
|
199
|
+
throw new Error(errorMessage);
|
|
217
200
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
logger_1.logger.error({ status: response.status, errorBody, url: apiUrl }, "create_pipeline failed");
|
|
201
|
+
const pipeline = (await response.json());
|
|
202
|
+
return pipeline;
|
|
203
|
+
}
|
|
204
|
+
case "retry": {
|
|
205
|
+
const { project_id, pipeline_id } = input;
|
|
206
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipelines/${pipeline_id}/retry`);
|
|
225
207
|
}
|
|
226
|
-
|
|
227
|
-
|
|
208
|
+
case "cancel": {
|
|
209
|
+
const { project_id, pipeline_id } = input;
|
|
210
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/pipelines/${pipeline_id}/cancel`);
|
|
211
|
+
}
|
|
212
|
+
default: {
|
|
213
|
+
const _exhaustive = input;
|
|
214
|
+
throw new Error(`Unknown action: ${_exhaustive.action}`);
|
|
228
215
|
}
|
|
229
|
-
throw new Error(errorMessage);
|
|
230
216
|
}
|
|
231
|
-
const pipeline = (await response.json());
|
|
232
|
-
return pipeline;
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
],
|
|
236
|
-
[
|
|
237
|
-
"retry_pipeline",
|
|
238
|
-
{
|
|
239
|
-
name: "retry_pipeline",
|
|
240
|
-
description: "RETRY: Re-run a previously failed or canceled pipeline with same configuration. Use when: Retrying after fixing flaky tests, Recovering from temporary failures, Re-running without losing successful job results. Retries failed/canceled jobs while preserving successful ones. More efficient than creating new pipeline.",
|
|
241
|
-
inputSchema: z.toJSONSchema(schema_1.RetryPipelineSchema),
|
|
242
|
-
handler: async (args) => {
|
|
243
|
-
const options = schema_1.RetryPipelineSchema.parse(args);
|
|
244
|
-
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(options.project_id)}/pipelines/${options.pipeline_id}/retry`);
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
[
|
|
249
|
-
"cancel_pipeline",
|
|
250
|
-
{
|
|
251
|
-
name: "cancel_pipeline",
|
|
252
|
-
description: 'CANCEL: Stop a currently executing pipeline and all its jobs. Use when: Halting unnecessary or incorrect runs, Stopping problematic deployments, Freeing up busy runners. Cancels all pending and running jobs immediately. Pipeline status changes to "canceled" and cannot be resumed.',
|
|
253
|
-
inputSchema: z.toJSONSchema(schema_1.CancelPipelineSchema),
|
|
254
|
-
handler: async (args) => {
|
|
255
|
-
const options = schema_1.CancelPipelineSchema.parse(args);
|
|
256
|
-
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(options.project_id)}/pipelines/${options.pipeline_id}/cancel`);
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
],
|
|
260
|
-
[
|
|
261
|
-
"play_pipeline_job",
|
|
262
|
-
{
|
|
263
|
-
name: "play_pipeline_job",
|
|
264
|
-
description: "PLAY: Trigger a manual job that requires user intervention. Use when: Executing deployment gates and approvals, Running optional or conditional jobs, Proceeding with manual pipeline steps. Manual jobs pause pipeline flow until explicitly triggered. Can pass job variables for runtime configuration.",
|
|
265
|
-
inputSchema: z.toJSONSchema(schema_1.PlayPipelineJobSchema),
|
|
266
|
-
handler: async (args) => {
|
|
267
|
-
const options = schema_1.PlayPipelineJobSchema.parse(args);
|
|
268
|
-
const { project_id, job_id, ...body } = options;
|
|
269
|
-
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}/play`, {
|
|
270
|
-
body,
|
|
271
|
-
contentType: "json",
|
|
272
|
-
});
|
|
273
217
|
},
|
|
274
218
|
},
|
|
275
219
|
],
|
|
276
220
|
[
|
|
277
|
-
"
|
|
221
|
+
"manage_pipeline_job",
|
|
278
222
|
{
|
|
279
|
-
name: "
|
|
280
|
-
description:
|
|
281
|
-
inputSchema: z.toJSONSchema(schema_1.
|
|
223
|
+
name: "manage_pipeline_job",
|
|
224
|
+
description: 'MANAGE pipeline jobs. Actions: "play" triggers manual job with optional variables, "retry" re-runs failed/canceled job, "cancel" stops running job.',
|
|
225
|
+
inputSchema: z.toJSONSchema(schema_1.ManagePipelineJobSchema),
|
|
282
226
|
handler: async (args) => {
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
227
|
+
const input = schema_1.ManagePipelineJobSchema.parse(args);
|
|
228
|
+
switch (input.action) {
|
|
229
|
+
case "play": {
|
|
230
|
+
const { project_id, job_id, job_variables_attributes } = input;
|
|
231
|
+
const body = {};
|
|
232
|
+
if (job_variables_attributes) {
|
|
233
|
+
body.job_variables_attributes = job_variables_attributes;
|
|
234
|
+
}
|
|
235
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}/play`, {
|
|
236
|
+
body,
|
|
237
|
+
contentType: "json",
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
case "retry": {
|
|
241
|
+
const { project_id, job_id } = input;
|
|
242
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}/retry`);
|
|
243
|
+
}
|
|
244
|
+
case "cancel": {
|
|
245
|
+
const { project_id, job_id, force } = input;
|
|
246
|
+
const query = force ? { force: "true" } : undefined;
|
|
247
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/jobs/${job_id}/cancel`, {
|
|
248
|
+
query,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
default: {
|
|
252
|
+
const _exhaustive = input;
|
|
253
|
+
throw new Error(`Unknown action: ${_exhaustive.action}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
297
256
|
},
|
|
298
257
|
},
|
|
299
258
|
],
|
|
300
259
|
]);
|
|
301
260
|
function getPipelinesReadOnlyToolNames() {
|
|
302
|
-
return [
|
|
303
|
-
"list_pipelines",
|
|
304
|
-
"get_pipeline",
|
|
305
|
-
"list_pipeline_jobs",
|
|
306
|
-
"list_pipeline_trigger_jobs",
|
|
307
|
-
"get_pipeline_job",
|
|
308
|
-
"get_pipeline_job_output",
|
|
309
|
-
];
|
|
261
|
+
return ["browse_pipelines"];
|
|
310
262
|
}
|
|
311
263
|
function getPipelinesToolDefinitions() {
|
|
312
264
|
return Array.from(exports.pipelinesToolRegistry.values());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/pipelines/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/pipelines/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgTA,sEAEC;AAED,kEAEC;AAED,8DAQC;AAhUD,uCAAyB;AACzB,uDAAgF;AAChF,qCAKkB;AAClB,uDAAyD;AACzD,qEAAmE;AACnE,6CAAkD;AAClD,yCAAsC;AAUzB,QAAA,qBAAqB,GAAiB,IAAI,GAAG,CAAiC;IAIzF;QACE,kBAAkB;QAClB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