@structured-world/gitlab-mcp 6.4.1 → 6.5.0
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 +33 -2
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.js +2 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/entities/core/schema-readonly.d.ts +2 -2
- package/dist/src/entities/index.d.ts +1 -0
- package/dist/src/entities/index.js +1 -0
- package/dist/src/entities/index.js.map +1 -1
- package/dist/src/entities/labels/registry.js +57 -68
- package/dist/src/entities/labels/registry.js.map +1 -1
- package/dist/src/entities/labels/schema-readonly.d.ts +10 -9
- package/dist/src/entities/labels/schema-readonly.js +19 -11
- package/dist/src/entities/labels/schema-readonly.js.map +1 -1
- package/dist/src/entities/labels/schema.d.ts +9 -16
- package/dist/src/entities/labels/schema.js +24 -22
- package/dist/src/entities/labels/schema.js.map +1 -1
- package/dist/src/entities/utils.d.ts +5 -0
- package/dist/src/entities/utils.js +10 -0
- package/dist/src/entities/utils.js.map +1 -1
- package/dist/src/entities/webhooks/index.d.ts +7 -0
- package/dist/src/entities/webhooks/index.js +31 -0
- package/dist/src/entities/webhooks/index.js.map +1 -0
- package/dist/src/entities/webhooks/registry.d.ts +5 -0
- package/dist/src/entities/webhooks/registry.js +158 -0
- package/dist/src/entities/webhooks/registry.js.map +1 -0
- package/dist/src/entities/webhooks/schema-readonly.d.ts +12 -0
- package/dist/src/entities/webhooks/schema-readonly.js +17 -0
- package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
- package/dist/src/entities/webhooks/schema.d.ts +57 -0
- package/dist/src/entities/webhooks/schema.js +100 -0
- package/dist/src/entities/webhooks/schema.js.map +1 -0
- package/dist/src/registry-manager.js +10 -0
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/services/ToolAvailability.js +6 -0
- package/dist/src/services/ToolAvailability.js.map +1 -1
- package/dist/structured-world-gitlab-mcp-6.5.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/structured-world-gitlab-mcp-6.4.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@ env = { "GITLAB_TOKEN" = "mytoken", "GITLAB_API_URL" = "https://gitlab.com" }
|
|
|
53
53
|
"USE_MILESTONE": "false", // use milestone api?
|
|
54
54
|
"USE_PIPELINE": "false", // use pipeline api?
|
|
55
55
|
"USE_VARIABLES": "true", // use variables api?
|
|
56
|
+
"USE_WEBHOOKS": "true", // use webhooks api?
|
|
56
57
|
"SKIP_TLS_VERIFY": "false" // skip SSL cert verification (dev only)
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -120,6 +121,8 @@ env = { "GITLAB_TOKEN" = "mytoken", "GITLAB_API_URL" = "https://gitlab.com" }
|
|
|
120
121
|
"USE_PIPELINE",
|
|
121
122
|
"-e",
|
|
122
123
|
"USE_VARIABLES",
|
|
124
|
+
"-e",
|
|
125
|
+
"USE_WEBHOOKS",
|
|
123
126
|
"ghcr.io/structured-world/gitlab-mcp:latest"
|
|
124
127
|
],
|
|
125
128
|
"env": {
|
|
@@ -129,7 +132,8 @@ env = { "GITLAB_TOKEN" = "mytoken", "GITLAB_API_URL" = "https://gitlab.com" }
|
|
|
129
132
|
"USE_GITLAB_WIKI": "true",
|
|
130
133
|
"USE_MILESTONE": "true",
|
|
131
134
|
"USE_PIPELINE": "true",
|
|
132
|
-
"USE_VARIABLES": "true"
|
|
135
|
+
"USE_VARIABLES": "true",
|
|
136
|
+
"USE_WEBHOOKS": "true"
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
}
|
|
@@ -465,6 +469,7 @@ When OAuth is enabled, the following endpoints are available:
|
|
|
465
469
|
- `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
470
|
- `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
471
|
- `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.
|
|
472
|
+
- `USE_WEBHOOKS`: When set to 'true', enables the webhooks-related tools (list_webhooks, manage_webhook). These 2 tools provide full CRUD operations plus testing for both project and group webhooks. Group webhooks require GitLab Premium tier. By default, webhooks features are enabled.
|
|
468
473
|
- `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.
|
|
469
474
|
- `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.
|
|
470
475
|
- `SSL_CERT_PATH`: Path to PEM certificate file for direct HTTPS/TLS termination. Requires `SSL_KEY_PATH` to also be set.
|
|
@@ -537,7 +542,7 @@ export GITLAB_TOOL_MANAGE_WORK_ITEM="Create and manage tickets for our sprint pl
|
|
|
537
542
|
|
|
538
543
|
## Tools 🛠️
|
|
539
544
|
|
|
540
|
-
**
|
|
545
|
+
**60 Tools Available** - Organized by entity and functionality below.
|
|
541
546
|
|
|
542
547
|
### Key Features:
|
|
543
548
|
- **CQRS Pattern** - Consolidated action-based tools: `browse_*` for reads, `manage_*` for writes
|
|
@@ -665,6 +670,32 @@ Requires USE_PIPELINE=true environment variable.
|
|
|
665
670
|
- 📖 **`list_pipeline_jobs`**: List all jobs in a specific pipeline
|
|
666
671
|
- 📖 **`list_pipeline_trigger_jobs`**: List all trigger jobs (bridges) in a specific pipeline that trigger downstream pipelines
|
|
667
672
|
|
|
673
|
+
### Webhooks Management (2 tools)
|
|
674
|
+
Requires USE_WEBHOOKS=true environment variable (enabled by default). Supports both project and group webhooks. Group webhooks require GitLab Premium tier.
|
|
675
|
+
|
|
676
|
+
- 📖 **`list_webhooks`**: List all webhooks configured for a project or group. Shows webhook URLs, enabled event types, SSL settings, and delivery status. Group webhooks (Premium tier) are inherited by all child projects.
|
|
677
|
+
- ✏️ **`manage_webhook`**: Manage webhooks with full CRUD operations plus testing. Actions: "create" (add new webhook with URL and event types), "read" (get webhook details), "update" (modify URL, events, or settings), "delete" (remove webhook), "test" (trigger test delivery for specific event type). Test action sends actual HTTP request to configured URL. In read-only mode, only "read" action is allowed.
|
|
678
|
+
|
|
679
|
+
#### Supported Event Types
|
|
680
|
+
Webhooks can be configured to trigger on:
|
|
681
|
+
- **Push events** - Push to repository (with optional branch filter)
|
|
682
|
+
- **Tag push events** - New tag pushed
|
|
683
|
+
- **Merge request events** - MR created, updated, merged
|
|
684
|
+
- **Issue events** - Issue created, updated, closed (including confidential)
|
|
685
|
+
- **Note events** - Comments on issues, MRs, snippets (including confidential)
|
|
686
|
+
- **Pipeline events** - Pipeline status changes
|
|
687
|
+
- **Job events** - Build/job status changes
|
|
688
|
+
- **Wiki page events** - Wiki page created or updated
|
|
689
|
+
- **Deployment events** - Deployment triggered
|
|
690
|
+
- **Release events** - Release created
|
|
691
|
+
- **Milestone events** - Milestone created, updated, closed
|
|
692
|
+
- **Emoji events** - Emoji reactions added
|
|
693
|
+
- **Feature flag events** - Feature flag changes
|
|
694
|
+
- **Resource access token events** - Token created/revoked
|
|
695
|
+
- **Member events** - Member added/removed
|
|
696
|
+
- **Subgroup events** - Subgroup created/removed (group webhooks only)
|
|
697
|
+
- **Project events** - Project created/removed (group webhooks only)
|
|
698
|
+
|
|
668
699
|
## CLI Tools 🔧
|
|
669
700
|
|
|
670
701
|
### list-tools - Browse Available Tools
|
package/dist/src/config.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const USE_LABELS: boolean;
|
|
|
11
11
|
export declare const USE_MRS: boolean;
|
|
12
12
|
export declare const USE_FILES: boolean;
|
|
13
13
|
export declare const USE_VARIABLES: boolean;
|
|
14
|
+
export declare const USE_WEBHOOKS: boolean;
|
|
14
15
|
export declare const HOST: string;
|
|
15
16
|
export declare const PORT: string | number;
|
|
16
17
|
export declare const SSL_CERT_PATH: string | undefined;
|
package/dist/src/config.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.packageVersion = exports.packageName = exports.GITLAB_ALLOWED_PROJECT_IDS = exports.GITLAB_PROJECT_ID = exports.GITLAB_API_URL = exports.GITLAB_BASE_URL = exports.GITLAB_CA_CERT_PATH = exports.NODE_TLS_REJECT_UNAUTHORIZED = exports.HTTPS_PROXY = exports.HTTP_PROXY = exports.SKIP_TLS_VERIFY = exports.RATE_LIMIT_SESSION_MAX_REQUESTS = exports.RATE_LIMIT_SESSION_WINDOW_MS = exports.RATE_LIMIT_SESSION_ENABLED = exports.RATE_LIMIT_IP_MAX_REQUESTS = exports.RATE_LIMIT_IP_WINDOW_MS = exports.RATE_LIMIT_IP_ENABLED = exports.API_TIMEOUT_MS = exports.TRUST_PROXY = exports.SSL_PASSPHRASE = exports.SSL_CA_PATH = exports.SSL_KEY_PATH = exports.SSL_CERT_PATH = exports.PORT = exports.HOST = exports.USE_VARIABLES = exports.USE_FILES = exports.USE_MRS = exports.USE_LABELS = exports.USE_WORKITEMS = exports.USE_PIPELINE = exports.USE_MILESTONE = exports.USE_GITLAB_WIKI = exports.GITLAB_DENIED_TOOLS_REGEX = exports.GITLAB_READ_ONLY_MODE = exports.IS_OLD = exports.GITLAB_AUTH_COOKIE_PATH = exports.GITLAB_TOKEN = void 0;
|
|
36
|
+
exports.packageVersion = exports.packageName = exports.GITLAB_ALLOWED_PROJECT_IDS = exports.GITLAB_PROJECT_ID = exports.GITLAB_API_URL = exports.GITLAB_BASE_URL = exports.GITLAB_CA_CERT_PATH = exports.NODE_TLS_REJECT_UNAUTHORIZED = exports.HTTPS_PROXY = exports.HTTP_PROXY = exports.SKIP_TLS_VERIFY = exports.RATE_LIMIT_SESSION_MAX_REQUESTS = exports.RATE_LIMIT_SESSION_WINDOW_MS = exports.RATE_LIMIT_SESSION_ENABLED = exports.RATE_LIMIT_IP_MAX_REQUESTS = exports.RATE_LIMIT_IP_WINDOW_MS = exports.RATE_LIMIT_IP_ENABLED = exports.API_TIMEOUT_MS = exports.TRUST_PROXY = exports.SSL_PASSPHRASE = exports.SSL_CA_PATH = exports.SSL_KEY_PATH = exports.SSL_CERT_PATH = exports.PORT = exports.HOST = exports.USE_WEBHOOKS = exports.USE_VARIABLES = exports.USE_FILES = exports.USE_MRS = exports.USE_LABELS = exports.USE_WORKITEMS = exports.USE_PIPELINE = exports.USE_MILESTONE = exports.USE_GITLAB_WIKI = exports.GITLAB_DENIED_TOOLS_REGEX = exports.GITLAB_READ_ONLY_MODE = exports.IS_OLD = exports.GITLAB_AUTH_COOKIE_PATH = exports.GITLAB_TOKEN = void 0;
|
|
37
37
|
exports.getEffectiveProjectId = getEffectiveProjectId;
|
|
38
38
|
exports.getToolDescriptionOverrides = getToolDescriptionOverrides;
|
|
39
39
|
const path = __importStar(require("path"));
|
|
@@ -54,6 +54,7 @@ exports.USE_LABELS = process.env.USE_LABELS !== "false";
|
|
|
54
54
|
exports.USE_MRS = process.env.USE_MRS !== "false";
|
|
55
55
|
exports.USE_FILES = process.env.USE_FILES !== "false";
|
|
56
56
|
exports.USE_VARIABLES = process.env.USE_VARIABLES !== "false";
|
|
57
|
+
exports.USE_WEBHOOKS = process.env.USE_WEBHOOKS !== "false";
|
|
57
58
|
exports.HOST = process.env.HOST ?? "0.0.0.0";
|
|
58
59
|
exports.PORT = process.env.PORT ?? 3002;
|
|
59
60
|
exports.SSL_CERT_PATH = process.env.SSL_CERT_PATH;
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":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,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -109,13 +109,13 @@ export declare const BrowseCommitsSchema: z.ZodObject<{
|
|
|
109
109
|
}, z.core.$strip>;
|
|
110
110
|
export declare const BrowseEventsSchema: z.ZodObject<{
|
|
111
111
|
action: z.ZodEnum<{
|
|
112
|
-
user: "user";
|
|
113
112
|
project: "project";
|
|
113
|
+
user: "user";
|
|
114
114
|
}>;
|
|
115
115
|
target_type: z.ZodOptional<z.ZodEnum<{
|
|
116
116
|
milestone: "milestone";
|
|
117
|
-
user: "user";
|
|
118
117
|
project: "project";
|
|
118
|
+
user: "user";
|
|
119
119
|
issue: "issue";
|
|
120
120
|
merge_request: "merge_request";
|
|
121
121
|
note: "note";
|
|
@@ -24,4 +24,5 @@ __exportStar(require("./labels"), exports);
|
|
|
24
24
|
__exportStar(require("./mrs"), exports);
|
|
25
25
|
__exportStar(require("./files"), exports);
|
|
26
26
|
__exportStar(require("./variables"), exports);
|
|
27
|
+
__exportStar(require("./webhooks"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AACxB,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AACxB,8CAA4B;AAC5B,6CAA2B"}
|
|
@@ -42,89 +42,78 @@ const schema_readonly_1 = require("./schema-readonly");
|
|
|
42
42
|
const schema_1 = require("./schema");
|
|
43
43
|
const gitlab_api_1 = require("../../utils/gitlab-api");
|
|
44
44
|
const namespace_1 = require("../../utils/namespace");
|
|
45
|
+
const utils_1 = require("../utils");
|
|
45
46
|
exports.labelsToolRegistry = new Map([
|
|
46
47
|
[
|
|
47
|
-
"
|
|
48
|
+
"browse_labels",
|
|
48
49
|
{
|
|
49
|
-
name: "
|
|
50
|
-
description:
|
|
51
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.
|
|
50
|
+
name: "browse_labels",
|
|
51
|
+
description: 'BROWSE labels. Actions: "list" shows all labels in project/group with filtering, "get" retrieves single label details by ID or name.',
|
|
52
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseLabelsSchema),
|
|
52
53
|
handler: async (args) => {
|
|
53
|
-
const
|
|
54
|
-
const {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
const input = schema_readonly_1.BrowseLabelsSchema.parse(args);
|
|
55
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
56
|
+
switch (input.action) {
|
|
57
|
+
case "list": {
|
|
58
|
+
const { action: _action, namespace: _namespace, label_id: _labelId, ...rest } = input;
|
|
59
|
+
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
60
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/labels`, { query });
|
|
61
|
+
}
|
|
62
|
+
case "get": {
|
|
63
|
+
(0, utils_1.assertDefined)(input.label_id, "label_id");
|
|
64
|
+
const query = input.include_ancestor_groups
|
|
65
|
+
? (0, gitlab_api_1.toQuery)({ include_ancestor_groups: input.include_ancestor_groups }, [])
|
|
66
|
+
: undefined;
|
|
67
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/labels/${encodeURIComponent(input.label_id)}`, { query });
|
|
68
|
+
}
|
|
69
|
+
default:
|
|
70
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
71
|
+
}
|
|
59
72
|
},
|
|
60
73
|
},
|
|
61
74
|
],
|
|
62
75
|
[
|
|
63
|
-
"
|
|
76
|
+
"manage_label",
|
|
64
77
|
{
|
|
65
|
-
name: "
|
|
66
|
-
description:
|
|
67
|
-
inputSchema: z.toJSONSchema(
|
|
78
|
+
name: "manage_label",
|
|
79
|
+
description: 'MANAGE labels. Actions: "create" adds new label (requires name and color), "update" modifies existing label, "delete" removes label permanently.',
|
|
80
|
+
inputSchema: z.toJSONSchema(schema_1.ManageLabelSchema),
|
|
68
81
|
handler: async (args) => {
|
|
69
|
-
const
|
|
70
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(
|
|
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
|
-
name: "update_label",
|
|
99
|
-
description: "UPDATE: Modify label properties including name, color, description, or priority. Use when: Refining categorization system, Updating label appearance, Standardizing label naming. Changes apply immediately to all tagged items. Renaming updates all existing references automatically. See also: list_labels to understand current taxonomy before changes.",
|
|
100
|
-
inputSchema: z.toJSONSchema(schema_1.UpdateLabelSchema),
|
|
101
|
-
handler: async (args) => {
|
|
102
|
-
const options = schema_1.UpdateLabelSchema.parse(args);
|
|
103
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
|
|
104
|
-
const { namespace: _namespace, label_id, ...body } = options;
|
|
105
|
-
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`, {
|
|
106
|
-
body,
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
[
|
|
112
|
-
"delete_label",
|
|
113
|
-
{
|
|
114
|
-
name: "delete_label",
|
|
115
|
-
description: "DELETE: Remove a label permanently from project or group. Use when: Cleaning up unused labels, Reorganizing taxonomy. WARNING: Removes label from all issues and MRs without replacement. Consider updating items before deletion. Cannot be undone. See also: list_labels to check label usage before deletion.",
|
|
116
|
-
inputSchema: z.toJSONSchema(schema_1.DeleteLabelSchema),
|
|
117
|
-
handler: async (args) => {
|
|
118
|
-
const options = schema_1.DeleteLabelSchema.parse(args);
|
|
119
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
|
|
120
|
-
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/labels/${encodeURIComponent(options.label_id)}`);
|
|
121
|
-
return { success: true, message: "Label deleted successfully" };
|
|
82
|
+
const input = schema_1.ManageLabelSchema.parse(args);
|
|
83
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
84
|
+
switch (input.action) {
|
|
85
|
+
case "create": {
|
|
86
|
+
(0, utils_1.assertDefined)(input.name, "name");
|
|
87
|
+
(0, utils_1.assertDefined)(input.color, "color");
|
|
88
|
+
return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/labels`, {
|
|
89
|
+
body: {
|
|
90
|
+
name: input.name,
|
|
91
|
+
color: input.color,
|
|
92
|
+
description: input.description,
|
|
93
|
+
priority: input.priority,
|
|
94
|
+
},
|
|
95
|
+
contentType: "json",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
case "update": {
|
|
99
|
+
(0, utils_1.assertDefined)(input.label_id, "label_id");
|
|
100
|
+
const { action: _action, namespace: _namespace, label_id, name: _name, ...body } = input;
|
|
101
|
+
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`, { body, contentType: "json" });
|
|
102
|
+
}
|
|
103
|
+
case "delete": {
|
|
104
|
+
(0, utils_1.assertDefined)(input.label_id, "label_id");
|
|
105
|
+
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/labels/${encodeURIComponent(input.label_id)}`);
|
|
106
|
+
return { deleted: true };
|
|
107
|
+
}
|
|
108
|
+
default:
|
|
109
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
110
|
+
}
|
|
122
111
|
},
|
|
123
112
|
},
|
|
124
113
|
],
|
|
125
114
|
]);
|
|
126
115
|
function getLabelsReadOnlyToolNames() {
|
|
127
|
-
return ["
|
|
116
|
+
return ["browse_labels"];
|
|
128
117
|
}
|
|
129
118
|
function getLabelsToolDefinitions() {
|
|
130
119
|
return Array.from(exports.labelsToolRegistry.values());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/labels/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/labels/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,gEAEC;AAKD,4DAEC;AAKD,wDAQC;AAtJD,uCAAyB;AACzB,uDAAuD;AACvD,qCAA6C;AAC7C,uDAAyD;AACzD,qDAA+D;AAE/D,oCAAyC;AAQ5B,QAAA,kBAAkB,GAAiB,IAAI,GAAG,CAAiC;IAItF;QACE,eAAe;QACf;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EACT,sIAAsI;YACxI,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,oCAAkB,CAAC;YAC/C,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;gBAC/B,MAAM,KAAK,GAAG,oCAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC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QAAQ,EAAE,UAAU,CAAC,CAAC;wBAE1C,MAAM,mBAAM,CAAC,MAAM,CACjB,GAAG,UAAU,IAAI,WAAW,WAAW,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAC5E,CAAC;wBACF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oBAC3B,CAAC;oBAGD;wBACE,MAAM,IAAI,KAAK,CAAC,mBAAoB,KAA4B,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/E,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAKH,SAAgB,0BAA0B;IACxC,OAAO,CAAC,eAAe,CAAC,CAAC;AAC3B,CAAC;AAKD,SAAgB,wBAAwB;IACtC,OAAO,KAAK,CAAC,IAAI,CAAC,0BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;AACjD,CAAC;AAKD,SAAgB,sBAAsB,CAAC,eAAwB,KAAK;IAClE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC,IAAI,CAAC,0BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAC3D,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,wBAAwB,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BrowseLabelsSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
list: "list";
|
|
5
|
+
get: "get";
|
|
6
|
+
}>;
|
|
3
7
|
namespace: z.ZodString;
|
|
4
|
-
|
|
5
|
-
include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
8
|
+
label_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
|
|
6
9
|
search: z.ZodOptional<z.ZodString>;
|
|
7
|
-
|
|
8
|
-
export declare const GetLabelSchema: z.ZodObject<{
|
|
9
|
-
namespace: z.ZodString;
|
|
10
|
-
label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
|
|
10
|
+
with_counts: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
11
11
|
include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
12
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
12
14
|
}, z.core.$strip>;
|
|
13
|
-
export type
|
|
14
|
-
export type GetLabelOptions = z.infer<typeof GetLabelSchema>;
|
|
15
|
+
export type BrowseLabelsInput = z.infer<typeof BrowseLabelsSchema>;
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BrowseLabelsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.BrowseLabelsSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
action: zod_1.z.enum(["list", "get"]).describe("Action to perform"),
|
|
9
|
+
namespace: zod_1.z.string().describe("Namespace path (group or project)"),
|
|
10
|
+
label_id: utils_1.requiredId
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("The ID or title of the label. Required for 'get' action."),
|
|
13
|
+
search: zod_1.z.string().optional().describe("For 'list': keyword to filter labels by"),
|
|
8
14
|
with_counts: utils_1.flexibleBoolean
|
|
9
15
|
.optional()
|
|
10
|
-
.describe("
|
|
11
|
-
include_ancestor_groups: utils_1.flexibleBoolean
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
.describe("For 'list': include issue and merge request counts"),
|
|
17
|
+
include_ancestor_groups: utils_1.flexibleBoolean
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Include ancestor groups when listing or getting labels"),
|
|
20
|
+
per_page: zod_1.z.number().optional().describe("Number of items per page"),
|
|
21
|
+
page: zod_1.z.number().optional().describe("Page number"),
|
|
22
|
+
})
|
|
23
|
+
.refine(data => data.action !== "get" || data.label_id !== undefined, {
|
|
24
|
+
message: "label_id is required for 'get' action",
|
|
25
|
+
path: ["label_id"],
|
|
18
26
|
});
|
|
19
27
|
//# sourceMappingURL=schema-readonly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AAS1C,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,CAAC;IACN,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC7D,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAEnE,QAAQ,EAAE,kBAAU;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IAEvE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACjF,WAAW,EAAE,uBAAe;SACzB,QAAQ,EAAE;SACV,QAAQ,CAAC,oDAAoD,CAAC;IACjE,uBAAuB,EAAE,uBAAe;SACrC,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IAErE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACpE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;CACpD,CAAC;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;IACpE,OAAO,EAAE,uCAAuC;IAChD,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC,CAAC"}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ManageLabelSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
create: "create";
|
|
5
|
+
update: "update";
|
|
6
|
+
delete: "delete";
|
|
7
|
+
}>;
|
|
3
8
|
namespace: z.ZodString;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
description: z.ZodOptional<z.ZodString>;
|
|
7
|
-
priority: z.ZodOptional<z.ZodNumber>;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
export declare const UpdateLabelSchema: z.ZodObject<{
|
|
10
|
-
namespace: z.ZodString;
|
|
11
|
-
label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
|
|
9
|
+
label_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
11
|
new_name: z.ZodOptional<z.ZodString>;
|
|
13
12
|
color: z.ZodOptional<z.ZodString>;
|
|
14
13
|
description: z.ZodOptional<z.ZodString>;
|
|
15
14
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
16
15
|
}, z.core.$strip>;
|
|
17
|
-
export
|
|
18
|
-
namespace: z.ZodString;
|
|
19
|
-
label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
export type CreateLabelOptions = z.infer<typeof CreateLabelSchema>;
|
|
22
|
-
export type UpdateLabelOptions = z.infer<typeof UpdateLabelSchema>;
|
|
23
|
-
export type DeleteLabelOptions = z.infer<typeof DeleteLabelSchema>;
|
|
16
|
+
export type ManageLabelInput = z.infer<typeof ManageLabelSchema>;
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ManageLabelSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
description: zod_1.z.string().optional().describe("The description of the label"),
|
|
12
|
-
priority: zod_1.z
|
|
13
|
-
.number()
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
exports.ManageLabelSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
action: zod_1.z.enum(["create", "update", "delete"]).describe("Action to perform"),
|
|
9
|
+
namespace: zod_1.z.string().describe("Namespace path (group or project)"),
|
|
10
|
+
label_id: utils_1.requiredId
|
|
14
11
|
.optional()
|
|
15
|
-
.describe("The
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
namespace: zod_1.z.string().describe("Namespace path (group or project) containing the label"),
|
|
19
|
-
label_id: zod_1.z.union([zod_1.z.coerce.string(), zod_1.z.string()]).describe("The ID or title of the label"),
|
|
20
|
-
new_name: zod_1.z.string().optional().describe("The new name of the label"),
|
|
12
|
+
.describe("The ID or title of the label. Required for 'update' and 'delete' actions."),
|
|
13
|
+
name: zod_1.z.string().optional().describe("The name of the label. Required for 'create' action."),
|
|
14
|
+
new_name: zod_1.z.string().optional().describe("For 'update': the new name of the label"),
|
|
21
15
|
color: zod_1.z
|
|
22
16
|
.string()
|
|
23
17
|
.optional()
|
|
24
|
-
.describe("The color of the label
|
|
18
|
+
.describe("The color of the label in 6-digit hex notation with leading '#' (e.g. #FFAABB) or CSS color name. Required for 'create' action."),
|
|
25
19
|
description: zod_1.z.string().optional().describe("The description of the label"),
|
|
26
20
|
priority: zod_1.z
|
|
27
21
|
.number()
|
|
28
22
|
.optional()
|
|
29
|
-
.describe("The priority of the label. Must be greater or equal than zero or null to remove the priority"),
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
.describe("The priority of the label. Must be greater or equal than zero or null to remove the priority."),
|
|
24
|
+
})
|
|
25
|
+
.refine(data => data.action === "create" || data.label_id !== undefined, {
|
|
26
|
+
message: "label_id is required for 'update' and 'delete' actions",
|
|
27
|
+
path: ["label_id"],
|
|
28
|
+
})
|
|
29
|
+
.refine(data => data.action !== "create" || data.name !== undefined, {
|
|
30
|
+
message: "name is required for 'create' action",
|
|
31
|
+
path: ["name"],
|
|
32
|
+
})
|
|
33
|
+
.refine(data => data.action !== "create" || data.color !== undefined, {
|
|
34
|
+
message: "color is required for 'create' action",
|
|
35
|
+
path: ["color"],
|
|
34
36
|
});
|
|
35
37
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAsC;AASzB,QAAA,iBAAiB,GAAG,OAAC;KAC/B,MAAM,CAAC;IACN,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CA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AChB,CAAC,CAAC"}
|
|
@@ -3,3 +3,8 @@ export declare const flexibleBoolean: z.ZodPipe<z.ZodTransform<boolean, unknown>
|
|
|
3
3
|
export declare const flexibleBooleanNullable: z.ZodNullable<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>> | z.ZodDefault<z.ZodNullable<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>>;
|
|
4
4
|
export declare const requiredId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
5
5
|
export declare function assertDefined<T>(value: T | undefined, fieldName: string): asserts value is T;
|
|
6
|
+
export declare function validateScopeId(data: {
|
|
7
|
+
scope: "project" | "group";
|
|
8
|
+
projectId?: string;
|
|
9
|
+
groupId?: string;
|
|
10
|
+
}): boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.requiredId = exports.flexibleBooleanNullable = exports.flexibleBoolean = void 0;
|
|
4
4
|
exports.assertDefined = assertDefined;
|
|
5
|
+
exports.validateScopeId = validateScopeId;
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
const DEFAULT_NULL = process.env.DEFAULT_NULL === "true";
|
|
7
8
|
exports.flexibleBoolean = zod_1.z.preprocess(val => {
|
|
@@ -26,4 +27,13 @@ function assertDefined(value, fieldName) {
|
|
|
26
27
|
throw new Error(`${fieldName} is required but was not provided`);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
30
|
+
function validateScopeId(data) {
|
|
31
|
+
if (data.scope === "project") {
|
|
32
|
+
return !!data.projectId;
|
|
33
|
+
}
|
|
34
|
+
if (data.scope === "group") {
|
|
35
|
+
return !!data.groupId;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
29
39
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/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,eAAe,CAAC,IAI/B;IACC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
export * from "./schema-readonly";
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export * from "./registry";
|
|
5
|
+
import type { ToolDefinition } from "../../types";
|
|
6
|
+
export declare const webhooksTools: ToolDefinition[];
|
|
7
|
+
export declare const webhooksReadOnlyTools: string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.webhooksReadOnlyTools = exports.webhooksTools = void 0;
|
|
18
|
+
__exportStar(require("../shared"), exports);
|
|
19
|
+
__exportStar(require("./schema-readonly"), exports);
|
|
20
|
+
__exportStar(require("./schema"), exports);
|
|
21
|
+
__exportStar(require("./registry"), exports);
|
|
22
|
+
const registry_1 = require("./registry");
|
|
23
|
+
const isReadOnly = process.env.GITLAB_READ_ONLY_MODE === "true";
|
|
24
|
+
const webhooksToolsFromRegistry = (0, registry_1.getFilteredWebhooksTools)(isReadOnly);
|
|
25
|
+
exports.webhooksTools = webhooksToolsFromRegistry.map((tool) => ({
|
|
26
|
+
name: tool.name,
|
|
27
|
+
description: tool.description,
|
|
28
|
+
inputSchema: tool.inputSchema,
|
|
29
|
+
}));
|
|
30
|
+
exports.webhooksReadOnlyTools = (0, registry_1.getWebhooksReadOnlyToolNames)();
|
|
31
|
+
//# sourceMappingURL=index.js.map
|