@structured-world/gitlab-mcp 6.7.0 → 6.9.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/LICENSE +202 -21
- package/LICENSE.MIT +21 -0
- package/README.md +182 -3
- package/dist/src/config.d.ts +6 -0
- package/dist/src/config.js +89 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/entities/core/registry.js +68 -63
- package/dist/src/entities/core/registry.js.map +1 -1
- package/dist/src/entities/core/schema-readonly.d.ts +93 -36
- package/dist/src/entities/core/schema-readonly.js +146 -121
- package/dist/src/entities/core/schema-readonly.js.map +1 -1
- package/dist/src/entities/core/schema.d.ts +33 -23
- package/dist/src/entities/core/schema.js +65 -60
- package/dist/src/entities/core/schema.js.map +1 -1
- package/dist/src/entities/files/registry.js +14 -21
- package/dist/src/entities/files/registry.js.map +1 -1
- package/dist/src/entities/files/schema-readonly.d.ts +8 -7
- package/dist/src/entities/files/schema-readonly.js +20 -25
- package/dist/src/entities/files/schema-readonly.js.map +1 -1
- package/dist/src/entities/files/schema.d.ts +22 -15
- package/dist/src/entities/files/schema.js +32 -73
- package/dist/src/entities/files/schema.js.map +1 -1
- package/dist/src/entities/integrations/index.d.ts +7 -0
- package/dist/src/entities/integrations/index.js +31 -0
- package/dist/src/entities/integrations/index.js.map +1 -0
- package/dist/src/entities/integrations/registry.d.ts +5 -0
- package/dist/src/entities/integrations/registry.js +120 -0
- package/dist/src/entities/integrations/registry.js.map +1 -0
- package/dist/src/entities/integrations/schema-readonly.d.ts +7 -0
- package/dist/src/entities/integrations/schema-readonly.js +10 -0
- package/dist/src/entities/integrations/schema-readonly.js.map +1 -0
- package/dist/src/entities/integrations/schema.d.ts +235 -0
- package/dist/src/entities/integrations/schema.js +112 -0
- package/dist/src/entities/integrations/schema.js.map +1 -0
- package/dist/src/entities/labels/registry.js +8 -7
- package/dist/src/entities/labels/registry.js.map +1 -1
- package/dist/src/entities/labels/schema-readonly.d.ts +8 -7
- package/dist/src/entities/labels/schema-readonly.js +20 -18
- package/dist/src/entities/labels/schema-readonly.js.map +1 -1
- package/dist/src/entities/labels/schema.d.ts +15 -8
- package/dist/src/entities/labels/schema.js +36 -27
- package/dist/src/entities/labels/schema.js.map +1 -1
- package/dist/src/entities/milestones/registry.js +7 -8
- package/dist/src/entities/milestones/registry.js.map +1 -1
- package/dist/src/entities/milestones/schema-readonly.d.ts +25 -10
- package/dist/src/entities/milestones/schema-readonly.js +47 -26
- package/dist/src/entities/milestones/schema-readonly.js.map +1 -1
- package/dist/src/entities/milestones/schema.d.ts +19 -9
- package/dist/src/entities/milestones/schema.js +31 -20
- package/dist/src/entities/milestones/schema.js.map +1 -1
- package/dist/src/entities/mrs/registry.js +75 -79
- package/dist/src/entities/mrs/registry.js.map +1 -1
- package/dist/src/entities/mrs/schema-readonly.d.ts +36 -23
- package/dist/src/entities/mrs/schema-readonly.js +197 -338
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
- package/dist/src/entities/mrs/schema.d.ts +113 -37
- package/dist/src/entities/mrs/schema.js +140 -258
- package/dist/src/entities/mrs/schema.js.map +1 -1
- package/dist/src/entities/pipelines/registry.js +10 -4
- package/dist/src/entities/pipelines/registry.js.map +1 -1
- package/dist/src/entities/pipelines/schema-readonly.d.ts +30 -14
- package/dist/src/entities/pipelines/schema-readonly.js +62 -52
- package/dist/src/entities/pipelines/schema-readonly.js.map +1 -1
- package/dist/src/entities/pipelines/schema.d.ts +23 -16
- package/dist/src/entities/pipelines/schema.js +44 -26
- package/dist/src/entities/pipelines/schema.js.map +1 -1
- package/dist/src/entities/snippets/registry.js +79 -67
- package/dist/src/entities/snippets/registry.js.map +1 -1
- package/dist/src/entities/snippets/schema-readonly.d.ts +8 -9
- package/dist/src/entities/snippets/schema-readonly.js +30 -35
- package/dist/src/entities/snippets/schema-readonly.js.map +1 -1
- package/dist/src/entities/snippets/schema.d.ts +7 -11
- package/dist/src/entities/snippets/schema.js +31 -65
- package/dist/src/entities/snippets/schema.js.map +1 -1
- package/dist/src/entities/variables/registry.js +9 -5
- package/dist/src/entities/variables/registry.js.map +1 -1
- package/dist/src/entities/variables/schema-readonly.d.ts +9 -9
- package/dist/src/entities/variables/schema-readonly.js +22 -18
- package/dist/src/entities/variables/schema-readonly.js.map +1 -1
- package/dist/src/entities/variables/schema.d.ts +24 -7
- package/dist/src/entities/variables/schema.js +67 -38
- package/dist/src/entities/variables/schema.js.map +1 -1
- package/dist/src/entities/webhooks/registry.js +48 -46
- package/dist/src/entities/webhooks/registry.js.map +1 -1
- package/dist/src/entities/webhooks/schema-readonly.d.ts +9 -8
- package/dist/src/entities/webhooks/schema-readonly.js +14 -9
- package/dist/src/entities/webhooks/schema-readonly.js.map +1 -1
- package/dist/src/entities/webhooks/schema.d.ts +79 -26
- package/dist/src/entities/webhooks/schema.js +70 -61
- package/dist/src/entities/webhooks/schema.js.map +1 -1
- package/dist/src/entities/wiki/registry.js +7 -4
- package/dist/src/entities/wiki/registry.js.map +1 -1
- package/dist/src/entities/wiki/schema-readonly.d.ts +7 -7
- package/dist/src/entities/wiki/schema-readonly.js +11 -15
- package/dist/src/entities/wiki/schema-readonly.js.map +1 -1
- package/dist/src/entities/wiki/schema.d.ts +19 -8
- package/dist/src/entities/wiki/schema.js +32 -29
- package/dist/src/entities/wiki/schema.js.map +1 -1
- package/dist/src/entities/workitems/registry.js +7 -8
- package/dist/src/entities/workitems/registry.js.map +1 -1
- package/dist/src/entities/workitems/schema-readonly.d.ts +7 -8
- package/dist/src/entities/workitems/schema-readonly.js +12 -14
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
- package/dist/src/entities/workitems/schema.d.ts +17 -11
- package/dist/src/entities/workitems/schema.js +25 -25
- package/dist/src/entities/workitems/schema.js.map +1 -1
- package/dist/src/registry-manager.js +32 -11
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/utils/schema-utils.d.ts +28 -0
- package/dist/src/utils/schema-utils.js +244 -0
- package/dist/src/utils/schema-utils.js.map +1 -0
- package/dist/structured-world-gitlab-mcp-6.9.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/structured-world-gitlab-mcp-6.7.0.tgz +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManageIntegrationSchema = exports.IntegrationTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
exports.IntegrationTypeSchema = zod_1.z.enum([
|
|
7
|
+
"slack",
|
|
8
|
+
"gitlab-slack-application",
|
|
9
|
+
"slack-slash-commands",
|
|
10
|
+
"discord",
|
|
11
|
+
"microsoft-teams",
|
|
12
|
+
"mattermost",
|
|
13
|
+
"mattermost-slash-commands",
|
|
14
|
+
"telegram",
|
|
15
|
+
"matrix",
|
|
16
|
+
"pumble",
|
|
17
|
+
"hangouts-chat",
|
|
18
|
+
"webex-teams",
|
|
19
|
+
"unify-circuit",
|
|
20
|
+
"campfire",
|
|
21
|
+
"irker",
|
|
22
|
+
"jira",
|
|
23
|
+
"jira-cloud-app",
|
|
24
|
+
"bugzilla",
|
|
25
|
+
"redmine",
|
|
26
|
+
"youtrack",
|
|
27
|
+
"clickup",
|
|
28
|
+
"linear",
|
|
29
|
+
"phorge",
|
|
30
|
+
"pivotaltracker",
|
|
31
|
+
"asana",
|
|
32
|
+
"custom-issue-tracker",
|
|
33
|
+
"ewm",
|
|
34
|
+
"jenkins",
|
|
35
|
+
"teamcity",
|
|
36
|
+
"bamboo",
|
|
37
|
+
"buildkite",
|
|
38
|
+
"drone-ci",
|
|
39
|
+
"datadog",
|
|
40
|
+
"mock-ci",
|
|
41
|
+
"diffblue-cover",
|
|
42
|
+
"confluence",
|
|
43
|
+
"external-wiki",
|
|
44
|
+
"apple-app-store",
|
|
45
|
+
"google-play",
|
|
46
|
+
"packagist",
|
|
47
|
+
"google-cloud-platform-artifact-registry",
|
|
48
|
+
"google-cloud-platform-workload-identity-federation",
|
|
49
|
+
"harbor",
|
|
50
|
+
"git-guardian",
|
|
51
|
+
"github",
|
|
52
|
+
"assembla",
|
|
53
|
+
"emails-on-push",
|
|
54
|
+
"pipelines-email",
|
|
55
|
+
"pushover",
|
|
56
|
+
"squash-tm",
|
|
57
|
+
]);
|
|
58
|
+
const projectIdField = utils_1.requiredId.describe("Project ID or URL-encoded path");
|
|
59
|
+
const integrationField = exports.IntegrationTypeSchema.describe("Integration type slug (e.g., slack, jira, discord). Note: gitlab-slack-application cannot be created via API - it requires OAuth installation from GitLab UI.");
|
|
60
|
+
const eventFields = {
|
|
61
|
+
active: utils_1.flexibleBoolean
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("Enable or disable the integration without full configuration"),
|
|
64
|
+
push_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on push events"),
|
|
65
|
+
issues_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on issue events"),
|
|
66
|
+
merge_requests_events: utils_1.flexibleBoolean
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Trigger integration on merge request events"),
|
|
69
|
+
tag_push_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on tag push events"),
|
|
70
|
+
note_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on note events"),
|
|
71
|
+
confidential_issues_events: utils_1.flexibleBoolean
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Trigger integration on confidential issue events"),
|
|
74
|
+
pipeline_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on pipeline events"),
|
|
75
|
+
wiki_page_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on wiki page events"),
|
|
76
|
+
job_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on job events"),
|
|
77
|
+
deployment_events: utils_1.flexibleBoolean
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("Trigger integration on deployment events"),
|
|
80
|
+
releases_events: utils_1.flexibleBoolean.optional().describe("Trigger integration on release events"),
|
|
81
|
+
vulnerability_events: utils_1.flexibleBoolean
|
|
82
|
+
.optional()
|
|
83
|
+
.describe("Trigger integration on vulnerability events"),
|
|
84
|
+
config: zod_1.z
|
|
85
|
+
.record(zod_1.z.string(), zod_1.z.unknown())
|
|
86
|
+
.optional()
|
|
87
|
+
.describe("Integration-specific configuration parameters. Pass as key-value pairs. Examples: webhook_url, token, channel, etc. See GitLab API documentation for integration-specific fields."),
|
|
88
|
+
};
|
|
89
|
+
const GetIntegrationSchema = zod_1.z.object({
|
|
90
|
+
action: zod_1.z.literal("get").describe("Get integration settings (read-only)"),
|
|
91
|
+
project_id: projectIdField,
|
|
92
|
+
integration: integrationField,
|
|
93
|
+
});
|
|
94
|
+
const UpdateIntegrationSchema = zod_1.z
|
|
95
|
+
.object({
|
|
96
|
+
action: zod_1.z.literal("update").describe("Update or enable integration with specific config"),
|
|
97
|
+
project_id: projectIdField,
|
|
98
|
+
integration: integrationField,
|
|
99
|
+
...eventFields,
|
|
100
|
+
})
|
|
101
|
+
.passthrough();
|
|
102
|
+
const DisableIntegrationSchema = zod_1.z.object({
|
|
103
|
+
action: zod_1.z.literal("disable").describe("Disable and remove integration"),
|
|
104
|
+
project_id: projectIdField,
|
|
105
|
+
integration: integrationField,
|
|
106
|
+
});
|
|
107
|
+
exports.ManageIntegrationSchema = zod_1.z.discriminatedUnion("action", [
|
|
108
|
+
GetIntegrationSchema,
|
|
109
|
+
UpdateIntegrationSchema,
|
|
110
|
+
DisableIntegrationSchema,
|
|
111
|
+
]);
|
|
112
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/integrations/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AAM1C,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC;IAE1C,OAAO;IACP,0BAA0B;IAC1B,sBAAsB;IACt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AM,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACvE,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,gBAAgB;CAC9B,CAAC,CAAC;AAGU,QAAA,uBAAuB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IACpE,oBAAoB;IACpB,uBAAuB;IACvB,wBAAwB;CACzB,CAAC,CAAC"}
|
|
@@ -42,7 +42,7 @@ 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
|
|
45
|
+
const config_1 = require("../../config");
|
|
46
46
|
exports.labelsToolRegistry = new Map([
|
|
47
47
|
[
|
|
48
48
|
"browse_labels",
|
|
@@ -52,15 +52,17 @@ exports.labelsToolRegistry = new Map([
|
|
|
52
52
|
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseLabelsSchema),
|
|
53
53
|
handler: async (args) => {
|
|
54
54
|
const input = schema_readonly_1.BrowseLabelsSchema.parse(args);
|
|
55
|
+
if ((0, config_1.isActionDenied)("browse_labels", input.action)) {
|
|
56
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_labels tool`);
|
|
57
|
+
}
|
|
55
58
|
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
56
59
|
switch (input.action) {
|
|
57
60
|
case "list": {
|
|
58
|
-
const { action: _action, namespace: _namespace,
|
|
61
|
+
const { action: _action, namespace: _namespace, ...rest } = input;
|
|
59
62
|
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
60
63
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/labels`, { query });
|
|
61
64
|
}
|
|
62
65
|
case "get": {
|
|
63
|
-
(0, utils_1.assertDefined)(input.label_id, "label_id");
|
|
64
66
|
const query = input.include_ancestor_groups
|
|
65
67
|
? (0, gitlab_api_1.toQuery)({ include_ancestor_groups: input.include_ancestor_groups }, [])
|
|
66
68
|
: undefined;
|
|
@@ -80,11 +82,12 @@ exports.labelsToolRegistry = new Map([
|
|
|
80
82
|
inputSchema: z.toJSONSchema(schema_1.ManageLabelSchema),
|
|
81
83
|
handler: async (args) => {
|
|
82
84
|
const input = schema_1.ManageLabelSchema.parse(args);
|
|
85
|
+
if ((0, config_1.isActionDenied)("manage_label", input.action)) {
|
|
86
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_label tool`);
|
|
87
|
+
}
|
|
83
88
|
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
84
89
|
switch (input.action) {
|
|
85
90
|
case "create": {
|
|
86
|
-
(0, utils_1.assertDefined)(input.name, "name");
|
|
87
|
-
(0, utils_1.assertDefined)(input.color, "color");
|
|
88
91
|
return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/labels`, {
|
|
89
92
|
body: {
|
|
90
93
|
name: input.name,
|
|
@@ -96,12 +99,10 @@ exports.labelsToolRegistry = new Map([
|
|
|
96
99
|
});
|
|
97
100
|
}
|
|
98
101
|
case "update": {
|
|
99
|
-
(0, utils_1.assertDefined)(input.label_id, "label_id");
|
|
100
102
|
const { action: _action, namespace: _namespace, label_id, name: _name, ...body } = input;
|
|
101
103
|
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`, { body, contentType: "json" });
|
|
102
104
|
}
|
|
103
105
|
case "delete": {
|
|
104
|
-
(0, utils_1.assertDefined)(input.label_id, "label_id");
|
|
105
106
|
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/labels/${encodeURIComponent(input.label_id)}`);
|
|
106
107
|
return { deleted: true };
|
|
107
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/labels/registry.ts"],"names":[],"mappings":";;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I,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,15 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const BrowseLabelsSchema: z.ZodObject<{
|
|
3
|
-
action: z.
|
|
4
|
-
list: "list";
|
|
5
|
-
get: "get";
|
|
6
|
-
}>;
|
|
2
|
+
export declare const BrowseLabelsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
action: z.ZodLiteral<"list">;
|
|
7
4
|
namespace: z.ZodString;
|
|
8
|
-
label_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
|
|
9
5
|
search: z.ZodOptional<z.ZodString>;
|
|
10
6
|
with_counts: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
11
7
|
include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
12
8
|
per_page: z.ZodOptional<z.ZodNumber>;
|
|
13
9
|
page: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
}, z.core.$strip
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
action: z.ZodLiteral<"get">;
|
|
12
|
+
namespace: z.ZodString;
|
|
13
|
+
label_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
14
|
+
include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
15
|
+
}, z.core.$strip>], "action">;
|
|
15
16
|
export type BrowseLabelsInput = z.infer<typeof BrowseLabelsSchema>;
|
|
@@ -3,25 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BrowseLabelsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
search: zod_1.z.string().optional().describe("
|
|
14
|
-
with_counts: utils_1.flexibleBoolean
|
|
15
|
-
|
|
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"),
|
|
6
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
7
|
+
const includeAncestorGroupsField = utils_1.flexibleBoolean
|
|
8
|
+
.optional()
|
|
9
|
+
.describe("Include ancestor groups when listing or getting labels");
|
|
10
|
+
const ListLabelsSchema = zod_1.z.object({
|
|
11
|
+
action: zod_1.z.literal("list").describe("List labels with optional filtering"),
|
|
12
|
+
namespace: namespaceField,
|
|
13
|
+
search: zod_1.z.string().optional().describe("Keyword to filter labels by"),
|
|
14
|
+
with_counts: utils_1.flexibleBoolean.optional().describe("Include issue and merge request counts"),
|
|
15
|
+
include_ancestor_groups: includeAncestorGroupsField,
|
|
20
16
|
per_page: zod_1.z.number().optional().describe("Number of items per page"),
|
|
21
17
|
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"],
|
|
26
18
|
});
|
|
19
|
+
const GetLabelSchema = zod_1.z.object({
|
|
20
|
+
action: zod_1.z.literal("get").describe("Get a single label by ID or title"),
|
|
21
|
+
namespace: namespaceField,
|
|
22
|
+
label_id: utils_1.requiredId.describe("The ID or title of the label"),
|
|
23
|
+
include_ancestor_groups: includeAncestorGroupsField,
|
|
24
|
+
});
|
|
25
|
+
exports.BrowseLabelsSchema = zod_1.z.discriminatedUnion("action", [
|
|
26
|
+
ListLabelsSchema,
|
|
27
|
+
GetLabelSchema,
|
|
28
|
+
]);
|
|
27
29
|
//# 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,oCAAuD;
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AAUvD,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAChF,MAAM,0BAA0B,GAAG,uBAAe;KAC/C,QAAQ,EAAE;KACV,QAAQ,CAAC,wDAAwD,CAAC,CAAC;AAGtE,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACzE,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACrE,WAAW,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IAC1F,uBAAuB,EAAE,0BAA0B;IACnD,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,CAAC;AAGH,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACtE,SAAS,EAAE,cAAc;IACzB,QAAQ,EAAE,kBAAU,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7D,uBAAuB,EAAE,0BAA0B;CACpD,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAC/D,gBAAgB;IAChB,cAAc;CACf,CAAC,CAAC"}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ManageLabelSchema: z.ZodObject<{
|
|
3
|
-
action: z.
|
|
4
|
-
create: "create";
|
|
5
|
-
update: "update";
|
|
6
|
-
delete: "delete";
|
|
7
|
-
}>;
|
|
2
|
+
export declare const ManageLabelSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
action: z.ZodLiteral<"create">;
|
|
8
4
|
namespace: z.ZodString;
|
|
9
|
-
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
color: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
action: z.ZodLiteral<"update">;
|
|
11
|
+
namespace: z.ZodString;
|
|
12
|
+
label_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
10
13
|
name: z.ZodOptional<z.ZodString>;
|
|
11
14
|
new_name: z.ZodOptional<z.ZodString>;
|
|
12
15
|
color: z.ZodOptional<z.ZodString>;
|
|
13
16
|
description: z.ZodOptional<z.ZodString>;
|
|
14
17
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
15
|
-
}, z.core.$strip
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
action: z.ZodLiteral<"delete">;
|
|
20
|
+
namespace: z.ZodString;
|
|
21
|
+
label_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
22
|
+
}, z.core.$strip>], "action">;
|
|
16
23
|
export type ManageLabelInput = z.infer<typeof ManageLabelSchema>;
|
|
@@ -3,35 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ManageLabelSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
7
|
+
const labelIdField = utils_1.requiredId.describe("The ID or title of the label");
|
|
8
|
+
const descriptionField = zod_1.z.string().optional().describe("The description of the label");
|
|
9
|
+
const priorityField = zod_1.z
|
|
10
|
+
.number()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("The priority of the label. Must be greater or equal than zero or null to remove the priority.");
|
|
13
|
+
const CreateLabelSchema = zod_1.z.object({
|
|
14
|
+
action: zod_1.z.literal("create").describe("Create a new label"),
|
|
15
|
+
namespace: namespaceField,
|
|
16
|
+
name: zod_1.z.string().describe("The name of the label"),
|
|
17
|
+
color: zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.describe("The color of the label in 6-digit hex notation with leading '#' (e.g. #FFAABB) or CSS color name"),
|
|
20
|
+
description: descriptionField,
|
|
21
|
+
priority: priorityField,
|
|
22
|
+
});
|
|
23
|
+
const UpdateLabelSchema = zod_1.z.object({
|
|
24
|
+
action: zod_1.z.literal("update").describe("Update an existing label"),
|
|
25
|
+
namespace: namespaceField,
|
|
26
|
+
label_id: labelIdField,
|
|
27
|
+
name: zod_1.z.string().optional().describe("The name of the label"),
|
|
28
|
+
new_name: zod_1.z.string().optional().describe("The new name of the label"),
|
|
15
29
|
color: zod_1.z
|
|
16
30
|
.string()
|
|
17
31
|
.optional()
|
|
18
|
-
.describe("The color of the label in 6-digit hex notation with leading '#' (e.g. #FFAABB) or CSS color name
|
|
19
|
-
description:
|
|
20
|
-
priority:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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"],
|
|
32
|
+
.describe("The color of the label in 6-digit hex notation with leading '#' (e.g. #FFAABB) or CSS color name"),
|
|
33
|
+
description: descriptionField,
|
|
34
|
+
priority: priorityField,
|
|
35
|
+
});
|
|
36
|
+
const DeleteLabelSchema = zod_1.z.object({
|
|
37
|
+
action: zod_1.z.literal("delete").describe("Delete a label"),
|
|
38
|
+
namespace: namespaceField,
|
|
39
|
+
label_id: labelIdField,
|
|
36
40
|
});
|
|
41
|
+
exports.ManageLabelSchema = zod_1.z.discriminatedUnion("action", [
|
|
42
|
+
CreateLabelSchema,
|
|
43
|
+
UpdateLabelSchema,
|
|
44
|
+
DeleteLabelSchema,
|
|
45
|
+
]);
|
|
37
46
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAsC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAsC;AAUtC,MAAM,cAAc,GAAG,OAAC,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AQ,EAAE,aAAa;CACxB,CAAC,CAAC;AAGH,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACtD,SAAS,EAAE,cAAc;IACzB,QAAQ,EAAE,YAAY;CACvB,CAAC,CAAC;AAGU,QAAA,iBAAiB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAC9D,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;CAClB,CAAC,CAAC"}
|
|
@@ -42,7 +42,7 @@ 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
|
|
45
|
+
const config_1 = require("../../config");
|
|
46
46
|
exports.milestonesToolRegistry = new Map([
|
|
47
47
|
[
|
|
48
48
|
"browse_milestones",
|
|
@@ -52,6 +52,9 @@ exports.milestonesToolRegistry = new Map([
|
|
|
52
52
|
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseMilestonesSchema),
|
|
53
53
|
handler: async (args) => {
|
|
54
54
|
const input = schema_readonly_1.BrowseMilestonesSchema.parse(args);
|
|
55
|
+
if ((0, config_1.isActionDenied)("browse_milestones", input.action)) {
|
|
56
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_milestones tool`);
|
|
57
|
+
}
|
|
55
58
|
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
56
59
|
switch (input.action) {
|
|
57
60
|
case "list": {
|
|
@@ -60,11 +63,9 @@ exports.milestonesToolRegistry = new Map([
|
|
|
60
63
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones`, { query });
|
|
61
64
|
}
|
|
62
65
|
case "get": {
|
|
63
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
64
66
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${input.milestone_id}`);
|
|
65
67
|
}
|
|
66
68
|
case "issues": {
|
|
67
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
68
69
|
const { action: _action, namespace: _namespace, milestone_id, ...rest } = input;
|
|
69
70
|
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
70
71
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${milestone_id}/issues`, {
|
|
@@ -72,13 +73,11 @@ exports.milestonesToolRegistry = new Map([
|
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
case "merge_requests": {
|
|
75
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
76
76
|
const { action: _action, namespace: _namespace, milestone_id, ...rest } = input;
|
|
77
77
|
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
78
78
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${milestone_id}/merge_requests`, { query });
|
|
79
79
|
}
|
|
80
80
|
case "burndown": {
|
|
81
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
82
81
|
const { action: _action, namespace: _namespace, milestone_id, ...rest } = input;
|
|
83
82
|
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
84
83
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${milestone_id}/burndown_events`, { query });
|
|
@@ -97,6 +96,9 @@ exports.milestonesToolRegistry = new Map([
|
|
|
97
96
|
inputSchema: z.toJSONSchema(schema_1.ManageMilestoneSchema),
|
|
98
97
|
handler: async (args) => {
|
|
99
98
|
const input = schema_1.ManageMilestoneSchema.parse(args);
|
|
99
|
+
if ((0, config_1.isActionDenied)("manage_milestone", input.action)) {
|
|
100
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_milestone tool`);
|
|
101
|
+
}
|
|
100
102
|
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
101
103
|
switch (input.action) {
|
|
102
104
|
case "create": {
|
|
@@ -107,7 +109,6 @@ exports.milestonesToolRegistry = new Map([
|
|
|
107
109
|
});
|
|
108
110
|
}
|
|
109
111
|
case "update": {
|
|
110
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
111
112
|
const { action: _action, namespace: _namespace, milestone_id, ...body } = input;
|
|
112
113
|
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/milestones/${milestone_id}`, {
|
|
113
114
|
body,
|
|
@@ -115,12 +116,10 @@ exports.milestonesToolRegistry = new Map([
|
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
118
|
case "delete": {
|
|
118
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
119
119
|
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/milestones/${input.milestone_id}`);
|
|
120
120
|
return { deleted: true };
|
|
121
121
|
}
|
|
122
122
|
case "promote": {
|
|
123
|
-
(0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
|
|
124
123
|
if (entityType !== "projects") {
|
|
125
124
|
throw new Error("Milestone promotion is only available for projects, not groups");
|
|
126
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/milestones/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/milestones/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKA,wEAEC;AAKD,oEAEC;AAKD,gEAUC;AAzLD,uCAAyB;AACzB,uDAA2D;AAC3D,qCAAiD;AACjD,uDAAyD;AACzD,qDAA+D;AAG/D,yCAA8C;AAQjC,QAAA,sBAAsB,GAAiB,IAAI,GAAG,CAAiC;IAK1F;QACE,mB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AE,CAAC;4BAC9B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;wBACpF,CAAC;wBAED,OAAO,mBAAM,CAAC,IAAI,CAChB,YAAY,WAAW,eAAe,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,CACvF,CAAC;oBACJ,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,8BAA8B;IAC5C,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC/B,CAAC;AAKD,SAAgB,4BAA4B;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,8BAAsB,CAAC,MAAM,EAAE,CAAC,CAAC;AACrD,CAAC;AAKD,SAAgB,0BAA0B,CACxC,eAAwB,KAAK;IAE7B,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,8BAA8B,EAAE,CAAC;QACvD,OAAO,KAAK,CAAC,IAAI,CAAC,8BAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAC/D,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,4BAA4B,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -15,16 +15,11 @@ export declare const GitLabMilestonesSchema: z.ZodObject<{
|
|
|
15
15
|
expired: z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>;
|
|
16
16
|
web_url: z.ZodOptional<z.ZodString>;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
|
-
export declare const BrowseMilestonesSchema: z.ZodObject<{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
list: "list";
|
|
23
|
-
get: "get";
|
|
24
|
-
burndown: "burndown";
|
|
25
|
-
}>;
|
|
18
|
+
export declare const BrowseMilestonesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
action: z.ZodLiteral<"list">;
|
|
26
22
|
namespace: z.ZodString;
|
|
27
|
-
milestone_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
|
|
28
23
|
iids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
24
|
state: z.ZodOptional<z.ZodEnum<{
|
|
30
25
|
closed: "closed";
|
|
@@ -35,8 +30,28 @@ export declare const BrowseMilestonesSchema: z.ZodObject<{
|
|
|
35
30
|
include_ancestors: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
36
31
|
updated_before: z.ZodOptional<z.ZodString>;
|
|
37
32
|
updated_after: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
action: z.ZodLiteral<"get">;
|
|
35
|
+
namespace: z.ZodString;
|
|
36
|
+
milestone_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
38
|
per_page: z.ZodOptional<z.ZodNumber>;
|
|
39
39
|
page: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
|
|
40
|
+
action: z.ZodLiteral<"issues">;
|
|
41
|
+
namespace: z.ZodString;
|
|
42
|
+
milestone_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
action: z.ZodLiteral<"merge_requests">;
|
|
47
|
+
namespace: z.ZodString;
|
|
48
|
+
milestone_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
action: z.ZodLiteral<"burndown">;
|
|
53
|
+
namespace: z.ZodString;
|
|
54
|
+
milestone_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
55
|
+
}, z.core.$strip>], "action">;
|
|
41
56
|
export type BrowseMilestonesInput = z.infer<typeof BrowseMilestonesSchema>;
|
|
42
57
|
export type GitLabMilestones = z.infer<typeof GitLabMilestonesSchema>;
|